Match Constructor
The Design used
Configurations that are passed to every run through Design.initialize, Design.update, and Design.getResults functioon in the given Design
agent meta data regarding files, ids, etc.
List of the agents currently involved in the match.
When the match was created (called with new)
The Design used
When the match finished
Match ID. It's always a 12 character NanoID
The match logger.
The associated MatchEngine that is running this match and serves as the backend for this match.
Match process used to store the process governing a match running on a custom design
The timer set for the match process
The current match status
Name of the match
Non local files that should be removed as they are stored somewhere else. Typically bot files are non local if using a backing storage service
Path to the replay file for this match
Key used to retrieve the replay file from a storage plugin
Resolver for stop Promise
The results field meant to store any results retrieved with Design.getResults
Promise for resuming
Resolver for the above promise
Rejecter for the run promise
Signal to stop at next time step
The state field. This can be used to store anything by the user when this match
is passed to the Design
life cycle functions Design.initialize, Design.update, and Design.getResults
This is also used by the CustomDesign class to store all standard outputted match output for matches running using a custom design and passing in Design.OverrideOptions.
The current time step of the Match. This time step is independent of any Design and agents are coordianted against this timeStep
Destroys this match and makes sure to remove any leftover processes
Retrieve results through delegating the task to Design.getResults
Handles log files and stores / uploads / deletes them as necessary
Initializes this match using its configurations and using the Design.initialize function. This can throw error with agent generation, design initialization, or with engine initialization. In engine initialization, errors that can be thrown can be AgentCompileErrors, AgentInstallErrors, etc.
a promise that resolves true if initialized correctly
Terminate an Agent, kill the process. Note, the agent is still stored in the Match, but you can't send or receive messages from it anymore
id of agent or the Agent object to kill
an optional reason string to provide for logging purposes
Stop all agents through the match engine and clean up any other files and processes
Used by custom and dimensions based designs
Next function. Moves match forward by one timestep. Resolves with the match status This function should always used to advance forward a match unless a custom design is provided
Gathers commands from agents via the MatchEngine
Should not be called by user
Resume the match if it was in the stopped state
true if succesfully resumed
Retrieves a bot through its key and downloads it to a random generated folder. Returns the new file's path
if true, storage plugin will avoid redownloading data. If false, storage plugin will always redownload data
Runs this match to completion. Sets this.results to match results and resolves with the match results when done
Sends a message to the standard input of all agents in this match
the message to send to all agents available
a promise resolving true/false if it was succesfully sent
Stops the match. For non-custom designs, stops at the next nearest timestep possible. Otherwise attempts to stop the match using the MatchEngine stopCustom function.
Notes:
timeStep
Throw an FatalError, MatchError, or MatchWarn within the Match. Indicates that the Agent with id agentID caused this error/warning.
Throwing MatchWarn will just log a warning level message and throwing a MatchError will just log it as an error level message.
Throwing FatalError will cause the match to automatically be destroyed. This is highly not recommended and it is suggested to have some internal logic to handle moments when the match cannot continue.
Examples are misuse of an existing command or using incorrect commands or sending too many commands
Generates a 12 character nanoID string for identifying matches
Match Configurations. See Match.Configs for configuration options
Generated using TypeDoc
An match created using a Design and a list of Agents. The match can be stopped and resumed with stop, resume, and state and configurations can be retrieved at any point in time with the state and configs fields
Design for Design information
Agent for Agent information