ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.randvar
Class RandomVariateGenIntWithShift

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.RandomVariateGenInt
          extended by umontreal.iro.lecuyer.randvar.RandomVariateGenIntWithShift

public class RandomVariateGenIntWithShift
extends RandomVariateGenInt

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 nextInt() method of this generator returns v - $ \ell$, where $ \ell$$ \NN$ is a constant, user-defined shift.


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

Constructor Detail

RandomVariateGenIntWithShift

public RandomVariateGenIntWithShift(RandomVariateGenInt gen,
                                    int 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 int getShift()
Returns the current value of the shift $ \ell$.

Returns:
the current value of the shift.

setShift

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

Parameters:
shift - the new value of the shift.

getRandomVariateGenerator

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

Returns:
the associated random variate generator.

getDistribution

public DiscreteDistributionInt getDistribution()
Overrides:
getDistribution in class RandomVariateGenInt

getStream

public RandomStream getStream()
Overrides:
getStream in class RandomVariateGen

nextInt

public int nextInt()
Overrides:
nextInt in class RandomVariateGenInt

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.