aivika-branches-0.1.3: Nested discrete event simulation module for the Aivika library

Copyright Copyright (c) 2016, David Sorokin BSD3 David Sorokin experimental None Haskell98

Simulation.Aivika.Branch.Event

Contents

Description

Tested with: GHC 7.10.3

The module defines an event queue, where BrIO is an instance of EventQueueing. Also it defines basic functions for branching computations.

Synopsis

# Documentation

Branch a new computation and return its result leaving the current computation intact.

A new derivative branch with branchLevel increased by 1 is created at the current modeling time. Then the result of the specified computation for the derivative branch is returned.

The state of the current computation including its event queue and mutable references Ref remain intact. In some sense we copy the state of the model to the derivative branch and then proceed with the derived simulation. The copying operation is relatively cheap.

Branch a new computation and return its result at the desired time in the future leaving the current computation intact.

A new derivative branch with branchLevel increased by 1 is created at the current modeling time. All pending events are processed till the specified time for that new branch. Then the result of the specified computation for the derivative branch is returned.

The state of the current computation including its event queue and mutable references Ref remain intact. In some sense we copy the state of the model to the derivative branch and then proceed with the derived simulation. The copying operation is relatively cheap.

Like futureEvent but allows specifying how the pending events must be processed.

# Orphan instances

 Source # An implementation of the EventQueueing type class. Associated Typesdata EventQueue (BrIO :: * -> *) :: * # MethodsenqueueEvent :: Double -> Event BrIO () -> Event BrIO () #