MW::Game Class Reference

List of all members.

Public Member Functions

def __init__
def play
def getAvgWealth
def getStDevWealth
def playStage
def gameStats
def getEqWealths
def wealthBalanced
def getNumEdges


Detailed Description

This class keeps track of the state of the game as well as operates it,
asking for input from the players when necessary.

Member Function Documentation

def MW::Game::__init__ (   self,
  size,
  type,
  agent,
  cost = 0.02,
  maxBuys = 2,
  network = None,
  steps = 3 
)

Initializes a game, instantiating various variables to keep track of the
state of the game as well as record statistics about the game.

def MW::Game::play (   self  ) 

After a game is instantiated, it may be run by calling this function,
which plays each stage in turn.  For a one-stage game, the function
is not strictly necessary, but I kept it around to preserve flexibility.

def MW::Game::getAvgWealth (   self  ) 

This returns the average wealth of all players as a single number 
after the game is finished; it is one measure of how efficiently 
players purchased edges.  Note that the game itself may cause
negative social utility since players may make decisions that
are only slightly beneficial to themselves while being largely
detrimental to their neighbors

def MW::Game::getStDevWealth (   self,
  stage 
)

This returns the standard deviation of wealth in the graph for
a particular stage and is a measure of the equality of the graph.

def MW::Game::playStage (   self  ) 

This plays a particular stage of the game, prompting
vertices for their buying decisions and then calculating
equilibrium wealth

def MW::Game::gameStats (   self  ) 

Returns a number of stats about the game, specifically:
Aggregate increase in social wealth, aggregate money spent
Edge cost, size of network, and x player info lists, where
x is number of players in the network
Each player info list in turn

def MW::Game::getEqWealths (   self  ) 

Returns the equilibrium wealths for a network, using the algorithm
outlined in "A network formation game for bipartite exchange
economies" by Even-Dar et. al.  The algorithm is not the most
efficient existing one to compute the equilibrium but will serve
well for our purposes.

def MW::Game::wealthBalanced (   self  ) 

Returns true if everyone has the same equilibrium wealth,
otherwise false

def MW::Game::getNumEdges (   self  ) 

Returns the number of edges in the network, really counting each
edge as two - one in one direction and one in the other direction


The documentation for this class was generated from the following file:

Generated on Mon Apr 21 22:45:48 2008 for Milks and Wheats by  doxygen 1.5.5