eta.core.execution.execution_loop

execution_loop(ds)[source]

Either execute the current intended step of the plan or attempt to match an expectation.

This will do one of several things depending on the class of the currently pending step:

  1. If a condition or repetition step, advance the plan once none of the conditions are true.

  2. If an expected step, attempt to match the step to a fact in context, until a time period based on the certainty of that step has elapsed, in which case the step is characterized as a failure and the plan is advanced.

  3. If an intended step that contains a primitive action, attempt to execute that action, and advance the plan if successful.

In any the case where an execution or match is successful, the plan is advanced, and a list of variable bindings obtained from the execution or match is applied throughout the dialogue state. Additionally, if the plan was advanced, the contents of the ‘plans’ buffer is replaced with the modified plan.

Note that, if the plan wasn’t advanced but the step is a condition or repetition step, the plan is still added to the ‘plans’ buffer, but only if currently empty. This is because the condition may change with any observation, so the planning loop must constantly check for possible expansions of that step.

Parameters:

ds (DialogueState) –