planet.simulate
Class GenEvents

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

public class GenEvents
extends java.lang.Object

This class permits to build events in a programming way, without any event file.

Author:
Ruben Mondejar, Jordi Pujol

Constructor Summary
GenEvents()
           
 
Method Summary
static java.lang.Object[] genDistribEvents(int num)
          Returns an array with two positions.
static java.lang.Object[] genRandomIds(int num)
          Generate a set of random ids for nodes to insert to the overlay.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenEvents

public GenEvents()
Method Detail

genRandomIds

public static java.lang.Object[] genRandomIds(int num)
Generate a set of random ids for nodes to insert to the overlay. The generated values are node's id and nodes' bootstrap.

Parameters:
num - Number of nodes to generate.
Returns:
An array of two positions with: in first position the id node bootstrap of the node 'i'th; in second position the id of node 'i'th.

genDistribEvents

public static java.lang.Object[] genDistribEvents(int num)
Returns an array with two positions. The first one contains an array of Id of the bootstraps. The second one contains an array of Id with the node Id itself. The Ids are built equidistant. It means that the increment between any two consecutive Ids are the same.

Parameters:
num - Number of nodes to build.
Returns:
An array of two positions of Object, with an Id[] in any position. The first position contains the bootstrap Ids for any node, that appear in the second position.