Options
All
  • Public
  • Public/Protected
  • All
Menu
classdesc

Abstract class detailing a Design to be used as the platform that holds match lifecycle logic for updating and manipulating ongoing matches

Refer to Match class and the Agent for exposed fields available for user's use when making your own Design

The important functions to implement are initialize, update, and getResults

Hierarchy

Index

Constructors

constructor

Properties

Protected designOptions

designOptions: DesignOptions

The current design options

log

log: Logger = new Logger()

Logger

name

name: string

The name of the design

Methods

getDesignOptions

Abstract getResults

  • getResults(match: Match): Promise<any>
  • Abstract function required to get the result of a Match.

    see

    Match - This function is used by the match to update the results stored in the match and return results

    see

    {@link Tournament} - This function is used to return results from a match and then is fed into a resultHandler for a particular rankingSystem and tournament type.

    Parameters

    • match: Match

      The Match used to process results

    Returns Promise<any>

    A promise that resolves with results (can be an object, number, anything). Can also directly just return the results

Abstract initialize

  • initialize(match: Match): Promise<void>
  • Abstract function required to initialize match state and send relevant information to agents participating in the match

    see

    Agent for what properties and methods related to agents are exposed to the user for use.

    see

    Match for what properties and methods are exposed to the user for use e.g match.send() and match.state

    Parameters

    Returns Promise<void>

    Nothing needed, return result is not used by match

setLogLevel

  • setLogLevel(level: LEVEL): void

Abstract update

  • Abstract function required to update match state with commands from Agents and send commands to Agents along with returning the current match status. Returning Match.Status.RUNNING indicates the match is not done yet. Returning Match.Status.FINISHED indicates the match is over.

    see

    Match - This function is used by the match to update the match state and move forward a time step

    see

    Agent for what properties and methods related to agents are exposed to the user for use.

    see

    Match.Status for different statuses you can return.

    Parameters

    • match: Match

      The Match to update state with the given Commands

    • commands: Array<Command>

      The MatchEngine.Command array used to update the state in a Match. Each element has two keys, command and agentID. agentID is the id of the agent that outputted that string in command

    Returns Promise<Status>

    A promise that resolves with the current Match.Status at the end of this time step. Can also directly just return the match status

Static createCustom

Generated using TypeDoc