peersim.rangesim
Class RangeSimulator

java.lang.Object
  extended by peersim.rangesim.RangeSimulator
All Implemented Interfaces:
ProcessHandler

public class RangeSimulator
extends java.lang.Object
implements ProcessHandler

This class is the main class for the Range Simulator. A range is a collection of values S to be assigned to a variable v. The Range Simulator invokes the standard Peersim simulator once for each distinct value. If multiple ranges S1, S2, ..., Sn are specified, the standard Peersim simulator is invoked for each element in S1 * S2 * ... * Sn.

Ranges are specified with the following syntax:

range.[id] [var];[range]
where: Examples of range specifications are the following:
range.0 SIZE;2^10:2^18|*2
range.1 K;20:30
range.2 CHURN;0.05,0.10,0.20 
With this specification, the collection of values associated to SIZE is {2^10,2^11,...,2^18}; K contains {20,21,22,...,30}, while CHURN contains just the specified values.

Values can be specified as constant expressions (like 2^10, (5+10), etc.) but variables cannot be used.

A separate Java virtual machine is invoked to run each of the experiments. An attempt is done to run the same JVM version as the one running the Range Simulator; if this is not possible (for example due to path problems), the command shell mechanism is used to run the first JVM version found in the path.

It is possible to specify options for the forked JVM using the "jvm.options" parameter on the command line. For example, a command line like this:
java peersim.rangesim.RangeSimulator config.file jvm.options=-Xmx256m
can be used to run the forked JVM with a maximum heap of 256MB.

The new JVM inherits the same classpath as the JVM running the RangeSimulator. The "jvm.options" parameter can be used to specify additional classpath specification.


Parameter Summary
range
          This is the prefix of the config properties whose value vary during a set of experiments.
jvm.options
          This config property can be used to set options in the JVMs that are forked to execute experiments with different configuration parameters.
 
Constructor Summary
RangeSimulator(java.lang.String[] args)
           
 
Method Summary
 void doStop()
          Stop the process executing the external java virtual machine.
 void join()
          Wait until the java virtual machine has terminated; it won't be used in this class, but you never know.
static void main(java.lang.String[] args)
          Main method of the system.
 void run()
          Main method to be executed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Parameter Detail

range

This is the prefix of the config properties whose value vary during a set of experiments.


jvm.options

This config property can be used to set options in the JVMs that are forked to execute experiments with different configuration parameters.

Constructor Detail

RangeSimulator

public RangeSimulator(java.lang.String[] args)
Method Detail

main

public static void main(java.lang.String[] args)
Main method of the system.


run

public void run()
Main method to be executed


doStop

public void doStop()
Stop the process executing the external java virtual machine.

Specified by:
doStop in interface ProcessHandler

join

public void join()
          throws java.lang.InterruptedException
Wait until the java virtual machine has terminated; it won't be used in this class, but you never know.

Specified by:
join in interface ProcessHandler
Throws:
java.lang.InterruptedException - thrown if the wait is interrupted