uchicago.src.sim.games
Class GameUtilities
java.lang.Object
|
+--uchicago.src.sim.games.GameUtilities
- public class GameUtilities
- extends Object
Utility methods for payoff matrix games.
|
Method Summary |
static int |
getBestStrategy(List gameAgents)
Returns the best (highest payoff) strategy for the last round. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GameUtilities
public GameUtilities()
getBestStrategy
public static int getBestStrategy(List gameAgents)
- Returns the best (highest payoff) strategy for the last round. This
calls getStrategy and getPayoff on each GameAgent in the list and
returns which strategy had the highest total payoff. Strategies are
defined as int constants in GameAgent (GameAgent.LEFT and
GameAgent.RIGHT). If the totalPayoffs are equal then one will be
picked at random. Note that this does plain old floating point addition
and so the result is not exactly accurate.
- Parameters:
gameAgents - a list of GameAgents
Bug reports and feature requests to RePast