Tasks

Task objects abstract away the difficulties of actually carrying out the tasks, and allow a uniform interface to the controller and memory across different platforms.

Task objects define a .step() method; on each iteration through the main agent loop, the Task is stepped, and the Task Stack steps its highest priority Task. The Task objects themselves are not generic across agents; and can be heuristic or learned. In the current droidlet agent controller, they are registered here, here and here

The base Task object is

class base_agent.task.Task[source]

This class represents a Task, the exact implementation of which will depend on the framework and environment. A task can be placed on a task stack, and represents a unit (which in itself can contain a sequence of s smaller subtasks).

Variables
  • ~Task.memid (string) – Memory id of the task in agent’s memory

  • ~Task.interrupted (bool) – A flag indicating whetherr the task has been interrupted

  • ~Task.finished (bool) – A flag indicating whether the task finished

  • ~Task.name (string) – Name of the task

  • ~Task.undone (bool) – A flag indicating whether the task was undone / reverted

  • ~Task.last_stepped_time (int) – Timestamp of last step through the task

  • ~Task.throttling_tick (int) – The threshold beyond which the task will be throttled

  • ~Task.stop_condition (Condition) – The condition on which the task will be stopped (by default, this is NeverCondition)

Examples::
>>> Task()
add_child_task(t, agent, pass_stop_condition=True)[source]

Add a child task to the task_stack and pass along the id of the parent task (current task)

check_finished()[source]

Check if the task has mark itself finished

Returns

If the task has finished

Return type

bool

interrupt()[source]

Interrupt the task and set the flag

step(agent)[source]

The actual execution of a single step of the task is defined here.

The Task Stack is maintained by the Memory system, and provides methods for examining and manipulating Task Objects. See the task_stack functions in memory.