Controller object passed to each ActorImplementation callback.

Type parameters

Name Type Description
ActionT Message The action space type for this actor class
ObservationT Message The observation space type for this actor class
RewardT Message The reward type for this actor class

Methods

addFeedback

addFeedback(to: string[], feedback: Reward): void

Parameters:

Name Type
to string[]
feedback Reward

Returns: void

Defined in: cogment/ActorSession.ts:93


eventLoop

eventLoop(): AsyncGenerator<Event<ObservationT, RewardT>, any, unknown>

Yields observations, messages and rewards received from the Cogment framework.

Returns: AsyncGenerator<Event<ObservationT, RewardT>, any, unknown>

  • A generator that yields observations, messages and rewards.

Defined in: cogment/ActorSession.ts:101


getTickId

getTickId(): undefined | number

Get the trial's current tick id, matching the latest received observation.

Returns: undefined | number

  • The current tick id.

Defined in: cogment/ActorSession.ts:130


isTrialOver

isTrialOver(): boolean

Check if the trial is over.

Returns: boolean

Defined in: cogment/ActorSession.ts:137


sendAction

sendAction(userAction: ActionT): void

Send an action to the environment.

Parameters:

Name Type Description
userAction ActionT An action space protobuf for this actor class.

Returns: void

Defined in: cogment/ActorSession.ts:145


sendMessage

sendMessage(__namedParameters: SendMessageOptions): Promise<AsObject>

Send an asynchronous message to a cogment entity.

Parameters:

Name Type
__namedParameters SendMessageOptions

Returns: Promise<AsObject>

Defined in: cogment/ActorSession.ts:161


start

start(): void

Start this ActorSession, the eventLoop will begin yielding events received from the Cogment framework.

Returns: void

Defined in: cogment/ActorSession.ts:194


stop

stop(): void

End this ActorSession, ending the eventLoop.

Returns: void

Defined in: cogment/ActorSession.ts:201