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#

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.

Type:

langgoap.planner.types.PlanMetadata

score#

Score for the plan. A*-only plans carry a SimpleScore equal to total_cost; after CSP evaluation, the pipeline replaces this with a HardSoftScore whose hard level is 0.0 for feasible plans and whose soft level aggregates weighted objectives and soft penalties.

Type:

langgoap._score_base.Score

__init__(actions, expected_states=(), total_cost=0.0, metadata=<factory>, score=<factory>)#
Parameters:
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_cost for MultiGoal selection.

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 gantt chart.

to_mermaid(*[, show_resources, show_schedule])

Render this plan as a Mermaid flowchart TD diagram.

visualize(*[, format, show_resources, ...])

Display-aware visualization helper.

Attributes

actions

expected_states

total_cost

metadata

score

action_names

Return the names of all actions in the plan.