Class GameSimulator<S extends AbstractProtocol & GameProtocol,T extends Agent,R extends MultiAgentSystem<T>>

java.lang.Object
org.tweetyproject.agents.sim.GameSimulator<S,T,R>
Type Parameters:
T - The actual type of agents.
S - The actual type of protocols.
R - The actual type of the multi-agent system.

public class GameSimulator<S extends AbstractProtocol & GameProtocol,T extends Agent,R extends MultiAgentSystem<T>> extends Object
This class implements a game simulator. It takes some agent and multi-agent system generators and runs a series of simulations. In each simulation the winner of the game is determined and recorded.
Author:
Matthias Thimm
  • Constructor Details

    • GameSimulator

      public GameSimulator(MultiAgentSystemGenerator<T,R> masGenerator, ProtocolGenerator<S,T,R> protGenerator, List<AgentGenerator<T,R>> agentGenerators)
      Creates a new GameSimulator for the given MultiAgentSystemGenerator and AgentGenerators.
      Parameters:
      masGenerator - a MultiAgentSystemGenerator
      protGenerator - a protocol generator
      agentGenerators - some AgentGenerators.
  • Method Details

    • run

      public SimulationResult<S,T,R> run(int repetitions) throws ProtocolTerminatedException
      Simulates the game for the given number of repetitions and returns a map indicating which agent generator won how often.
      Parameters:
      repetitions - the number of repetitions.
      Returns:
      a map which assigns to each agent generator the number of times an agent generated by it won the game.
      Throws:
      ProtocolTerminatedException - if a protocol is asked to perform a step but has already terminated.