edu.stanford.multiagent.gamer
Class Outcome

java.lang.Object
  |
  +--edu.stanford.multiagent.gamer.Outcome

public class Outcome
extends java.lang.Object

The utility class encapsulates the notion of an outcome Action numbering starts at one


Constructor Summary
Outcome(int nPlayers, int[] nActions)
           
 
Method Summary
 int[] getNumActions()
           
 int getNumOutcomes()
           
 int getNumPlayers()
           
 int[] getOutcome()
           
 boolean hasMoreOutcomes()
           
static void main(java.lang.String[] args)
           
 void nextOutcome()
          In a two by two matrix game, the outcomes are looped over in the order top left, bottom left, top right, bottom right.
 void reset()
           
 void reset(int[] actions)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Outcome

public Outcome(int nPlayers,
               int[] nActions)
Method Detail

getNumActions

public int[] getNumActions()

getNumPlayers

public int getNumPlayers()

getNumOutcomes

public int getNumOutcomes()

reset

public void reset()

reset

public void reset(int[] actions)
           throws java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException

getOutcome

public int[] getOutcome()

hasMoreOutcomes

public boolean hasMoreOutcomes()

nextOutcome

public void nextOutcome()
                 throws java.util.NoSuchElementException
In a two by two matrix game, the outcomes are looped over in the order top left, bottom left, top right, bottom right. Can extend this idea of first player's actions being looped through quickly and repeatedly, and last player's actions being looped through slowly and only once to figure out ordering for games of other sizes.

java.util.NoSuchElementException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)