Class COptQuestPowerRandomVariable


public class COptQuestPowerRandomVariable extends COptQuestUserControlledVariable
A random variable whose value is from rmin to rmax. Use power to set where the values collect. With power = 1, every value in the range is equally likely. With power = 2, the values are the distances from the center of points spread evenly over the area of a ring with the radii rmin and rmax. With power = 3, they are the distances from the center of points spread evenly over the volume of a spherical shell. With a larger power, more values are near rmax. With a power between 0 and 1, more values are near rmin.

The probability density is proportional to x^(power - 1): pdf(x) = power * x^(power - 1) / (rmax^power - rmin^power) for rmin <= x <= rmax. With power = 1, the density is the constant 1 / (rmax - rmin).

power must be greater than 0, rmin must be at least 0, and rmax must be greater than rmin.

The engine draws a new value at the start of every replication. The probability distribution is COptQuestPowerDistribution.

See Also:
  • Constructor Details

    • COptQuestPowerRandomVariable

      public COptQuestPowerRandomVariable(String name, double rmin, double rmax, double p) throws COptQuestException
      Constructs a new power random variable with the specified name, radial bounds, and exponent.
      Parameters:
      name - the name/identifier of this random variable (used for reporting, logging, or display purposes)
      rmin - inner radius (≥ 0)
      rmax - outer radius (> rmin)
      p - the exponent that you use to set where the values collect, greater than 0: 1 for equally likely values, 2 for points spread evenly over a ring, 3 for a spherical shell
      Throws:
      COptQuestException
    • COptQuestPowerRandomVariable

      public COptQuestPowerRandomVariable(String name, double r, double p) throws COptQuestException
      Constructs a new power random variable with the specified name, maximum radius, and exponent (inner radius defaults to 0).
      Parameters:
      name - the name/identifier of this random variable (used for reporting, logging, or display purposes)
      r - the maximum radius/scale (upper bound of the support, > 0)
      p - the exponent that you use to set where the values collect, greater than 0: 1 for equally likely values, 2 for points spread evenly over a disk, 3 for a ball
      Throws:
      COptQuestException
    • COptQuestPowerRandomVariable

      public COptQuestPowerRandomVariable(String name, double p) throws COptQuestException
      Constructs a new power random variable with the specified name and exponent, using the unit interval [0, 1] as the radial range.
      Parameters:
      name - the name/identifier of this random variable (used for reporting, logging, or display purposes)
      p - the volume/area exponent (> 0; typically 2 for unit disk, 3 for unit ball)
      Throws:
      COptQuestException