MW::Player Class Reference
List of all members.
Detailed Description
This implements the player class, whose main function is deciding
which edges to purchase in order to maximize wealth
Member Function Documentation
| def MW::Player::__init__ |
( |
|
self, |
|
|
|
num, |
|
|
|
game, |
|
|
|
agent | |
|
) |
| | |
Instantiates an instance of the player class
| def MW::Player::getType |
( |
|
self |
) |
|
Returns which type of vertex the player is, milk or wheat
| def MW::Player::rewardFn |
( |
|
self |
) |
|
Returns the total reward experienced by a player during
a game. The reward is measured as the incremental gain
(or loss) in equilibrium wealth, minus the amount spent
by the player on edge purchases
| def MW::Player::getPrevRoundWealth |
( |
|
self |
) |
|
Returns your equilibrium wealth in the 0th round
| def MW::Player::getNeighbors |
( |
|
self |
) |
|
Returns a list containing references to all neighbors
of the current vertex
| def MW::Player::getNumNeighbors |
( |
|
self |
) |
|
Returns the number of neighbors the vertex has
| def MW::Player::getNeighborInfo |
( |
|
self |
) |
|
returns a list which contains tuples representing
each of your neighbors. The tuple is
(neighbor ID, neighbor degree)
| def MW::Player::getEligiblePurchases |
( |
|
self, |
|
|
|
steps | |
|
) |
| | |
This returns all vertices the player is eligible to purchase
In order to be able to purchase a vertex, you have to be in
its neighborhood, defined to be three hops away.
This method has been updated to accept any number of
(odd) steps away
| def MW::Player::possPurchaseInfo |
( |
|
self |
) |
|
Exactly like get purchase info, but for information about the
possible purchases the player can make instead of information
about the actual purchases the player is making.
| def MW::Player::getPurchaseInfo |
( |
|
self |
) |
|
This is a helper method to getDelta in the QLearner class,
it takes the purchase info that the decidePurchase method
generates and sorts it so that it can be used by getDelta.
| def MW::Player::postPurchaseInfo |
( |
|
self |
) |
|
This is a helper method to gameStats that returns info
about how the edges that got purchased to fared after
the round was over
| def MW::Player::decidePurchase |
( |
|
self |
) |
|
This function is at the core of the program, as it returns
a list of bought edges or None. It uses a variety of AI algorithms
to decide which purchase it should make, corresponding to each
of the agent classes below
The documentation for this class was generated from the following file:
- C:/Documents and Settings/Tony/Desktop/workspace/MW/src/MW.py