public sealed class GoapPlanQueueResolves, queued and run a budget at a time.
Remarks
⚠ A GOAP resolve does not run on the frame that asked for it — doc 37 § D16, and exactly NavPathQueue's arrangement for exactly its reason. A behaviour-tree step is cheap and a utility score is bounded; a search over an action graph is neither, and an agent that changed its mind must not be able to spend the frame.
The world is read at Submit, on the thread that owns the agent. What reaches the search is a GoapSnapshot — a few arrays of numbers — so a resolve may run on a worker thread without touching a World or a Blackboard from it.
⚠ The per-frame cost is the two numbers together: how many resolves an Update runs, and what each of them may expand. Neither alone bounds anything, and a project that raises one should know it is raising the product.
A request whose plan is never taken holds its slot until the queue runs out and starts refusing new ones. Cancel is how an agent that changed its mind again gives the slot back.
Fields and properties (6)
public GoapDomain DomainThe domain being searched.
public GoapSettings SettingsWhat bounds a search.
public JobScheduler? SchedulerWhere to run the searches, or null to run them on the caller's thread.
public int PendingCountHow many requests are waiting or have not been taken.
public int LastResolvesHow many searches the last Update ran.
public int LastExpandedHow many nodes the last Update expanded, across every search.
Methods (6)
public GoapPlanQueue(GoapDomain domain, GoapSettings? settings = null, int capacity = 64, int parallelSearches = 4)Creates a queue over a domain.
public GoapPlanRequest Submit(in AgentContext context, int goal = -1, IActionCostModel? costs = null, GoapTargetSensors? sensors = null, GoapCapabilities capabilities = default(GoapCapabilities))Asks for a plan, reading the world now and searching later.
public bool Cancel(GoapPlanRequest request)Gives a slot back.
public GoapRequestState GetState(GoapPlanRequest request)How a request is getting on.
public void Update(int resolves = 4)Runs some of the waiting searches.
public bool TryTakeResult(GoapPlanRequest request, GoapPlan plan)Takes a finished plan, and gives the slot back.
Used by (3)
- AiSystemVixen.Ai
- GoapThroughputTestsVixen.Ai.Tests
- SearchJobVixen.Ai