Controller for interacting with trials in the Cogment framework. Each instance is bound to CogSettings, TrialActor's ActorImplementation's and gRPC connections to the Cogment framework.

Methods

getActiveActors

getActiveActors(): TrialActor[]

A list of TrialActor's associated to this trial.

Returns: TrialActor[]

  • The trial actors for this trial.

Defined in: cogment/TrialController.ts:101


getTriaId

getTriaId(): string

The id of any started or joined trial.

Returns: string

  • The trial id

Defined in: cogment/TrialController.ts:109


getTrialInfo

getTrialInfo(trialId: string): Promise<TrialInfoReply>

Get trial information for a given trial.

Parameters:

Name Type Description
trialId string Id of the trial to retrieve info for.

Returns: Promise<TrialInfoReply>

Defined in: cogment/TrialController.ts:120


isTrialOver

isTrialOver(trialId: string): Promise<boolean>

Check if a given trial is completed.

Parameters:

Name Type Description
trialId string the id of the trial to check.

Returns: Promise<boolean>

Defined in: cogment/TrialController.ts:141


joinTrial

joinTrial(trialId: string, trialActor?: TrialActor): Promise<JoinTrialReturnType>

Join a trial given a trial id.

Parameters:

Name Type Description
trialId string The trialId of the trial to join.
trialActor? TrialActor The TrialActor configuration to join as.

Returns: Promise<JoinTrialReturnType>

Defined in: cogment/TrialController.ts:151


startTrial

startTrial(actorClass: string, trialConfig?: Message): Promise<AsObject>

Start a new trial.

Parameters:

Name Type Description
actorClass string The name of an actor_class corresponding to cogment.yaml
trialConfig? Message A TrialConfig protobuf that will be passed to any pre-hooks configured in cogment.yaml

Returns: Promise<AsObject>

  • A trial start response

Defined in: cogment/TrialController.ts:204


terminateTrial

terminateTrial(trialId: string): Promise<void>

Terminate a trial.

Parameters:

Name Type Description
trialId string Id of the trial to terminate.

Returns: Promise<void>

Defined in: cogment/TrialController.ts:238


version

version(): Promise<VersionReturnType>

Request the version from the Cogment framework.

Returns: Promise<VersionReturnType>

Defined in: cogment/TrialController.ts:258


watchTrials

watchTrials(filter?: (0 | 2 | 1 | 3 | 4 | 5)[]): AsyncGenerator<TrialListEntry, void, void>

Watch cogment for trial changes.

Parameters:

Name Type Description
filter? (0 | 2 | 1 | 3 | 4 | 5)[] An enum of TrialState's to watch trial changes of.

Returns: AsyncGenerator<TrialListEntry, void, void>

Defined in: cogment/TrialController.ts:277