PartialOrderPlan
- class unified_planning.plans.PartialOrderPlan(adjacency_list: Dict[ActionInstance, List[ActionInstance]], environment: Environment | None = None, _graph: DiGraph | None = None)[source]
Bases:
Plan
Represents a partial order plan. Actions are represent as an adjacency list graph.
- property get_adjacency_list: Dict[ActionInstance, List[ActionInstance]]
Returns the graph of action instances as an adjacency list.
- replace_action_instances(replace_function: Callable[[ActionInstance], ActionInstance | None]) Plan [source]
Returns a new PartialOrderPlan where every ActionInstance of the current plan is replaced using the given replace_function.
- Parameters:
replace_function – The function that applied to an ActionInstance A returns the ActionInstance B; B replaces A in the resulting Plan.
- Returns:
The PartialOrderPlan where every ActionInstance is replaced using the given replace_function.
- convert_to(plan_kind: PlanKind, problem: AbstractProblem) Plan [source]
This function takes a PlanKind and returns the representation of self in the given plan_kind. If the conversion does not make sense, raises an exception.
For the conversion to SequentialPlan, returns one all possible SequentialPlans that respects the ordering constraints given by this PartialOrderPlan.
- Parameters:
plan_kind – The plan_kind of the returned plan.
problem – The Problem of which this plan is referring to.
- Returns:
The plan equivalent to self but represented in the kind of plan_kind.
- all_sequential_plans() Iterator[SequentialPlan] [source]
Returns all possible SequentialPlans that respects the ordering constraints given by this PartialOrderPlan.
- get_neighbors(action_instance: ActionInstance) Iterator[ActionInstance] [source]
Returns an Iterator over all the neighbors of the given ActionInstance.
- Parameters:
action_instance – The ActionInstance of which neighbors must be retrieved.
- Returns:
The Iterator over all the neighbors of the given action_instance.
- property environment: Environment
Return this plan’s Environment.
- property kind: PlanKind
Returns the Plan kind