branchbefore/main/Decision Maker Recursion Refactorcancel
20 Commits over 28 Days - 0.03cph!
Cleaned up and removed old DM paths.
Found the bug causing woodcutting rampage.
Let's test goal and goal-plan for 0, since it "can" be at the top of the heap if there's nothing better available.
Ooops, forgot to use the goal blackboard rather than temporaryBlackboard for goal plan fallbacks.
Fixed a few bugs, there's definitely more.
Some optimizations. Set max goal count to 50 and max goal plans per goal to 25, as allocation presumptions for the binary heaps in agent+decisionmaker + made the binary heaps shared among all agents (since they're only ever accessed within the scope of SimTickDecisionMaker().
This now seem to work, but obviously needs more rigirous testing to confirm that it doesn't fuck up.
Goal now buffers the blackboard of it's latest decision, for use when scoring goal plans. Renamed the root function and commented out the old root function, so that the new DM path is now used by agent (for testing).
Added in the debug hooks.
When picking a goal or goal plan when multiple elements scored above the given threshold, we now reinsert elements that fail but with a slightly lower score than the new top of the heap element, since we have no guarantees that a goal or goal plan has a valid path to a goal plan variant.
When iterating goal plans, we now try to construct a valid goal plan variant for the current goal plan, and if that succeeds we try to set it as the new behaviour of our agent.
Getting there... Iterative approach to best goal with support for moving to next best goal and so on when finding goal plan fails...
Rather than Decision being a binary heap item for priority heaping, we let Goal and GoalPlan be the binary heap items instead. This is because we don't want DecisionMaker to clear away our sorted decision scores for goals when we create the heap of goal plans (necessity of moving to an iterative approach). This also greatly simplifies how much Agent+DecisionMaker must touch Decisions.
Added optional decision making path in DecisionMaker that returns a binary heap of decisions (all decisions), sorted by decision score, so that the best decision is always at the top of the heap. It also returns the number of elements that scores over the decision threshold, so that we know how many items on the top of the heap we consider "best decisions".
Added Binary Heap class for optimal priority access to the list of decisions that Decision Maker executes over.