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 java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<AgentGenerator<T,R>> |
agentGenerators
The agent generators.
|
private MultiAgentSystemGenerator<T,R> |
masGenerator
The multi-agent system generator.
|
private ProtocolGenerator<S,T,R> |
protGenerator
The protocol generator.
|
Constructor and Description |
---|
GameSimulator(MultiAgentSystemGenerator<T,R> masGenerator,
ProtocolGenerator<S,T,R> protGenerator,
java.util.List<AgentGenerator<T,R>> agentGenerators)
Creates a new GameSimulator for the given
MultiAgentSystemGenerator and AgentGenerators.
|
Modifier and Type | Method and Description |
---|---|
SimulationResult<S,T,R> |
run(int repetitions)
Simulates the game for the given number of
repetitions and returns a map indicating
which agent generator won how often.
|
private MultiAgentSystemGenerator<T extends Agent,R extends MultiAgentSystem<T>> masGenerator
private ProtocolGenerator<S extends AbstractProtocol & GameProtocol,T extends Agent,R extends MultiAgentSystem<T>> protGenerator
private java.util.List<AgentGenerator<T extends Agent,R extends MultiAgentSystem<T>>> agentGenerators
public GameSimulator(MultiAgentSystemGenerator<T,R> masGenerator, ProtocolGenerator<S,T,R> protGenerator, java.util.List<AgentGenerator<T,R>> agentGenerators)
masGenerator
- a MultiAgentSystemGeneratorprotGenerator
- a protocol generatoragentGenerators
- some AgentGenerators.public SimulationResult<S,T,R> run(int repetitions) throws ProtocolTerminatedException
repetitions
- the number of repetitions.ProtocolTerminatedException
- if a protocol is asked
to perform a step but has already terminated.