CS404/924 Agent Based Systems
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
A Multi-Agent Interaction
Imagine an auction of paintings by four famous artists: Picasso, Van Gogh, Rembrandt and Da Vinci. The auction proceeds in rounds. In each round, the auctioneer presents a piece to be sold. All bidders then write their bids for the item on a secret sealed note that is handed to the auctioneer. The highest bidder wins the piece and pays their bid (“first-price auction”). Then, the auctioneer starts the next round with a new painting. The auction continues until there are no more paintings to sell. The overall winner is then decided by a winning condition that is specified below.
2 The Game
The Auctioneer will then sell the paintings one after another. In each round, the Auctioneer will announce the item type (Picasso, Van Gogh, Rembrandt, or Da Vinci) to be bid upon and ask the bots for bids. Your bot will use the information that the Auctioneer gives, including the outcomes of the previous rounds, to determine an amount to bid. Your bid cannot exceed your remaining budget. Once all bots have bid, the Auctioneer will declare the highest bidder the winner, who will then be charged a payment equal to their bid and receive the item. If the top bids draw, then the winner is chosen at random from those bidders. For each round, there is exactly one winner.
The starting budget for every bidder is 1001. The auction will continue for 200 rounds. Any remaining unspent budget at the end of the auction is not considered in determining the winner.
Winning condition: At the end of the auction, each bidder’s collection will be evaluated based on the number of paintings they own from each artist. For each bidder, the product of the counts of paintings they hold from each artist will be calculated (i.e., multiply the number of paintings from Artist 1 × Artist 2 × Artist 3 × Artist 4). The bidder with the highest product wins.
For example, Player A has paintings (3, 3, 1, 1) with a score of 9, Player B has paintings (2, 2, 2, 2) with a score of 16, and Player C has paintings (10, 1, 1, 0) with a score of 0. Here, Player B would be declared the winner.
You will write your strategies in your bot. Your bot will be tested in a series of different auction rooms against bots of varying difficulty and number. Finally, your bots will be tested against each other in a tournament.
auctioneer.py contains the definition for the auctioneer class, which sets up and runs the auction. We will use this exact same file while marking your bots, so DO NOT CHANGE ANY OF THE CODE IN THIS FILE.CS404 Agent Based Systems Coursework
It has the following arguments:
- room(list of modules): A “room” is a list of bots that will play the auction. The bots are module objects. There is an example of how to import them at the top of the auctioneer.py file, and how to pass them to the auctioneer as a list at the bottom of the auctioneer.py file. There are also examples in the arena.py file.
- painting order(list of strings): A list of the sequence of painting types that will be auctioned in each of the rounds. If this is set to None, then a random order will be used.
- slowdown(float): How long to wait at each round of the auction. If you set this to zero the auctions will run fast.
- verbose(boolean): Whether the auctioneer prints updates to the terminal or not.
- output csv file(string): The auctioneer automatically logs the result of every round in an auction. This defaults to ’data/auctioneer log.csv’, but you can specify a different filename.
The method run auction() will run the auction until it is completed.
It is not necessary to know how the auctioneer class works to do well on the coursework. But if you are interested there are more details in the README.md file.
The arena.py file is provided as a convenient way to run auctions. This includes some methods that show examples of how to run auctions. This is given to you as an example, so please feel free to change any of the code here and experiment.
You might want to run an auction slowly, with a full print out to the terminal of the auction’s progress, as shown in run basic auction(). This will be useful to see how your bot is performing live. Or you might want to run lots of auctions quickly, as shown in run lots of auctions().
In the bots folder we included a few bots for you to practice with. We have given you 3 bots. bots/u1234321.py is a good starting point for your own bot, with everything commented clearly. bots/flat bot 10.py and bots/random bot.py are example bots that should be easy to beat.
u1234321.py is an example bot that you can use as a starting point to write your own bot.
Your bot will be initialised at the start of the auction, and then will play until the auction finishes. This means that your bot can hold internal state variables during the auction, which may be useful for some strategies. You can add these variables, or any other code, in the init () method, if you want to. Please change the self.name=“1234321” variable to your own ID number.
Feel free to add any extra methods that you might need, but be careful that the main method keeps the same input variables and returns an integer bid without crashing.
If your bot crashes then your bid will be set to zero. If your bot returns a float then this will be rounded down to an integer. If your bot bids more than their budget then their bid will be set to zero. If your bot takes longer than 3 seconds to return a bid, then again your bid will be set to zero.
- random bot.py: Bids a random integer between 0 and the bot’s remaining budget.
- flat bot 10.py: Bids 10 on everything.
You can add your own. You can see how to import bots and play against them in the arena.py file.
Your coursework submission will consist of a single compressed file (either .zip or .tgz) containing your bot in a python file and your writeup as a pdf. The coursework file should be submitted through Tabula.
Please save this as u<YOUR WARWICK ID NUMBER>.py. The main class should be called Bot, and in the init () method you should set self.name = <YOUR WARWICK ID NUMBER>. Here is an example:
Here is an example of how your bot will be imported and run:
Please make sure that your bot will run in this way, replacing the id number here with your own id number. If you run the above script you should see the auction run very fast and then print out “The winner is [1867321]”, with your id number shown (if your strategy can beat a random bot).
You can test that your bot runs correctly by using the functions provided in the arena.py file. If your bot crashes you will lose marks!
Your bot will be tested in a range of different auction “rooms”, made up of bots of different difficulties, in different room sizes and compositions. For example, you will be tested in a room against one random bot. You will also be tested in a room with a mix of up to 10 bots with different strategies. Your bot’s performance in this set of rooms will form the majority of your mark for strategy performance.
We will also play the student bots against each other, and this will contribute to your mark for strategy performance.
https://warwick.ac.uk/fac/sci/dcs/teaching/handbook/coursework.
In addition, please note that any attempt to access other bots, modify the auctioneer class or otherwise intervene in the fair running of the auctions will be considered cheating and sanctioned accordingly.
Acknowledgements
2026-03-31