ptrefall / fluid-hierarchical-task-network

A simple HTN planner based around the principles of the Builder pattern.
MIT License
344 stars 47 forks source link

it seems that ITask.LastStatus is never upated internally #10

Closed shadd3 closed 3 years ago

shadd3 commented 3 years ago

Hello and many thanks for your work
By installing Callback hooks in the planner;
I try to get last state from any task (for debugging purposes)
But apparently (If i understood well) ITask.LastStatus is never updated internally by any class derived from ITask
Thanks

ptrefall commented 3 years ago

Hm, it looks like these are indeed not used. IOperator has the Update method which returns TaskStatus, which in turn is used by the Planner (which holds a LastStatus). This plan execution related task status, and the Planner would hold the TaskStatus of the operator of the task that was executed last tick, so you should find what you need there. Let me know if that resolves the issue for you?

Thanks for pointing this out, pretty incredible I didn't notice this earlier 😅