aivika-distributed-1.5: Parallel distributed discrete event simulation module for the Aivika library
CopyrightCopyright (c) 2015-2017 David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simulation.Aivika.Distributed.Optimistic.Guard

Description

Tested with: GHC 8.0.2

This module defines guards that allow correct finishing the distributed simulation.

Synopsis

Guards With Message Passing

runMasterGuard Source #

Arguments

:: (Serializable a, Serializable b) 
=> Int

the number of slaves to wait

-> (Map ProcessId a -> Event DIO (Map ProcessId b))

how to transform the messages from the slave processes in the stop time

-> Process DIO (Map ProcessId b) 

Run the master guard by the specified number of slaves and transform function.

runSlaveGuard Source #

Arguments

:: (Serializable a, Serializable b) 
=> ProcessId

the master process identifier

-> Event DIO a

in the stop time generate a message to pass to the master process

-> Process DIO (Maybe b)

the message returned by the master process

Run the slave guard by the specified master process identifier and message generator.

Guards Without Message Passing

runMasterGuard_ :: Int -> Process DIO () Source #

Run the master guard by the specified number of slaves when there is no message passing.

runSlaveGuard_ :: ProcessId -> Process DIO () Source #

Run the slave guard by the specified master process identifier when there is no message passing.