The main class encapsulating the planning algorithm in Grail. Responsible for finding paths in an abstract plans space.
You can use this class directly (as a raw algorithm) or indirectly through a Reasoners.PlannerReasoner instead.
More...
|
| | Planner () |
| | Constructs a new planner object with no initial state set. More...
|
| |
| | Planner (WorldState initialState) |
| | Constructs a new planner object with a provided initial state and a default configuration. More...
|
| |
| | Planner (WorldState initialState, Config config) |
| | Constructs a new planner object with a provided initial state and the provided run-time configuration. More...
|
| |
| void | PushCondition (ConditionFunction condition) |
| | Adds a goal satisfaction condition to the planner.
The planner may have multiple independent conditions defined. More...
|
| |
| void | IterateWithSnapshot (int iterations, PlannerReasonerSnapshot snapshot, long minDebugSnapshotIteration=0, long maxDebugSnapshotIteration=long.MaxValue) |
| | Runs the planning process in a DEBUG mode for the given number of iterations.
The algorithm will try to formulate a plan starting from the initial state to a state that meets goalConditions. It will call OnPlanningFailed or when finished. More...
|
| |
| void | Iterate (int iterations) |
| | Runs the planning process for the given number of iterations.
The algorithm will try to formulate a plan starting from the initial state to a state that meets goalConditions. It will call OnPlanningFailed or when finished. More...
|
| |
| void | Reset (WorldState initialState) |
| | Performs a full reset of the planner. A typical usage is before a new decision point that requires a new plan.
Please note that this includes setting a new start state, clearing goal conditions, resetting the current iteration number. More...
|
| |
| AbstractPlan | GetPartialPlan () |
| | Returns the current best plan, regardless of whether the goal conditions are met. More...
|
| |
|
| int | IterationLimit [get, set] |
| | Sets or gets the number of iterations per each execution of the planning problem. Each iteration ends with one candidate plan. More...
|
| |
| int | MaxPlanLength [get, set] |
| | Sets of gets the maximum number of actions (steps) a plan can take. Set -1 for unlimited plans. More...
|
| |
| float | MaxPlanCost [get, set] |
| | Sets or gets an upper bound on the plan cost measured as the sum of costs of actions it consists of. Set -1 for no limit.
It may limit the possible plans generated (if they would exceed this cost). More...
|
| |
| PlannerHeuristic | Heuristic [set] |
| | Enables the planner to heuristically evaluate the calculated plans.
Similarly to A* pathfinding heuristic, it should return the estimation of the distance (cost) between an arbitrary state and the goal state. More...
|
| |
| PlanFoundDelegate | OnPlanFound [set] |
| | Callback executed whenever a new plan has been found by the algorithm. More...
|
| |
| System.Action | OnPlanningFailed [set] |
| | Callback executed if no plans were found in the allotted iteration budget and satisfying the MaxPlanLength and MaxPlanCost limits. More...
|
| |
The main class encapsulating the planning algorithm in Grail. Responsible for finding paths in an abstract plans space.
You can use this class directly (as a raw algorithm) or indirectly through a Reasoners.PlannerReasoner instead.
◆ Planner() [1/3]
| Grail.Planners.Planner.Planner |
( |
| ) |
|
|
inline |
Constructs a new planner object with no initial state set.
◆ Planner() [2/3]
| Grail.Planners.Planner.Planner |
( |
WorldState |
initialState | ) |
|
|
inline |
Constructs a new planner object with a provided initial state and a default configuration.
- Parameters
-
| initialState | The initial state of the planning space. The plans will be created from this state to the goal state. |
◆ Planner() [3/3]
Constructs a new planner object with a provided initial state and the provided run-time configuration.
- Parameters
-
| initialState | The initial state of the planning space. The plans will be created from this state to the goal state. |
| config | Configuration with parameters for the planner. |
◆ GetPartialPlan()
Returns the current best plan, regardless of whether the goal conditions are met.
- Returns
- The current best plan or an empty plan if not enough calculations were performed.
◆ Iterate()
| void Grail.Planners.Planner.Iterate |
( |
int |
iterations | ) |
|
|
inline |
Runs the planning process for the given number of iterations.
The algorithm will try to formulate a plan starting from the initial state to a state that meets goalConditions. It will call OnPlanningFailed or when finished.
- Parameters
-
| iterations | The max number of plan iterations to calculate. |
◆ IterateWithSnapshot()
| void Grail.Planners.Planner.IterateWithSnapshot |
( |
int |
iterations, |
|
|
PlannerReasonerSnapshot |
snapshot, |
|
|
long |
minDebugSnapshotIteration = 0, |
|
|
long |
maxDebugSnapshotIteration = long.MaxValue |
|
) |
| |
|
inline |
Runs the planning process in a DEBUG mode for the given number of iterations.
The algorithm will try to formulate a plan starting from the initial state to a state that meets goalConditions. It will call OnPlanningFailed or when finished.
- Parameters
-
| iterations | The max number of plan iterations to calculate. |
| snapshot | Debug data is outputted to the snapshot every iteration within min and max snapshot iteration parameters. |
| minDebugSnapshotIteration | Starting from this iteration number, debug data will be included in the snapshot. |
| maxDebugSnapshotIteration | The last number of iteration from which the debug data will be included in the snapshot. |
◆ PushCondition()
Adds a goal satisfaction condition to the planner.
The planner may have multiple independent conditions defined.
- Parameters
-
| condition | A boolean function that returns true if the specific goal condition has been reached and false otherwise. |
◆ Reset()
| void Grail.Planners.Planner.Reset |
( |
WorldState |
initialState | ) |
|
|
inline |
Performs a full reset of the planner. A typical usage is before a new decision point that requires a new plan.
Please note that this includes setting a new start state, clearing goal conditions, resetting the current iteration number.
- Parameters
-
| initialState | The new initial state the formulated plans will start from. |
◆ IsComputing
| bool Grail.Planners.Planner.IsComputing => !isPlanningFinished |
Returns whether the Planner hasn't yet finished computing the plan.
◆ Heuristic
Enables the planner to heuristically evaluate the calculated plans.
Similarly to A* pathfinding heuristic, it should return the estimation of the distance (cost) between an arbitrary state and the goal state.
◆ IterationLimit
| int Grail.Planners.Planner.IterationLimit |
|
getset |
Sets or gets the number of iterations per each execution of the planning problem. Each iteration ends with one candidate plan.
◆ MaxPlanCost
| float Grail.Planners.Planner.MaxPlanCost |
|
getset |
Sets or gets an upper bound on the plan cost measured as the sum of costs of actions it consists of. Set -1 for no limit.
It may limit the possible plans generated (if they would exceed this cost).
◆ MaxPlanLength
| int Grail.Planners.Planner.MaxPlanLength |
|
getset |
Sets of gets the maximum number of actions (steps) a plan can take. Set -1 for unlimited plans.
◆ OnPlanFound
Callback executed whenever a new plan has been found by the algorithm.
◆ OnPlanningFailed
| System.Action Grail.Planners.Planner.OnPlanningFailed |
|
set |
Callback executed if no plans were found in the allotted iteration budget and satisfying the MaxPlanLength and MaxPlanCost limits.
The documentation for this class was generated from the following file:
- GrailPlanners/source/Planner/Planner.cs