Class Controller<TAgent>
The control mechanism responsible for executing actions from the plan, monitoring progress of the operational actions, and updating the progress of the plan
Inheritance
System.Object
Controller<TAgent>
Namespace: Unity.AI.Planner.Agent
Syntax
public class Controller<TAgent>
Type Parameters
Name | Description |
---|---|
TAgent | The type of agent for which the controller acts |
Constructors
Controller(IPolicyGraph, Entity, TAgent, Dictionary<String, IOperationalAction<TAgent>>, Func<IPolicyGraph, Boolean>)
Initializes the controller
Declaration
public Controller(IPolicyGraph plan, Entity stateEntity, TAgent agent, Dictionary<string, IOperationalAction<TAgent>> actionMapping, Func<IPolicyGraph, bool> checkPlan = null)
Parameters
Type | Name | Description |
---|---|---|
IPolicyGraph | plan | Plan for the controller to update and execute |
Entity | stateEntity | Entity corresponding to the current state |
TAgent | agent | Agent controlled |
System.Collections.Generic.Dictionary<System.String, IOperationalAction<TAgent>> | actionMapping | |
System.Func<IPolicyGraph, System.Boolean> | checkPlan | A function to check if the plan is ready before the each action is taken |
Properties
CurrentOperationalAction
The operational action currently executing
Declaration
public IOperationalAction<TAgent> CurrentOperationalAction { get; }
Property Value
Type | Description |
---|---|
IOperationalAction<TAgent> |
CurrentStateEntity
Entity corresponding to the current state
Declaration
public Entity CurrentStateEntity { get; protected set; }
Property Value
Type | Description |
---|---|
Entity |
Methods
CompleteAction()
Forces the end of the current operational action. Updates the plan to the controller's current state.
Declaration
public void CompleteAction()
Update()
Updates the controller, advances the plan or continues execution of an operational action
Declaration
public void Update()