MotionSchedule

class unified_planning.plans.MotionSchedule(activities: List[Activity] | None = None, assignment: Dict[Parameter | Timepoint, int | float | Fraction | str | up.model.fnode.FNode | up.model.object.Object | bool] | None = None, motion_paths: Dict[Tuple[MotionActivity, MotionConstraint], List[Tuple[float, ...]]] = {}, environment: Environment | None = None)[source]

Bases: Schedule

This class represents the solution of a scheduling and motion planning problem.

In addition to a Schedule, it carries the geometric motion_paths computed for each (MotionActivity, MotionConstraint) pair of the problem.

property activities: List[Activity]

Returns the list of all activities that appear in the solution.

property assignment: Dict[Parameter | Timepoint, FNode]

Returns the assignment of each variable of the problem to its value in the solution.

convert_to(plan_kind: PlanKind, problem: AbstractProblem) Plan

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.

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.

property environment: Environment

Return this plan’s Environment.

get(var: Parameter | Timepoint) FNode

Returns the value assigned to this variable.

property kind: PlanKind

Returns the Plan kind

property motion_paths: Dict[Tuple[MotionActivity, MotionConstraint], List[Tuple[float, ...]]]

Returns the geometric path computed for each (MotionActivity, MotionConstraint) pair.

replace_action_instances(replace_function: Callable[[ActionInstance], ActionInstance | None]) Plan

This function takes a function from ActionInstance to ActionInstance and returns a new Plan that have the ActionInstance modified by the replace_function function.

If the returned ActionInstance is None it means that the ActionInstance should not go in the resulting Plan.

Parameters:

replace_function – The function that must be used on the ActionInstances that must be replaced.

Returns:

The new Plan in which every ActionInstance of the original Plan is modified by the given replace_function.

set(var: Parameter | Timepoint, value: int | float | Fraction | str | up.model.fnode.FNode | up.model.object.Object | bool)

Force the assignment of a particular value to the variable