Simulator¶
-
public class
Simulator
¶
Methods¶
addListener¶
-
public void
addListener
(io.cocotec.coco.platform.coco.SimulatorListener listener)¶ Adds a listener that will receive callbacks about events in this Session. The caller is responsible for ensuring that the SessionListener remains valid whilst the session is active: the session does not take ownership of the SessionListener at all.
behaviour¶
choices¶
currentState¶
-
public io.cocotec.coco.platform.coco.InstanceNetworkState
currentState
()¶ The current execution state. This can only be called during a callback from one of the listener methods.
focusInstance¶
-
public io.cocotec.coco.platform.coco.BehaviouralInstance
focusInstance
()¶ The instance out of stepped_instances that should be focused on in a UI. This may be null.
lastStopReason¶
-
public io.cocotec.coco.platform.coco.SimulatorStopReason
lastStopReason
()¶ The reason the simulator is currently stopped, if it is.
leafInstances¶
reset¶
-
public void
reset
(int stateIndex)¶ Resets the simulator to the state given by the index.
Parameters: - stateIndex – The index of the state (in behaviour().states()) that should become the new current state. This continues asynchronously in the background.
resolveChoice¶
-
public void
resolveChoice
(int choiceIndex)¶ If the current state has choices, then the index of the choice to proceed with.
step¶
-
public void
step
(io.cocotec.coco.platform.coco.SimulatorStepMode mode)¶ Steps according to the given mode.