|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.Simulator
public class Simulator
This is the main entry point to peersim. This class loads configuration and detects the simulation type. According to this, it invokes the appropriate simulator. The known simulators at this moment, along with the way to detect them are the following:
CDSimulator
:
if CDSimulator.isConfigurationCycleDriven()
returns
trueEDSimulator
:
if EDSimulator.isConfigurationEventDriven()
returns
true
main(java.lang.String[])
Parameter Summary | |
---|---|
simulation.experiments
Parameter representing the number of times the experiment is run. |
|
simulation.stdout
If present, this parameter activates the redirection of the standard output to a given PrintStream. |
Field Summary | |
---|---|
static int |
CDSIM
CDSimulator |
static int |
EDSIM
EDSimulator |
protected static java.lang.String[] |
simName
the class names of simulators used |
static int |
UNKNOWN
Unknown simulator |
Constructor Summary | |
---|---|
Simulator()
|
Method Summary | |
---|---|
static int |
getSimID()
Returns the numeric id of the simulator to invoke. |
static void |
main(java.lang.String[] args)
Loads the configuration and executes the experiments. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Parameter Detail |
---|
simulation.experiments
simulation.stdout
Field Detail |
---|
public static final int CDSIM
CDSimulator
public static final int EDSIM
EDSimulator
public static final int UNKNOWN
protected static final java.lang.String[] simName
Constructor Detail |
---|
public Simulator()
Method Detail |
---|
public static int getSimID()
CDSIM
, EDSIM
or UNKNOWN
.
public static void main(java.lang.String[] args)
Loading the configuration is currently done with the help of constructing
an instance of ParsedProperties
using the constructor
ParsedProperties.ParsedProperties(String[])
.
The parameter
args
is simply passed to this class. This class is then used
to initialize the configuration.
After loading the configuration, the experiments are run by invoking the appropriate engine, which is identified as follows:
CDSimulator
:
if CDSimulator.isConfigurationCycleDriven()
returns
trueEDSimulator
:
if EDSimulator.isConfigurationEventDriven()
returns
true
This list represents the order in which these alternatives are checked. That is, if more than one return true, then the first will be taken. Note that this class checks only for these clues and does not check if the configuration is consistent or valid.
args
- passed on to
ParsedProperties.ParsedProperties(String[])
ParsedProperties
,
Configuration
,
CDSimulator
,
EDSimulator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |