Model

public interface Model extends Serializable

The interface for model, which transitions its state as executing given actions.

Methods

addActions

void addActions(Map<Integer, Action> actions, int sendingPlayerNumber)

Validate and add actions to the list of actions to execute

Parameters:
  • actions
  • sendingPlayerNumber

createNewWorld

void createNewWorld()

Have the model create a new world.

executeStep

void executeStep()

Execute actions and do anything else that needs to be done

getConfiguration

Configuration getConfiguration()

getHistory

History getHistory()

Get the history of the model since the last new world was created.

getState

State getState()

Get current state of the model

Returns:current state of the model

getVerbose

boolean getVerbose()

isTerminated

boolean isTerminated()

Determine whether the current state is terminal.

Returns:True if the current state is terminal, False otherwise.

setConfiguration

void setConfiguration(Configuration configuration)

setTurnTracker

void setTurnTracker(TurnTracker turnTracker)

Add the turn tracker to moderate who can move on a given turn.

Parameters:
  • turnTracker

setVerbose

void setVerbose(boolean verbosity)