public final class TwoPlayerGameCache extends Object implements TwoPlayerGame
TwoPlayerGame
to provide caching of results.Constructor and Description |
---|
TwoPlayerGameCache(int maxSize,
TwoPlayerGame twoPlayerGame)
Creates a cache of the given maximum size which will contain the results of evaluating the given
TwoPlayerGame . |
Modifier and Type | Method and Description |
---|---|
double |
evaluate(Node player1,
Node player2)
Determines the outcome of the two specified players competing against each other.
|
public TwoPlayerGameCache(int maxSize, TwoPlayerGame twoPlayerGame)
TwoPlayerGame
.public double evaluate(Node player1, Node player2)
TwoPlayerGame
evaluate
in interface TwoPlayerGame
player1
- represents the game-logic of a player participating in the gameplayer2
- represents the game-logic of the other player participating in the gameplayer1
, as implementations of TwoPlayerGame
represent zero-sum games then the
corresponding outcome for player2
can be determined by negating this valueOakGP Genetic Programming Framework