stripstream.pddl package¶
Subpackages¶
Submodules¶
stripstream.pddl.objects module¶
show-inheritance: | |
---|---|
stripstream.pddl.operators module¶
-
class
stripstream.pddl.operators.
Action
(name, parameters, condition, effect, cost=None)[source]¶ Bases:
stripstream.pddl.operators.Operator
PDDL action class.
CONF = EasyType() AtConf = EasyPredicate(CONF, CONF) Q1, Q1 = EasyParameter(CONF), EasyParameter(CONF) a = Action(name='move', parameters=[Q1, Q2], condition=AtConf(Q1), effect=And(AtConf(Q2), Not(AtConf(Q1))))
Parameters: - name – the name of the action
- parameters – a list of
Parameter
- condition – a
Condition
- effect – an
Effect
- cost – a numeric cost
-
class
stripstream.pddl.operators.
STRIPSAction
(name, parameters, conditions, effects, cost=None)[source]¶ Bases:
stripstream.pddl.operators.Action
,stripstream.pddl.operators.STRIPS
STRIPS action class which extends
Action
by assumingcondition
andeffect
are conjunctions of literals.CONF = EasyType() AtConf = EasyPredicate(CONF, CONF) Q1, Q1 = EasyParameter(CONF), EasyParameter(CONF) a = Action(name='move', parameters=[Q1, Q2], conditions=[AtConf(Q1)], effects=[AtConf(Q2), Not(AtConf(Q1))])
Parameters:
-
class
stripstream.pddl.operators.
Axiom
(effect, condition)[source]¶ Bases:
stripstream.pddl.operators.Operator
PDDL axiom (derived predicate).
BLOCK, POSE = EasyType(), EasyType() AtPose = EasyPredicate(BLOCK, POSE) CollisionFree = EasyPredicate(POSE, POSE) Safe = EasyPredicate(BLOCK, POSE) B2 = EasyParameter(BLOCK) P1, P2 = EasyParameter(POSE), EasyParameter(POSE) x = Axiom(effect=Safe(B2, P1), condition=Exists([P2], And(AtPose(B2, P2), CollisionFree(P1, P2))))
Parameters: - effect – the
Atom
derived predicate - condition – a
Condition
- effect – the
-
class
stripstream.pddl.operators.
STRIPSAxiom
(conditions, effects)[source]¶ Bases:
stripstream.pddl.operators.Axiom
,stripstream.pddl.operators.STRIPS
STRIPS axiom class which extends
Axiom
by assumingcondition
is a conjunction of literals.BLOCK, POSE = EasyType(), EasyType() AtPose = EasyPredicate(BLOCK, POSE) CollisionFree = EasyPredicate(POSE, POSE) Safe = EasyPredicate(BLOCK, POSE) B2 = EasyParameter(BLOCK) P1, P2 = EasyParameter(POSE), EasyParameter(POSE) x = Axiom(conditions=[AtPose(B2, P2), CollisionFree(P1, P2)], effects=[Safe(B2, P1)])
Parameters:
stripstream.pddl.cond_streams module¶
-
class
stripstream.pddl.cond_streams.
EasyGenStream
(inputs, outputs, conditions, effects, generator, **kwargs)[source]¶ Bases:
stripstream.pddl.cond_streams.ConditionalStream
Conditional stream given by a generator.
Example for inverse kinematics:
CONF, POSE = EasyType(), EasyType() LegalKin = EasyPredicate(POSE, CONF) Q, P = EasyParameter(CONF), EasyParameter(POSE) cs = EasyGenStream(inputs=[P], outputs=[Q], conditions=[], effects=[LegalKin(P, Q)], generator=lambda p: iter([p]))
Parameters: - inputs – a list of
Parameter
which are the inputs togenerator
- outputs – a list of
Parameter
which are the outputs fromgenerator
- conditions – a list of
Atom
forming a conjunctive condition on inputs - effects – a list of
Atom
forming a conjunctive effect on inputs and outputs - generator – a function from values for
inputs
to a generator for values ofoutputs
- kwargs – keyword arguments for
ConditionalStream
- inputs – a list of
-
class
stripstream.pddl.cond_streams.
EasyTestStream
(inputs, conditions, effects, test, **kwargs)[source]¶ Bases:
stripstream.pddl.cond_streams.ConditionalStream
Conditional stream given by a test.
Example for collision checking:
POSE = EasyType() CollisionFree = EasyPredicate(POSE, POSE) P1, P1 = EasyParameter(POSE), EasyParameter(POSE) cs = EasyTestStream(inputs=[P1, P2], conditions=[], effects=[CollisionFree(P1, P2)], test=lambda p1, p2: p1 != p2)
Parameters: - inputs – a list of
Parameter
which are the inputs totest
- conditions – a list of
Atom
forming a conjunctive condition on inputs - effects – a list of
Atom
forming a conjunctive effect on inputs - test – a function from values for
inputs
to{False, True}
- kwargs – keyword arguments for
ConditionalStream
- inputs – a list of
-
class
stripstream.pddl.cond_streams.
EasyFnStream
(inputs, outputs, conditions, effects, function, test=<function <lambda>>, **kwargs)[source]¶ Bases:
stripstream.pddl.cond_streams.ConditionalStream
Conditional stream given by a function.
Parameters: - inputs – a list of
Parameter
which are the inputs togenerator
- outputs – a list of
Parameter
which are the outputs fromgenerator
- conditions – a list of
Atom
forming a conjunctive condition on inputs - effects – a list of
Atom
forming a conjunctive effect on inputs and outputs - function – a function from values for
inputs
to values ofoutputs
- test – an optional function from values for
inputs
to{False, True}
# TODO - kwargs – keyword arguments for
ConditionalStream
- inputs – a list of
Module contents¶
This package contains the source for a PDDL representation of a STRIPStream problem.