public sealed class GoapPlannerThe A* over a domain's action graph, bounded and reported.
Remarks
Backwards, from goal to satisfied, which is doc 37 § D10. A node is one action chosen to serve a condition; its children are the actions that can serve its unmet conditions. The search finishes at the first node whose own conditions all hold in the projected world — that action can be run now, and the chain back up to the goal is the plan.
⚠ A plan is a chain, so an action with two unmet conditions is served one at a time — and that is correct rather than a simplification. Only the head is committed (§ D11): the head is by construction runnable now, running it changes the world, and the next resolve plans from what the world then is. A search that instead tried to satisfy every branch of a conjunction at once would be a hyper-graph search whose plans go stale before their second step.
⚠ An action may not appear twice in one chain. Without that, a domain where two actions serve each other's conditions is an infinite descent — and the budget would report exhaustion for a domain with a perfectly good two-step plan in it.
It searches a GoapSnapshot and never the world, which is what makes a resolve a job. See GoapPlanQueue.
Fields and properties (4)
public GoapDomain DomainThe domain being searched.
public GoapSettings SettingsWhat bounds a search.
public int LastExpandedHow many nodes the last search expanded.
public List<GoapConsidered>? TracedWhere the search writes down what it considered and rejected, when a tool asked for it.
Methods (3)
public GoapPlanner(GoapDomain domain, GoapSettings? settings = null)Creates a planner over a domain.
public PlanFailure Resolve(in AgentContext context, GoapPlan plan, int goal = -1, IActionCostModel? costs = null, GoapTargetSensors? sensors = null, GoapCapabilities capabilities = default(GoapCapabilities))Takes a snapshot and searches it, on the caller's thread.
public PlanFailure Search(GoapSnapshot snapshot, GoapPlan plan)Searches a snapshot. Touches nothing else, so it may run anywhere.
Used by (8)
- GoapBudgetTestsVixen.Ai.Tests
- GoapCostTestsVixen.Ai.Tests
- GoapPearTestsVixen.Ai.Tests
- GoapPlanQueueVixen.Ai
- GoapReplanTestsVixen.Ai.Tests
- GoapDomainViewVixen.Editor.AssetEditors
- GoapGraphProjectionTestsVixen.Editor.AssetEditors.Tests
- LiveGoapTestsVixen.Editor.AssetEditors.Tests