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 TitForTat

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

All Implemented Interfaces:
  Strategy

    public class TitForTat

extends java.lang.Object
implements Strategy

Version:
  $Revision: 1.5 $ $Date: 2004/11/03 19:51:03 $

Method Summary
`GameChoice` | `calculateMove(GameChoice opponentLastMove)` Returns the opponent's last move.
`static TitForTat` | `getInstance()`
`java.lang.String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### getInstance

    public static TitForTat getInstance()

### calculateMove

    public GameChoice calculateMove(GameChoice opponentLastMove)

  Returns the opponent's last move. If opponent's last move was null as in the first move of the game, then this returns GameChoice.COOPERATE.

  Specified by:
    `calculateMove` in interface `Strategy`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

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