Safe Haskell | None |
---|
Basic rules building blocks. for example, you can suppress rule 1 with: do suppressRule 1
- type RuleNumber = Int
- type RuleCode = String
- data RuleEvent
- data RuleStatus
- type MetaRule = RuleInfo -> NomexNE Bool
- activateRule :: RuleNumber -> Nomex Bool
- activateRule_ :: RuleNumber -> Nomex ()
- rejectRule :: RuleNumber -> Nomex Bool
- rejectRule_ :: RuleNumber -> Nomex ()
- getRules :: NomexNE [RuleInfo]
- getActiveRules :: NomexNE [RuleInfo]
- getRule :: RuleNumber -> NomexNE (Maybe RuleInfo)
- getRulesByNumbers :: [RuleNumber] -> NomexNE [RuleInfo]
- getRuleFuncs :: NomexNE [Nomex ()]
- addRule :: RuleInfo -> Nomex Bool
- addRule_ :: RuleInfo -> Nomex ()
- addRuleParams :: RuleName -> Rule -> RuleCode -> String -> Nomex RuleNumber
- getFreeRuleNumber :: NomexNE RuleNumber
- suppressRule :: RuleNumber -> Nomex Bool
- suppressRule_ :: RuleNumber -> Nomex ()
- suppressAllRules :: Nomex Bool
- modifyRule :: RuleNumber -> RuleInfo -> Nomex Bool
- autoActivate :: Nomex ()
- activateOrReject :: RuleInfo -> Bool -> Nomex ()
- simulate :: Nomex a -> NomexNE Bool -> NomexNE Bool
- metaruleVar :: MsgVar [MetaRule]
- createMetaruleVar :: Nomex ()
- addMetarule :: MetaRule -> Nomex ()
- testWithMetaRules :: RuleInfo -> NomexNE Bool
- legal :: Nomex ()
- illegal :: Nomex ()
- noPlayPlayer :: PlayerNumber -> MetaRule
- immutableRule :: RuleNumber -> MetaRule
- autoDelete :: Nomex ()
- eraseAllRules :: PlayerNumber -> Nomex Bool
- getSelfRuleNumber :: NomexNE RuleNumber
- getSelfRule :: NomexNE RuleInfo
- showRule :: Show a => a -> Exp Effect ()
Documentation
type RuleNumber = IntSource
data RuleStatus Source
the status of a rule.
activateRule :: RuleNumber -> Nomex BoolSource
activate a rule: change its state to Active and execute it
activateRule_ :: RuleNumber -> Nomex ()Source
rejectRule :: RuleNumber -> Nomex BoolSource
reject a rule: change its state to Suppressed and suppresses all its environment (events, variables, inputs) the rule can be activated again later
rejectRule_ :: RuleNumber -> Nomex ()Source
getRulesByNumbers :: [RuleNumber] -> NomexNE [RuleInfo]Source
getRuleFuncs :: NomexNE [Nomex ()]Source
addRuleParams :: RuleName -> Rule -> RuleCode -> String -> Nomex RuleNumberSource
suppressRule_ :: RuleNumber -> Nomex ()Source
modifyRule :: RuleNumber -> RuleInfo -> Nomex BoolSource
autoActivate :: Nomex ()Source
This rule will activate automatically any new rule.
activateOrReject :: RuleInfo -> Bool -> Nomex ()Source
activate or reject a rule
createMetaruleVar :: Nomex ()Source
addMetarule :: MetaRule -> Nomex ()Source
noPlayPlayer :: PlayerNumber -> MetaRuleSource
Player p cannot propose any more rules
immutableRule :: RuleNumber -> MetaRuleSource
rule number rn cannot be deleted by any incoming rule we simulate the execution of an incoming rule to make sure it doesn't delete the immutable rule
autoDelete :: Nomex ()Source
a rule can autodelete itself (generaly after having performed some actions)
eraseAllRules :: PlayerNumber -> Nomex BoolSource
All rules from player p are erased:
getSelfRuleNumber :: NomexNE RuleNumberSource
allows a rule to retrieve its own number (for auto-deleting for example)