strips-0.1.0.0: resolver using strips algorithm

Safe HaskellSafe
LanguageHaskell2010

Algorithms.Strips

Synopsis

Documentation

extractPlan :: (ActionType a, Term b) => NodeInfo a b -> [a] Source #

extract actionType to goal from NodeInfo

strips :: (ActionType a, Term b) => [Action a b] -> [b] -> [b] -> NodeInfo a b Source #

search appropriate plan to be executed by strips algorithm with actions, start and goal conditions you pass.

class (Eq a, Show a) => ActionType a Source #

class (Eq b, Ord b, Show b) => Term b Source #

data Action a b Source #

Constructors

NoAction 
Action 

Fields

  • actionType :: a

    type of action

  • preCondition :: [b]

    list of conditions that must be satisfied before the action is executed

  • postCondition :: [b]

    list of conditions that must be satisfied after the action is executed

  • actionCost :: Int

    required cost to execute action

Instances

(Eq b, Eq a) => Eq (Action a b) Source # 

Methods

(==) :: Action a b -> Action a b -> Bool #

(/=) :: Action a b -> Action a b -> Bool #

(Show b, Show a) => Show (Action a b) Source # 

Methods

showsPrec :: Int -> Action a b -> ShowS #

show :: Action a b -> String #

showList :: [Action a b] -> ShowS #

data NodeInfo a b Source #

Constructors

NoNodeInfo 
NodeInfo 

Fields

  • realCost :: Int

    total cost actually required to reach the current node

  • score :: Int

    the sum of actual cost and estimate cost

  • diffCount :: Int

    count of condition difference between goal and current node (= estimate cost)

  • diff :: [b]

    condition difference between goal and current node

  • condition :: [b]

    current condition

  • action :: Action a b

    action to go to next node

  • next :: NodeInfo a b

    next node

Instances

(Eq a, Eq b) => Eq (NodeInfo a b) Source # 

Methods

(==) :: NodeInfo a b -> NodeInfo a b -> Bool #

(/=) :: NodeInfo a b -> NodeInfo a b -> Bool #

(Show a, Show b) => Show (NodeInfo a b) Source # 

Methods

showsPrec :: Int -> NodeInfo a b -> ShowS #

show :: NodeInfo a b -> String #

showList :: [NodeInfo a b] -> ShowS #