Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uchicago.src.sim.games
Class GameUtilities

    java.lang.Object
      uchicago.src.sim.games.GameUtilities

    public class GameUtilities

extends java.lang.Object

Utility methods for payoff matrix games.

Constructor Summary
`GameUtilities()`

Method Summary
`static int` | `getBestStrategy(java.util.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`

Constructor Detail

### GameUtilities

    public GameUtilities()

Method Detail

### getBestStrategy

    public static int getBestStrategy(java.util.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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD