planet.simulate
Class GenFileEvents

java.lang.Object
  extended by planet.simulate.GenFileEvents

public class GenFileEvents
extends java.lang.Object

Build file events in random or distributed manner. The random events shows a network with its Ids built randomly. The distributed events shows a network with equidistant Ids.

Author:
Ruben Mondejar, Jordi Pujol

Constructor Summary
GenFileEvents()
           
 
Method Summary
static void genDistribEvents(java.lang.String name, int num, int time)
          Build num equidistant Ids.
static void genRandomEvents(java.lang.String name, int num, int time)
          Generate a set of random ids for nodes to insert to the overlay.
static void main(java.lang.String[] args)
          This main application wait three arguments: name: Filename to save all events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenFileEvents

public GenFileEvents()
Method Detail

genRandomEvents

public static void genRandomEvents(java.lang.String name,
                                   int num,
                                   int time)
                            throws java.io.IOException,
                                   java.io.FileNotFoundException,
                                   InitializationException
Generate a set of random ids for nodes to insert to the overlay. The generated values are node's id and nodes' bootstrap. All this information is saved into file called name.

Parameters:
name - Filename where to save all events.
num - Number of nodes to generate.
time - Number of steps between any two events.
Throws:
java.io.IOException
java.io.FileNotFoundException
InitializationException

genDistribEvents

public static void genDistribEvents(java.lang.String name,
                                    int num,
                                    int time)
                             throws java.io.IOException,
                                    java.io.FileNotFoundException,
                                    InitializationException
Build num equidistant Ids. It means that the increment between any two consecutive Ids are the same. The generated values are node's id and nodes' bootstrap. All this information is saved into file called name.

Parameters:
name - Filename where to save all events.
num - Number of nodes to generate.
time - Number of steps between any two events.
Throws:
java.io.IOException
java.io.FileNotFoundException
InitializationException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
This main application wait three arguments:
  1. name: Filename to save all events.
  2. type: A character: 'R' for Random events; 'D' for distributed events.
  3. num: Number of events to build.

Parameters:
args - Command line arguments.
Throws:
java.lang.Exception