Undocumented

DIVERGED :: StopReason

The simulation diverged before reaching its end.

FAILED :: StopReason

An action scheduled by the sequence threw an exception, which prevented the sequence from continuing. The exceptions themselves are collected separately and reported by whoever runs the sequence.

INTERRUPTED :: StopReason

The client or some other party interrupted the sequence abruptly.

Monad_Sequence_super0 :: Functor Sequence
SIMULATION_DID_NOT_START :: StopReason

The simulation never commenced, for instance because the solver and the model are incompatible, a required file or library is missing, or a license is not available.

STOPPED :: StopReason

The sequence stopped itself, which is the normal ending. Every other reason marks a failure to complete the sequence.

Sequence :: ((a -> <Action,Proc> ()) -> <Action,Proc> ()) -> Sequence a
execute :: <Action,Proc> a -> Sequence a

The sequence execute action is an instantious sequence that executes the operation action in the simulator.

executeWhenStopped :: (StopReason -> <Action,Proc> a) -> Sequence ()

The sequence executeWhenStopped handler is an instantious sequence that registers handler to be run when the sequence stops, with the reason it stopped.

fork :: Sequence a -> Sequence ()

The sequence fork seq is an instantious sequence that creates a new sequence thread behaving like the sequence seq.

getVar :: Serializable a => String -> <Action> a

Returns the current value of a variable

getVar_ :: String -> Binding a -> <Action> a

Reads a simulator variable with an explicitly given binding. getVar is the usual way to call this.

halt :: Sequence a

The sequence halt ends the current sequence thread and the sequence .

scheduleAt :: Double -> (() -> <Action,Proc> a) -> <Action> ()

scheduleAt time continuation schedules a continuation to run once the simulation time reaches time. A time at or before the current time schedules it for the current step, as scheduleNow does.

scheduleNextStep :: (() -> <Action,Proc> a) -> <Action> ()

Schedules a continuation to run at the beginning of the next simulation step.

scheduleNow :: (() -> <Action,Proc> a) -> <Action> ()

Schedules a continuation to run during the current simulation step, before the simulator advances time.

scheduleWhenStopped :: (StopReason -> <Action,Proc> a) -> <Action> ()

Schedules a handler to run once when the sequence stops, receiving the reason it stopped. All handlers registered so far run at that point and are then forgotten.

setVar :: Serializable a => String -> a -> <Action> ()

Sets the value of a variable

setVar_ :: String -> a -> Binding a -> <Action> ()

Writes a simulator variable with an explicitly given binding. setVar is the usual way to call this.

stop :: Sequence a

The sequence stop stops all sequence threads, stopping the simulation completely.

stopActionContext :: ActionContext -> <Proc> ()

Stops the sequence running in the given context from outside it, as STOPPED. Use stop or stop_ to do the same from inside a sequence.

stop_ :: <Action> ()

Stops the sequence as STOPPED. The continuations that were scheduled for a later step or a later time are discarded and the handlers registered with scheduleWhenStopped run. stop is the sequence-valued form of this.

time :: <Action> Double

Gives the current simulation time.

wait :: Double -> Sequence ()

The sequence wait duration waits that duration seconds elapses from the current simulation time.

waitCondition :: <Action,Proc> Boolean -> Sequence ()

The sequence waitCondition condition waits until the condition is satisfied.

waitStep :: Sequence ()

The sequence waitStep waits that the simulator takes one simulation step. It is a primitive mechanism that can be used to implement other events by inspecting the simulator state after each time step.

waitUntil :: Double -> Sequence ()

The sequence waitUntil time waits until the simulation time is at least the given time.