netrium-0.6.0: Contract normaliser and simulator

Safe HaskellNone
LanguageHaskell98

DecisionTree

Contents

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

Synopsis

Contract decision trees

data DecisionStep x Source #

A single step in a decision tree

data Party Source #

Instances

Eq Party Source # 

Methods

(==) :: Party -> Party -> Bool #

(/=) :: Party -> Party -> Bool #

Show Party Source # 

Methods

showsPrec :: Int -> Party -> ShowS #

show :: Party -> String #

showList :: [Party] -> ShowS #

XmlContent Party Source # 

Methods

parseContents :: XMLParser Party

toContents :: Party -> [Content ()]

xToChar :: Party -> Char

xFromChar :: Char -> Party

HTypeable Party Source # 

Methods

toHType :: Party -> HType

data DecisionTree Source #

A full decision tree

Basic step

data ThreadState Source #

Remaining contract, until conditions, inherited scaling, and direction of trade

data Blocked c 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

Instances

Eq c => Eq (Blocked c) Source # 

Methods

(==) :: Blocked c -> Blocked c -> Bool #

(/=) :: Blocked c -> Blocked c -> Bool #

Show c => Show (Blocked c) Source # 

Methods

showsPrec :: Int -> Blocked c -> ShowS #

show :: Blocked c -> String #

showList :: [Blocked c] -> ShowS #

XmlContent c => XmlContent (Blocked c) Source # 

Methods

parseContents :: XMLParser (Blocked c)

toContents :: Blocked c -> [Content ()]

xToChar :: Blocked c -> Char

xFromChar :: Char -> Blocked c

HTypeable (Blocked c) Source # 

Methods

toHType :: Blocked c -> HType

each :: [a] -> [(a, [a])] Source #

Trade directions

evalTradeDir :: TradeDir -> Contract -> Contract Source #

Give the interpretation of a TradeDir as a combination of party and give.

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 

Instances

XmlContent ObsCondition Source # 
HTypeable ObsCondition Source # 

Methods

toHType :: ObsCondition -> HType