Rate this page:

Agent

This class represents a CCAI Agent instance. Add the following line to your scenario code to use the class: require(Modules.AI);

Constructors

constructor

Copy URL

Parameters

  • agentId:

    string

  • region:

    string

    Optional

Methods

addEventListener

Copy URL
addEventListener(event: 

Agent

,
callback:

Function

):

void

Add a handler for a specific event generated by the specified CCAI Agent instance. Use only functions as handlers; anything except a function leads to an error and scenario termination when a handler is called.

Parameters

  • event:

    Agent

    Event class

  • callback:

    Function

    Handler function

Returns

  • type:

    void

destroy

Copy URL
destroy(): 

void

Delete a CCAI Agent instance.

Returns

  • type:

    void

removeEventListener

Copy URL
removeEventListener(event: 

Agent

,
callback:

Function

):

void

Remove the event handler for a specific event generated by the specified CCAI Agent instance.

Parameters

  • event:

    Agent

    Event class

  • callback:

    Function

    Optional

    Handler function. If not specified, all event listeners are removed

Returns

  • type:

    void