org.openware.loadsim.simulation
Class GaussianTimer

java.lang.Object
  |
  +--org.openware.loadsim.simulation.GaussianTimer
All Implemented Interfaces:
ITimer, java.io.Serializable

public class GaussianTimer
extends java.lang.Object
implements ITimer

Implements a Gaussian based timer. Timers are used to add a random delay between the successful download of the next page and the submission of the next link. The GaussianTime chooses the delay based on a Gaussian random distribution.

Author:
Vincent Sheffer.
See Also:
Serialized Form

Constructor Summary
GaussianTimer(long mean, double stdev)
          Create a GaussianTimer explicitly giving the mean and standard deviation to define the random distribution.
GaussianTimer(org.w3c.dom.Node node)
          Create a GaussianTimer based on configuration information.
 
Method Summary
 java.lang.String getId()
          Get the ID of the timer.
 long nextDelay()
          Get the next delay for this timer.
 java.lang.String toString()
          Return a String representation of the GaussianTimer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GaussianTimer

public GaussianTimer(org.w3c.dom.Node node)
              throws ConfigException
Create a GaussianTimer based on configuration information.
Parameters:
node - The DOM node for that contains the timer specification.
Throws:
ConfigException - if there is a problem with the configuration file.

GaussianTimer

public GaussianTimer(long mean,
                     double stdev)
Create a GaussianTimer explicitly giving the mean and standard deviation to define the random distribution.
Parameters:
mean - The mean of the distribution.
stdev - The standard deviation of the distribution.
Method Detail

nextDelay

public long nextDelay()
Get the next delay for this timer.
Specified by:
nextDelay in interface ITimer
Returns:
The next delay that can be used in a Thread.sleep() method.

getId

public java.lang.String getId()
Get the ID of the timer. The ID is used to reference the timer in the configuration file.
Specified by:
getId in interface ITimer
Returns:
The ID of the timer.

toString

public java.lang.String toString()
Return a String representation of the GaussianTimer.
Overrides:
toString in class java.lang.Object
Returns:
a String representation of the GaussianTimer.


Copyright © 2000, 2001 Openware, Spin Software. All Rights Reserved.