Options
All
  • Public
  • Public/Protected
  • All
Menu

The Match Engine that takes a Design and its specified EngineOptions to form the backend for running matches with agents.

Hierarchy

  • MatchEngine

Index

Constructors

constructor

Properties

Private design

design: Design

The design the engine runs on

Private docker

docker: Dockerode

Private engineOptions

engineOptions: EngineOptions = deepCopy(DefaultMatchEngineOptions)

Engine options

killOffSignal

killOffSignal: boolean = false

A coordination signal to ensure that all processes are indeed killed due to asynchronous initialization of agents There is a race condition when a tournament/match is being destroyed and while every match is being destroyed, some matches are in the initialization stage where they call the engine's initialize function. As a result, when we send a match destroy signal, we spawn some processes and haven't spawned some others for the agents. As a result, all processes eventually get spawned but not all are cleaned up and killed.

Private log

log: Logger = new Logger()

Logger

Private memoryWatchInterval

memoryWatchInterval: any = null

Single memory watch interval so that all memory checks are made together

Private overrideOptions

overrideOptions: OverrideOptions

Override options

Static timeoutBuffer

timeoutBuffer: number = 25

approx extra buffer time given to agents due to engine processing for timeout mechanism

Methods

getCommands

getEngineOptions

getLogger

Private handleCommand

  • handleCommand(agent: Agent, str: string): Promise<void>

initialize

  • initialize(agents: Array<Agent>, match: Match): Promise<void>

Private initializeAgent

  • initializeAgent(agent: Agent, match: Match): Promise<void>

initializeCustom

  • initializeCustom(): Promise<boolean>

kill

  • kill(agent: Agent, reason?: string): Promise<void>

killAndClean

  • killAndClean(match: Match): Promise<void>

killAndCleanCustom

  • killAndCleanCustom(match: Match): Promise<void>

Private parseCustomArguments

resume

  • resume(match: Match): Promise<void>

resumeCustom

  • resumeCustom(match: Match): Promise<void>

runCustom

  • runCustom(match: Match): Promise<Array<string>>
  • Run a custom match. A custom match much print to stdout all relevant data to be used by the engine and Dimensions framework. All output after the conclude command from Design.OverrideOptions is outputted is stored as a list of new line delimited strings and returned as the match results. The match must exit with exit code 0 to be marked as succesfully complete and the processing of results stops and this function resolves

    Parameters

    • match: Match

      the match to run

    Returns Promise<Array<string>>

send

  • send(match: Match, message: string, agentID: ID): Promise<boolean>

setEngineOptions

setLogLevel

  • setLogLevel(loggingLevel: LEVEL): void

stop

  • stop(match: Match): Promise<void>

stopCustom

  • stopCustom(match: Match): Promise<void>

Generated using TypeDoc