anthill.genie.impl
Class GeneticScenarioImpl

java.lang.Object
  |
  +--anthill.antsim.impl.ScenarioImpl
        |
        +--anthill.genie.impl.GeneticScenarioImpl
All Implemented Interfaces:
Clearable, GeneticScenario, ResponseListener, Scenario

public class GeneticScenarioImpl
extends ScenarioImpl
implements GeneticScenario

This is the scenario

Version:
$Revision$
Author:
Alberto Montresor

Fields inherited from class anthill.antsim.impl.ScenarioImpl
factory, finalRounds, initRounds, monitor, net, netVersion, nrequests, resources, rounds, rsetVersion, SCENARIO_ROUNDS, stats
 
Constructor Summary
GeneticScenarioImpl(Factory factory, int nrequests, int initRounds, int rounds, int finalRounds)
          Instantiates a new ScenarioImpl.
 
Method Summary
 void addGeneticCode(GeneticCode code)
          Set the genetic code to be evaluated.
 void clear()
          Restores the object to its initial state.
 
Methods inherited from class anthill.antsim.impl.ScenarioImpl
complete, evaluate, returnResources, setStats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface anthill.antsim.Scenario
evaluate, setStats
 

Constructor Detail

GeneticScenarioImpl

public GeneticScenarioImpl(Factory factory,
                           int nrequests,
                           int initRounds,
                           int rounds,
                           int finalRounds)
Instantiates a new ScenarioImpl.
Parameters:
pnf - Peernet factory to be used to generate networks
Method Detail

clear

public void clear()
Restores the object to its initial state. The network is re-initialized as an empty network.
Specified by:
clear in interface Clearable
Overrides:
clear in class ScenarioImpl

addGeneticCode

public void addGeneticCode(GeneticCode code)
Set the genetic code to be evaluated. In this basic implementation, only one genetic code can be present in a scenario at a time. If this method is called more than once, exception IllegalStateException is thrown.
Specified by:
addGeneticCode in interface GeneticScenario
Throws:
IllegalStateException - if this method is added more than once.