LessSimpleModel

public class LessSimpleModel implements Model

A less simple model that allows consistency, turn-taking and durative actions. No longer supports unit tasks Recalculates compound actions automatically every step. Supports consistent actions* according to the following principles: The order of actions does not affect their results, Sets of actions may not cause invalid states (so some must fail), The effects of one action succeeding may not change based on the actions of others**, An set of actions that fails cannot be made to succeed by adding actions for other units. From this, compound actions may only calculate primitives once in a turn, and only based on the previous state. This makes compound actions much much less effective than in SimpleModel. The particular solution in this makes sure that successes based on ranges (including directional actions with proximity) are calculated based on the previous state. It also ensures that an action may not fail due to a unit involved being attacked for enough damage to kill it. * Production/build actions that make new units fail consistency. The units are placed sequentially in places that were empty last state in such a way as to not disrupt move actions. In the situation where more productions exist than empty spaces that are not being moved into, then only the minimum number of production actions will fail ** More generally, where s is the event “action has succeeded” and E is a set of possible results, and O is actions sent to other units, E given s must be independant of O, IE: for all O, P(E|s) = P(E|s,O)*** *** as an example that works, attacks, being based on sequential Random variables from a seed, will change exact result, but the distribution of successful attacks does not change based on other actions. As a failing example, random movements that only fail on an actual collision wouldn’t work, as the action of the other unit affects the distribution of effects.

Constructors

LessSimpleModel

public LessSimpleModel(State init, int seed, StateCreator restartTactic, Configuration configuration)

Methods

addActions

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

createNewWorld

public void createNewWorld()

executeStep

public void executeStep()

The main loop of the engine. Removes the old views

getConfiguration

public Configuration getConfiguration()

getHistory

public History getHistory()

getState

public State getState()

getVerbose

public boolean getVerbose()

isTerminated

public boolean isTerminated()

save

public void save(String filename)

setConfiguration

public void setConfiguration(Configuration configuration)

setTurnTracker

public void setTurnTracker(TurnTracker tracker)

setVerbose

public void setVerbose(boolean verbose)