aivika-1.1: A multi-paradigm simulation library

Stabilityexperimental
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Safe HaskellSafe-Inferred

Simulation.Aivika.Arrival

Description

Tested with: GHC 7.6.3

This module defines the types and functions for working with the external events that usually arrive from outside the model.

Synopsis

Documentation

data Arrival Source

It defines when an external event has arrived, usually generated by some random Stream.

Such events should arrive one by one without time lag in the following sense that the model should start awaiting the next event exactly in that time when the previous event has arrived. It usually happens automatically when using a queueProcessor with an ability to lost the arrived event if the queue is full.

Constructors

Arrival 

Fields

arrivalTime :: Double

the simulation time at which the event has arrived

arrivalDelay :: Double

the delay time which has passed from the time of arriving the previous event

data ArrivalTimer Source

Accumulates the statistics about that how long the arrived events are processed.

newArrivalTimer :: Simulation ArrivalTimerSource

Create a new timer that measures how long the arrived events are processed.

arrivalTimerProcessor :: ArrivalTimer -> Processor Arrival ArrivalSource

Return a processor that actually measures how much time has passed from the time of arriving the events.

arrivalProcessingTime :: ArrivalTimer -> Event (SamplingStats Double)Source

Return the statistics about that how long the arrived events were processed.