def __init__(self, bidder_id, num_rounds, num_bidders, possible_types, type_dist, type_dist_disc):
        """
        :param bidder_id: Integer.  A unique identifier for this given agent.
        :param num_rounds: Integer.  The number of rounds the auction this bidder is participating in will run for.
        :param num_bidders: Integer.  The total number of bidders in the auction this bidder is participating in.
        :param possible_types: List.  A list of all possible types the bidder can take.  Types are arranged in
        increasing order.
        :param type_dist: List.  Probabilities corresponding to each entry in possible_types.
        :param type_dist_disc: Boolean.  True if type_dist is describing a discrete distribution.
        """
        SimpleBidder.__init__(self, bidder_id, num_rounds, num_bidders, possible_types, type_dist, type_dist_disc)
        self.state_space = set()
        self.terminal_states = set()
        self.action_space = set()
        self.T = {}
        self.R = {}
        self.Q = {}
        self.V = {}
        self.pi = {}

        self.price_prediction = {}
        self.price_pdf = {}
        self.price_cdf = {}

        self.make_state_space()
        self.make_action_space()

        # Force the bidder to bid truthfully in the last round.
        self.bid_val_in_last_round = False
        if self.bid_val_in_last_round:
            for v in self.valuations:
                self.action_space.add(v)
Example #2
0
 def __init__(self, bidder_id, num_rounds, num_bidders, possible_types, type_dist, type_dist_disc):
     """
     :param bidder_id: Integer.  A unique identifier for this given agent.
     :param num_rounds: Integer.  The number of rounds the auction this bidder is participating in will run for.
     :param num_bidders: Integer.  The total number of bidders in the auction this bidder is participating in.
     :param possible_types: List.  A list of all possible types the bidder can take.  Types are arranged in
     increasing order.
     :param type_dist: List.  Probabilities corresponding to each entry in possible_types.
     """
     SimpleBidder.__init__(self, bidder_id, num_rounds, num_bidders, possible_types, type_dist, type_dist_disc)
     self.valuations = self.make_valuations()
Example #3
0
 def __init__(self, bidder_id, num_rounds, num_bidders, possible_types, type_dist, type_dist_disc):
     """
     :param bidder_id: Integer.  A unique identifier for this given agent.
     :param num_rounds: Integer.  The number of rounds the auction this bidder is participating in will run for.
     :param num_bidders: Integer.  The total number of bidders in the auction this bidder is participating in.
     :param possible_types: List.  A list of all possible types the bidder can take.  Types are arranged in
     increasing order.
     :param type_dist: List.  Probabilities corresponding to each entry in possible_types.
     :param type_dist_disc: Boolean.  True if type_dist is describing a discrete distribution.
     """
     assert not type_dist_disc, "Only continuous distributions are supported."
     SimpleBidder.__init__(self, bidder_id, num_rounds, num_bidders, possible_types, type_dist, type_dist_disc)
 def __init__(self, bidder_id, num_rounds, num_bidders, possible_types, type_dist, type_dist_disc):
     """
     :param bidder_id: Integer.  A unique identifier for this given agent.
     :param num_rounds: Integer.  The number of rounds the auction this bidder is participating in will run for.
     :param num_bidders: Integer.  The total number of bidders in the auction this bidder is participating in.
     :param possible_types: List.  A list of all possible types the bidder can take.  Types are arranged in
     increasing order.
     :param type_dist: List.  Probabilities corresponding to each entry in possible_types.
     :param type_dist_disc: Boolean.  True if type_dist is describing a discrete distribution.
     """
     # Bidder valuations are drawn from distribution F, where F(0) = 0 and density f > 0
     assert all(possible_types[i] >= 0 for i in range(len(possible_types))
                if type_dist[i] > 0.0), "Valuations cannot be negative."
     SimpleBidder.__init__(self, bidder_id, num_rounds, num_bidders, possible_types, type_dist, type_dist_disc)
Example #5
0
 def __init__(self, bidder_id, num_rounds, num_bidders, possible_types, type_dist, type_dist_disc):
     """
     :param bidder_id: Integer.  A unique identifier for this given agent.
     :param num_rounds: Integer.  The number of rounds the auction this bidder is participating in will run for.
     :param num_bidders: Integer.  The total number of bidders in the auction this bidder is participating in.
     :param possible_types: List.  A list of all possible types the bidder can take.  Types are arranged in
     increasing order.
     :param type_dist: List.  Probabilities corresponding to each entry in possible_types.
     :param type_dist_disc: Boolean.  True if type_dist is describing a discrete distribution.
     """
     SimpleBidder.__init__(self, bidder_id, num_rounds, num_bidders, possible_types, type_dist, type_dist_disc)
     self.action_space = possible_types
     self.prob_winning = [[[0.0] * len(self.action_space)
                           for j in range(num_rounds)]
                          for X in range(num_rounds)]
     self.num_price_samples = len(self.action_space)
     self.price_prediction = [[[0] * self.num_price_samples
                               for j in range(self.num_rounds)]
                              for X in range(self.num_rounds)]
     self.price_pdf = [[[0] * self.num_price_samples
                        for j in range(self.num_rounds)]
                       for X in range(self.num_rounds)]
     self.price_cdf = [[[0] * self.num_price_samples
                        for j in range(self.num_rounds)]
                       for X in range(self.num_rounds)]
     # Parameters for solving the Markov Decision Process
     # States: (X, j).  X goods won at round j.
     # Actions: b.  Bid b from the action space.
     # Rewards, R(s, a)
     self.R = [[[0 for b in range(len(self.action_space))]
                for j in range(self.num_rounds + 1)]
               for X in range(self.num_rounds + 1)]
     # Q values, Q(s, a)
     self.Q = [[[0 for b in range(len(self.action_space))]
                for j in range(self.num_rounds + 1)]
               for X in range(self.num_rounds + 1)]
     # Values, V(s) = max_a Q(s, a)
     self.V = [[0 for j in range(self.num_rounds + 1)]
               for X in range(self.num_rounds + 1)]
     # Transition function, T(s, a, s')
     self.T = [[[[[0 for j2 in range(self.num_rounds + 1)]
                  for X2 in range(self.num_rounds + 1)]
                 for b in range(len(self.action_space))]
                for j in range(self.num_rounds + 1)]
               for X in range(self.num_rounds + 1)]