ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.randvar
Class RandomVariateGenWithShift

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.RandomVariateGenWithShift

public class RandomVariateGenWithShift
extends RandomVariateGen

Random variate generator applying a shift to the generated values. This generator uses another random variate generator to generate variates. For each variate v, the nextDouble() method of this generator returns v - $ \ell$, where $ \ell$$ \RR$ is a constant, user-defined shift.


Field Summary
 
Fields inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
dist, stream
 
Constructor Summary
RandomVariateGenWithShift(RandomVariateGen gen, double shift)
          Constructs a new random variate generator with underlying generator gen, and shift shift.
 
Method Summary
 Distribution getDistribution()
           
 RandomVariateGen getRandomVariateGenerator()
          Returns the random variate generator being used by this object.
 double getShift()
          Returns the current value of the shift $ \ell$.
 RandomStream getStream()
           
 double nextDouble()
           
 void setShift(double shift)
          Sets the current value of the shift to shift.
 void setStream(RandomStream stream)
           
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
nextArrayOfDouble, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomVariateGenWithShift

public RandomVariateGenWithShift(RandomVariateGen gen,
                                 double shift)
Constructs a new random variate generator with underlying generator gen, and shift shift.

Parameters:
gen - the generator being used.
shift - the shift $ \ell$.
Method Detail

getShift

public double getShift()
Returns the current value of the shift $ \ell$.

Returns:
the current value of the shift.

setShift

public void setShift(double shift)
Sets the current value of the shift to shift.

Parameters:
shift - the new value of the shift.

getRandomVariateGenerator

public RandomVariateGen getRandomVariateGenerator()
Returns the random variate generator being used by this object.

Returns:
the associated random variate generator.

getDistribution

public Distribution getDistribution()
Overrides:
getDistribution in class RandomVariateGen

getStream

public RandomStream getStream()
Overrides:
getStream in class RandomVariateGen

nextDouble

public double nextDouble()
Overrides:
nextDouble in class RandomVariateGen

setStream

public void setStream(RandomStream stream)
Overrides:
setStream in class RandomVariateGen

ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.