Safe Haskell | None |
---|---|
Language | Haskell98 |
Netrium is Copyright Anthony Waite, Dave Hetwett, Shaun Laurens 2009-2015, and files herein are licensed |under the MIT license, the text of which can be found in license.txt
- data Output
- data StopReason
- data SimEnv = SimEnv {}
- data SimOutputs = SimOutputs {}
- data StopWait
- data WaitInfo = WaitInfo {
- waitObs :: [Obs Bool]
- waitHorizon :: Maybe Time
- waitOptions :: [ChoiceId]
- runContract :: SimEnv -> Time -> Maybe Time -> StopWait -> Either Contract ProcessState -> SimOutputs
- data WaitResult k
- runWait :: SimEnv -> ObsEnv -> Maybe Time -> Time -> [(Obs Bool, k)] -> [(ChoiceId, k)] -> (Time, ObsResult (WaitResult k))
- data WaitEvent k
- mergeWaitEvents :: Observations Double -> Observations Bool -> Choices () -> [(Time, k)] -> Time -> ObsEnv -> TimedEvents (WaitEvent k)
- data ObsEnv = ObsEnv (Map VarName (Maybe Double)) (Map VarName (Maybe Bool))
- currentObsEnv :: Observations Double -> Observations Bool -> Time -> ObsEnv
- data ObsResult a
- evalObs :: ObsEnv -> Time -> Obs a -> ObsResult a
- newtype WaitCondition = WaitCondition (Obs Bool)
- newtype WaitOption = WaitOption ChoiceId
Main interpreter, using observables and choice data
data StopReason Source #
Finished | contract reduced to |
StoppedTime | stop time reached (in timeout mode) |
StoppedWait | stopped at first wait point (in wait mode) |
WaitForever | a non-terminating wait |
ChoiceRequired Party ChoiceId | |
ObservationExhausted VarName | |
ObservationMissing VarName | really an error |
Eq StopReason Source # | |
Show StopReason Source # | |
XmlContent StopReason Source # | |
HTypeable StopReason Source # | |
SimEnv | |
|
data SimOutputs Source #
WaitInfo | |
|
:: SimEnv | |
-> Time | start time |
-> Maybe Time | optional stop time |
-> StopWait | stop at first waitpoint |
-> Either Contract ProcessState | |
-> SimOutputs |
runWait :: SimEnv -> ObsEnv -> Maybe Time -> Time -> [(Obs Bool, k)] -> [(ChoiceId, k)] -> (Time, ObsResult (WaitResult k)) Source #
When in a wait state there are three different things that can happen
one of the observables can become true, we can choose to take an anytime
option that is available to us.
There are two ways an observable can become true, one is due to a change in a primitive/external ovservable, and the other is via the passage of time.
Hence, overall, there are three events we are interested in while waiting.
:: Observations Double | time series for real primitive obs |
-> Observations Bool | time series for bool primitive obs |
-> Choices () |
|
-> [(Time, k)] | optional timeouts |
-> Time | initial time |
-> ObsEnv | initial values of all primitive obs |
-> TimedEvents (WaitEvent k) |
Take all three sources of events we are interested in and produce a unified event list
Evaluating observables in the presense of observables data
currentObsEnv :: Observations Double -> Observations Bool -> Time -> ObsEnv Source #
XML instances
newtype WaitCondition Source #
XmlContent WaitCondition Source # | |
HTypeable WaitCondition Source # | |
newtype WaitOption Source #
XmlContent WaitOption Source # | |
HTypeable WaitOption Source # | |