Lab 06: Auctions
This lab introduces auction theory through competitive bidding mechanisms.
Game Overview
Type: Auction-based games Players: 2+ players Rounds: Multiple rounds with bidding phases Stages: Multi-stage with bidding and allocation phases
Games
Auction Game
Actions: Bid amounts for items
State Space: Current bids, valuations, and auction history
Key Concept: Optimal bidding strategies and auction design
State Space
Observations
observation = {
"current_round": 3, # Current auction round
"my_valuation": 50, # My value for the item
"current_bids": [30, 45], # All current bids
"auction_history": [...], # Previous auction results
"items_remaining": 5 # Items left to auction
}
Actions
action = 25 # Bid amount (integer)
action = 0 # No bid
Rewards
Auction outcome payoffs:
# Second-price auction example
if my_bid == max_bid: # I win
second_highest = sorted(bids)[-2]
reward = my_valuation - second_highest
else: # I don't win
reward = 0
Game Structure
Stage Type
Multi-stage with bidding and allocation phases
Auction dynamics - competitive bidding environment
Valuation-based - different players have different values
Learning Opportunities
Optimal bidding - bid optimally given valuations
Auction design - understand different auction formats
Strategic behavior - avoid overbidding and underbidding
Testing
Local Testing
from core.engine import Engine
from core.game.AuctionGame import AuctionGame
from core.agents.lab06.random_agent import RandomAgent
my_agent = MyAgent("MyAgent")
opponent = RandomAgent("Random")
engine = Engine(AuctionGame(), [my_agent, opponent], rounds=100)
results = engine.run()
print(f"My score: {results[0]}")
print(f"Opponent score: {results[1]}")
Bidding Analysis
def analyze_bidding(self):
if hasattr(self, 'bid_history'):
avg_bid = sum(self.bid_history) / len(self.bid_history)
print(f"Average bid: {avg_bid}")
print(f"Bid range: {min(self.bid_history)} - {max(self.bid_history)}")
Next Steps
Implement an auction agent using the common patterns
Study auction theory to understand optimal strategies
Test different bidding approaches against various opponents
Compete against other students
Focus on understanding auction mechanisms and optimal bidding strategies!