rwth-acis / Virtual-Agents-Prototype

A Unity package for creating virtual agents
MIT License
9 stars 5 forks source link

Functional AgentTask queueing system #23

Closed danielbekhter closed 3 years ago

danielbekhter commented 3 years ago

The Agent class now provides an API for AgentTask scheduling, which is performed in the background using the AgentTaskManager class. Useful shortcut-methods are provided to trigger task scheduling, including: RunTo(Vector3), PlayAnimation(string), WaitForSeconds(float) as well as more generic methods such as AddTask(IAgentTask) and ForceTask(IAgentTask).

The previously public method RequestNextTask() is now only available to the agents, who exercise an exclusive right of removing tasks from their own queues.

All of the currently implemented task types are independent classes deriving from IAgentTask. In order to implement IAgentTask, the following is required:

The code in the Agent script is neatly organized in two namespaces: VirtualAgentsFramework and its subspace AgentTasks. The AgentController script offers an example task queue for the "Capsule" agent in the project's AvatarTestScene.