-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathu1234321.py
100 lines (84 loc) · 5.26 KB
/
u1234321.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
https://powcoder.com
代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder
import random
class Bot(object):
def __init__(self):
self.name = "1234321" # Put your id number her. String or integer will both work
# Add your own variables here, if you want to.
def get_bid_for_collection_game(self, current_round, bots, game_type, winner_pays, artists_and_values, round_limit,
starting_budget, painting_order, target_collection, my_bot_details, current_painting, winner_ids, amounts_paid):
"""Strategy for collection type games.
Parameters:
current_round(int): The current round of the auction game
bots(dict): A dictionary holding the details of all of the bots in the auction
For each bot, you are given these details:
bot_name(str): The bot's name
bot_unique_id(str): A unique id for this bot
paintings(dict): A dict of the paintings won so far by this bot
budget(int): How much budget this bot has left
score(int): Current value of paintings (for value game)
game_type(str): Will be "collection" for collection type games
winner_pays(int): Rank of bid that winner plays. 1 is 1st price auction. 2 is 2nd price auction.
artists_and_values(dict): A dictionary of the artist names and the painting value to the score (for value games)
round_limit(int): Total number of rounds in the game - will always be 200
starting_budget(int): How much budget each bot started with - will always be 1001
painting_order(list str): A list of the full painting order
target_collection(list int): A list of the type of collection required to win, for collection games - will always be [3,3,1,1]
[5] means that you need 5 of any one type of painting
[4,2] means you need 4 of one type of painting and 2 of another
[3,2,1] means you need 3 of one type of painting, 2 of another, and 1 of another
my_bot_details(dict): Your bot details. Same as in the bots dict, but just your bot.
Includes your current paintings, current score and current budget
current_painting(str): The artist of the current painting that is being bid on
winner_ids(list str): A list of the ids of the winners of each round so far
amounts_paid(list int): List of amounts paid for paintings in the rounds played so far
Returns:
int:Your bid. Return your bid for this round.
"""
# WRITE YOUR STRATEGY HERE FOR COLLECTION TYPE GAMES - FIRST TO COMPLETE A FULL COLLECTION
my_budget = my_bot_details["budget"]
return random.randint(0, my_budget)
def get_bid_for_value_game(self, current_round, bots, game_type, winner_pays, artists_and_values, round_limit,
starting_budget, painting_order, target_collection, my_bot_details, current_painting, winner_ids, amounts_paid):
"""Strategy for value type games.
Parameters:
current_round(int): The current round of the auction game
bots(dict): A dictionary holding the details of all of the bots in the auction
For each bot, you are given these details:
bot_name(str): The bot's name
bot_unique_id(str): A unique id for this bot
paintings(dict): A dict of the paintings won so far by this bot
budget(int): How much budget this bot has left
score(int): Current value of paintings (for value game)
game_type(str): Will be either "collection" or "value", the two types of games we will play
winner_pays(int): Rank of bid that winner plays. 1 is 1st price auction. 2 is 2nd price auction.
artists_and_values(dict): A dictionary of the artist names and the painting value to the score (for value games)
round_limit(int): Total number of rounds in the game
starting_budget(int): How much budget each bot started with
painting_order(list str): A list of the full painting order
target_collection(list int): A list of the type of collection required to win, for collection games
[5] means that you need 5 of any one type of painting
[4,2] means you need 4 of one type of painting and 2 of another
[3,2,1] means you need 3 of one type of painting, 2 of another, and 1 of another
my_bot_details(dict): Your bot details. Same as in the bots dict, but just your bot.
Includes your current paintings, current score and current budget
current_painting(str): The artist of the current painting that is being bid on
winner_ids(list str): A list of the ids of the winners of each round so far
amounts_paid(list int): List of amounts paid for paintings in the rounds played so far
Returns:
int:Your bid. Return your bid for this round.
"""
# WRITE YOUR STRATEGY HERE FOR VALUE GAMES - MOST VALUABLE PAINTINGS WON WINS
# Here is an example of how to get the current painting's value
current_painting_value = artists_and_values[current_painting]
print("The current painting's value is ", current_painting_value)
# Here is an example of printing who won the last round
if current_round>1:
who_won_last_round = winner_ids[current_round-1]
print("The last round was won by ", who_won_last_round)
# Play around with printing out other variables in the function,
# to see what kind of inputs you have to work with
my_budget = my_bot_details["budget"]
return random.randint(0, my_budget)