Package io.github.ai4ci.abm.mechanics
Class StateMachine
java.lang.Object
io.github.ai4ci.abm.mechanics.StateMachine
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
-
Constructor Summary
ConstructorsConstructorDescriptionStateMachine
(State<?, ?, ?, ?> defaultStateMachineState, StateMachineContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
forceTo
(StateMachine.PolicyState state) State<?,
?, ?, ?> getState()
void
init
(StateMachine.BehaviourState policy) void
init
(StateMachine.PolicyState policy) void
performHistoryUpdate
(ImmutableOutbreakHistory.Builder builder, OutbreakState outbreak, Sampler rng) void
performHistoryUpdate
(ImmutablePersonHistory.Builder builder, PersonState person, Sampler rng) void
performStateUpdate
(ImmutableOutbreakState.Builder builder, OutbreakState outbreak, Sampler rng) void
performStateUpdate
(ImmutablePersonState.Builder builder, PersonState person, Sampler rng) Update the state machine and store the new statevoid
rememberCurrentState
(State<?, ?, ?, ?> state) Remembers the current state if the behaviour is switching from one type to another (each behaviour model is an enum so the class of a group of behaviour states is the same).void
static StateMachine
stub()
toString()
-
Constructor Details
-
StateMachine
public StateMachine() -
StateMachine
-
-
Method Details
-
performHistoryUpdate
public void performHistoryUpdate(ImmutablePersonHistory.Builder builder, PersonState person, Sampler rng) -
performHistoryUpdate
public void performHistoryUpdate(ImmutableOutbreakHistory.Builder builder, OutbreakState outbreak, Sampler rng) -
performStateUpdate
public void performStateUpdate(ImmutablePersonState.Builder builder, PersonState person, Sampler rng) Update the state machine and store the new state -
performStateUpdate
public void performStateUpdate(ImmutableOutbreakState.Builder builder, OutbreakState outbreak, Sampler rng) -
getState
-
init
-
init
-
stub
-
forceTo
-
forceTo
-
rememberCurrentState
Remembers the current state if the behaviour is switching from one type to another (each behaviour model is an enum so the class of a group of behaviour states is the same). This way we only remember state branches if it directs people to a new state within a different model of behaviour.- Parameters:
state
-
-
returnFromBranch
public void returnFromBranch() -
toString
-