Safe Haskell | None |
---|---|
Language | Haskell98 |
DecisionTree
Description
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 DecisionStep x
- data Party
- data DecisionTree = DecisionTree Time (DecisionStep DecisionTree)
- unfoldDecisionTree :: (a -> (DecisionStep a, Time)) -> a -> DecisionTree
- decisionTree :: Time -> Contract -> DecisionTree
- data ProcessState = PSt Time [Blocked ThreadState] [ThreadState]
- data ThreadState = TSt Contract [Obs Bool] ScaleFactor TradeDir
- data Blocked c
- = BlockedOnWhen (Obs Bool) c
- | BlockedOnAnytime Bool ChoiceId (Obs Bool) c
- initialProcessState :: Time -> Contract -> ProcessState
- currentContract :: ProcessState -> Contract
- decisionStep :: ProcessState -> DecisionStep ProcessState
- subst :: String -> Double -> Contract -> Contract
- each :: [a] -> [(a, [a])]
- data TradeDir
- evalTradeDir :: TradeDir -> Contract -> Contract
- setThirdParty :: PartyName -> TradeDir -> TradeDir
- flipTradeDir :: TradeDir -> TradeDir
- tradeDirParties :: TradeDir -> (Party, Party)
- newtype ObsCondition = ObsCondition {}
Contract decision trees
data DecisionStep x Source #
A single step in a decision tree
Constructors
Done | |
Trade TradeDir Double Tradeable x | |
Choose Party ChoiceId x x | |
ObserveCond (Obs Bool) x x | |
ObserveValue (Obs Double) (Double -> x) | |
Wait [(Obs Bool, Time -> x)] [(ChoiceId, Time -> x)] |
Instances
Constructors
FirstParty | |
Counterparty | |
ThirdParty PartyName |
data DecisionTree Source #
A full decision tree
Constructors
DecisionTree Time (DecisionStep DecisionTree) |
unfoldDecisionTree :: (a -> (DecisionStep a, Time)) -> a -> DecisionTree Source #
decisionTree :: Time -> Contract -> DecisionTree Source #
Basic step
data ProcessState Source #
Current time, blocked, and runnable ThreadState
s
Constructors
PSt Time [Blocked ThreadState] [ThreadState] |
Instances
Eq ProcessState Source # | |
Show ProcessState Source # | |
XmlContent ProcessState Source # | |
HTypeable ProcessState Source # | |
data ThreadState Source #
Remaining contract, until
conditions, inherited scaling, and direction of trade
Instances
Eq ThreadState Source # | |
Show ThreadState Source # | |
XmlContent ThreadState Source # | |
HTypeable ThreadState Source # | |
Constructors
BlockedOnWhen (Obs Bool) c | waiting for obs to become True |
BlockedOnAnytime Bool ChoiceId (Obs Bool) c | waiting for obs to become value v |
initialProcessState :: Time -> Contract -> ProcessState Source #
Trade directions
setThirdParty :: PartyName -> TradeDir -> TradeDir Source #
Precompose a TradeDir with party
to get a new combined TradeDir.
That is, it respects the law:
evalTradeDir (setThirdParty p dir) = evalTradeDir dir . party p
flipTradeDir :: TradeDir -> TradeDir Source #
Precompose a TradeDir with give
to get a new combined TradeDir.
That is, it respects the law:
evalTradeDir (flipTradeDir dir) = evalTradeDir dir . give
tradeDirParties :: TradeDir -> (Party, Party) Source #
Return the two parties in a TradeDir in the order (recieving party, giving party)
.
Display tree instance
newtype ObsCondition Source #
Constructors
ObsCondition | |
Fields |
Instances
XmlContent ObsCondition Source # | |
HTypeable ObsCondition Source # | |