referee: Define the referee

Description Usage Value Examples

View source: R/referee.R

Description

The referee is a special class of agent with no parameters, whose function runs after agents have completed their own functions in each time step. You can think of the referee as being the environment's agent. E.g. when simulating a game of soccer, the agents will be players and the environment holds values such as the score. The referee is needed to increment the score and to reset play after a team scores a goal.

Agents themselves could be given the referee's tasks but it's simpler to have a separate function that runs at the end of each time step, after all of the agents have completed their tasks.

The referee has access to the entire simulation object and can modify any part of it, including agents, the environment and the referee itself.

Usage

1

Value

A 'referee' S3 object

Examples

1
new_referee <- referee()

neilcharles/agentSim documentation built on Oct. 31, 2020, 11:23 a.m.