Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.randvar
Class PowerGen

    java.lang.Object
      umontreal.iro.lecuyer.randvar.RandomVariateGen
          umontreal.iro.lecuyer.randvar.PowerGen

    public class PowerGen

extends RandomVariateGen

This class implements random variate generators for the power distribution with shape parameter c > 0, over the interval [a, b]. Its density is

f (x) = c(x - a)c-1/(b - a)c

for a <= x <= b, and 0 elsewhere.

Constructor Summary
`PowerGen(RandomStream s, double c)` Creates a Power random variate generator with parameters a = 0, b = 1 and c = `c`, using stream `s`.
`PowerGen(RandomStream s, double a, double b, double c)` Creates a Power random variate generator with parameters a = `a`, b = `b` and c = `c`, using stream `s`.
`PowerGen(RandomStream s, PowerDist dist)` Creates a new generator for the power distribution `dist` and stream `s`.

Method Summary
`double` | `getA()` Returns the parameter a.
`double` | `getB()` Returns the parameter b.
`double` | `getC()` Returns the parameter c.
`static double` | `nextDouble(RandomStream s, double a, double b, double c)` Uses inversion to generate a new variate from the power distribution with parameters a = `a`, b = `b`, and c = `c`, using stream `s`.
`void` | `setParams(double a, double b, double c)` Sets the parameters a, b and c for this object.

Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
`getDistribution, getStream, nextArrayOfDouble, nextDouble, setStream`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PowerGen

    public PowerGen(RandomStream s,
                    double a,
                    double b,
                    double c)

  Creates a Power random variate generator with parameters a = `a`, b = `b` and c = `c`, using stream `s`.

### PowerGen

    public PowerGen(RandomStream s,
                    double c)

  Creates a Power random variate generator with parameters a = 0, b = 1 and c = `c`, using stream `s`.

### PowerGen

    public PowerGen(RandomStream s,
                    PowerDist dist)

  Creates a new generator for the power distribution `dist` and stream `s`.

Method Detail

### nextDouble

    public static double nextDouble(RandomStream s,
                                    double a,
                                    double b,
                                    double c)

  Uses inversion to generate a new variate from the power distribution with parameters a = `a`, b = `b`, and c = `c`, using stream `s`.

### getA

    public double getA()

  Returns the parameter a.

### getB

    public double getB()

  Returns the parameter b.

### getC

    public double getC()

  Returns the parameter c.

### setParams

    public void setParams(double a,
                          double b,
                          double c)

  Sets the parameters a, b and c for this object.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.