|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.config.CheckConfig
public class CheckConfig
This is utility tool that checks whether a config file can be loaded or not, without actually performing the simulation. All the error messages generated by controls and protocols when initialized are reported. This is useful to check all the configuration files in a directory.
Parameter Summary | |
---|---|
range
This is the prefix of the config properties whose value vary during a set of experiments. |
Field Summary | |
---|---|
protected static int |
CDSIM
CDSimulator |
protected static int |
EDSIM
EDSimulator |
protected static java.lang.String[] |
simName
the class names of simulators used |
protected static int |
UNKNOWN
|
Constructor Summary | |
---|---|
CheckConfig()
|
Method Summary | |
---|---|
protected static int |
getSimID()
Returns the numeric id of the simulator to invoke. |
static void |
main(java.lang.String[] args)
Loads the configuration and checks the configuration files against simple configuration errors, such as missing classes, missing parameters or syntax errors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Parameter Detail |
---|
range
Field Detail |
---|
protected static final int CDSIM
CDSimulator
protected static final int EDSIM
EDSimulator
protected static final int UNKNOWN
protected static final java.lang.String[] simName
Constructor Detail |
---|
public CheckConfig()
Method Detail |
---|
protected static int getSimID()
CDSIM
, EDSIM
or UNKNOWN
.
public static void main(java.lang.String[] args) throws java.lang.Exception
The goal is to provide a mechanism to test a configuration file, without having to perform the actual simulations (that could be time-consuming) and without necessarily blocking after the first error encountered. It may be useful, for example, when a major refactoring of your code requires a thorough check on all your configuration files.
Loading the configuration is currently done with the help of
constructing an instance of ParsedProperties
using the
constructor ParsedProperties.ParsedProperties(String[])
,
in the same way as the normal simulator.
After loading the configuration, the collection of nodes forming a Network is instantiated, together with all protocols forming a node. Initialization controls are executed, and then the simulation stops.
For each error encountered, a message is printed ons standard error, and the initialization keeps going without interruption. If multiple errors are present, an error message for each of them is printed. Apart from errors, default choices are also printed as warnings, to allow developers to spot subtle configuration errors such as missing parameters that defaults to standard values.
args
- passed on to
ParsedProperties.ParsedProperties(String[])
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |