langgoap.Plan#
- class Plan(actions, expected_states=(), total_cost=0.0, metadata=<factory>, score=<factory>)[source]#
A sequence of actions that achieves a goal from a given start state.
- Parameters:
actions (tuple[ActionSpec, ...])
expected_states (tuple[PlanningState, ...])
total_cost (float)
metadata (PlanMetadata)
score (Score)
- actions#
Ordered list of ActionSpecs to execute.
- Type:
tuple[langgoap.actions.ActionSpec, …]
- expected_states#
The world state expected after each action.
- Type:
tuple[langgoap.state.PlanningState, …]
- total_cost#
Sum of action costs along the plan.
- Type:
float
- metadata#
Planning algorithm statistics.
- score#
Scorefor the plan. A*-only plans carry aSimpleScoreequal tototal_cost; after CSP evaluation, the pipeline replaces this with aHardSoftScorewhosehardlevel is 0.0 for feasible plans and whosesoftlevel aggregates weighted objectives and soft penalties.
- __init__(actions, expected_states=(), total_cost=0.0, metadata=<factory>, score=<factory>)#
- Parameters:
actions (tuple[ActionSpec, ...])
expected_states (tuple[PlanningState, ...])
total_cost (float)
metadata (PlanMetadata)
score (Score)
- Return type:
None
Methods
__init__(actions[, expected_states, ...])draw_gantt_png(**kwargs)Render this plan's schedule as a PNG Gantt chart via Mermaid.
draw_mermaid_png(**kwargs)Render this plan as a PNG image via Mermaid.
empty()Create an empty plan (goal already satisfied).
net_value(goal[, world_state])Return
goal.value - total_costforMultiGoalselection.save(path, *[, format, show_resources, ...])Write a rendered representation of this plan to
path.to_ascii(*[, show_resources, show_schedule])Render this plan as an ASCII tree.
to_dot(*[, show_resources, show_schedule])Render this plan as Graphviz DOT source.
to_gantt()Render this plan's schedule as a Mermaid
ganttchart.to_mermaid(*[, show_resources, show_schedule])Render this plan as a Mermaid
flowchart TDdiagram.visualize(*[, format, show_resources, ...])Display-aware visualization helper.
Attributes
action_namesReturn the names of all actions in the plan.