Note

You are not reading the most recent version of this documentation.

Simulator

class Cocotec.CocoPlatform.Coco.Simulator

Public Functions

void AddListener (Cocotec.CocoPlatform.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.

List<Cocotec.CocoPlatform.Coco.ValueTopLevelInstances ()

The top-level instances that are active in this counterexample. Each behavioural instance may consist of several other instances.

List<Cocotec.CocoPlatform.Coco.BehaviouralInstanceLeafInstances ()
Cocotec.CocoPlatform.Coco.BehaviouralInstance FocusInstance ()

The instance out of stepped_instances that should be focused on in a UI. This may be null.

List<Cocotec.CocoPlatform.Coco.BehaviouralInstanceSteppedInstances ()

The list of threads that have changed state since the last callback. This can only be called during a callback from one of the listener methods.

Cocotec.CocoPlatform.Coco.InstanceNetworkState CurrentState ()

The current execution state. This can only be called during a callback from one of the listener methods.

Cocotec.CocoPlatform.Coco.Behaviour Behaviour ()

The behaviour that leads to the current state. This can only be called during a callback from one of the listener methods.

List<Cocotec.CocoPlatform.Coco.EventChoices ()

The events that are available to be chosen from in the current state. This can only be called during a callback from one of the listener methods. After calling this, behaviour() is updated to reflect the extra state.

bool Stopped ()

Is the simulator currently paused?

Cocotec.CocoPlatform.Coco.SimulatorStopReason LastStopReason ()

The reason the simulator is currently stopped, if it is.

void ResolveChoice (int choiceIndex)

If the current state has choices, then the index of the choice to proceed with.

void Reset (int stateIndex)

Resets the simulator to the state given by the index.

This continues asynchronously in the background.

Parameters
  • stateIndex: The index of the state (in behaviour().states()) that should become the new current state.

void Step (Cocotec.CocoPlatform.Coco.SimulatorStepMode mode)

Steps according to the given mode.