|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.brics.bisim.model.GameModel
public class GameModel
A local game model holding two GrappaModels. It also holds the state space and configuration graph of the combined states. This is used by AIs but also to detect infinite games, in which case the defender is declared winner. In practice, we do not wish to wait forever, so we define an infinite game as returning to an already seen configuration (s,t) of nodes from the left and right LTS respectively. This can be justified by the fact that a perfect attacker can always avoid returning to a previously visited state.
Field Summary | |
---|---|
private java.lang.String |
attackerAction
|
private int |
attackerSide
|
private ConfigurationGraph |
configurationGraph
|
static int |
FINITE_GAME
|
private boolean |
gameOver
|
private boolean |
hasStateSpacePartition
|
private int |
infiniteGameOver
|
static int |
LEFT_SIDE
|
private LTSModel |
leftLTSModel
|
static int |
NOBODYS_TURN
|
static int |
RIGHT_SIDE
|
private LTSModel |
rightLTSModel
|
private int |
roundNumber
|
private java.util.ArrayList<CGNode> |
seenConfigurations
|
private StateSpace |
stateSpace
|
private int |
turn
|
static int |
TURN_ATTACKER_1
|
static int |
TURN_ATTACKER_2
|
static int |
TURN_DEFENDER
|
Constructor Summary | |
---|---|
GameModel(java.lang.String leftInitialNodeName,
java.lang.String rightInitialNodeName)
|
Method Summary | |
---|---|
void |
buildStateSpace()
Create a state space, partition it, and create a corresponding configuration graph. |
java.lang.String |
getAttackerAction()
|
int |
getAttackerSide()
|
ConfigurationGraph |
getConfigurationGraph()
|
int |
getInfiniteGameOver()
|
LTSModel |
getLeftLTSModel()
|
LTSModel |
getRightLTSModel()
|
StateSpace |
getStateSpace()
|
int |
getTurn()
|
boolean |
hasStateSpacePartition()
|
int |
incAndGetRoundNumber()
|
boolean |
isGameOver()
|
void |
reset()
Reset LTS models. |
private void |
resetSeenConfigurations()
Reset the set of seen configurations and add the initial configuration. |
void |
setAttackerAction(java.lang.String attackerAction)
Sets the attackers action |
void |
setAttackerSide(int attackerSide)
Sets the attacker side. |
void |
setGameOver()
Calculates if game is over. |
void |
setTurn(int turn)
Sets the turn (attacker/defender) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FINITE_GAME
public static final int NOBODYS_TURN
public static final int TURN_ATTACKER_1
public static final int TURN_ATTACKER_2
public static final int TURN_DEFENDER
public static final int LEFT_SIDE
public static final int RIGHT_SIDE
private int turn
private int attackerSide
private int roundNumber
private java.lang.String attackerAction
private LTSModel leftLTSModel
private LTSModel rightLTSModel
private boolean gameOver
private int infiniteGameOver
private StateSpace stateSpace
private boolean hasStateSpacePartition
private ConfigurationGraph configurationGraph
private java.util.ArrayList<CGNode> seenConfigurations
Constructor Detail |
---|
public GameModel(java.lang.String leftInitialNodeName, java.lang.String rightInitialNodeName)
Method Detail |
---|
public void buildStateSpace()
public java.lang.String getAttackerAction()
public void setAttackerAction(java.lang.String attackerAction)
attackerAction
- An actionpublic int getTurn()
public void setTurn(int turn)
turn
- A turnpublic int getAttackerSide()
public void setAttackerSide(int attackerSide)
attackerSide
- A sidepublic LTSModel getLeftLTSModel()
public LTSModel getRightLTSModel()
public void reset()
private void resetSeenConfigurations()
public boolean isGameOver()
public int getInfiniteGameOver()
public void setGameOver()
public int incAndGetRoundNumber()
public StateSpace getStateSpace()
public ConfigurationGraph getConfigurationGraph()
public boolean hasStateSpacePartition()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |