com.threerings.probs
Class FloatVariable.Uniform

java.lang.Object
  extended by com.threerings.util.DeepObject
      extended by com.threerings.probs.FloatVariable
          extended by com.threerings.probs.FloatVariable.Uniform
All Implemented Interfaces:
Exportable, Copyable, Cloneable
Enclosing class:
FloatVariable

public static class FloatVariable.Uniform
extends FloatVariable

Returns a uniformly distributed value.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.probs.FloatVariable
FloatVariable.Constant, FloatVariable.Exponential, FloatVariable.Normal, FloatVariable.Uniform
 
Field Summary
 float maximum
          The maximum value to return.
 float minimum
          The minimum value to return.
 
Constructor Summary
FloatVariable.Uniform()
          No-arg constructor for deserialization, etc.
FloatVariable.Uniform(float minimum, float maximum)
          Creates a uniformly distributed variable with the specified minimum and maximum values.
FloatVariable.Uniform(FloatVariable variable)
          Creates a uniformly distributed variable with the specified variable's mean.
 
Method Summary
 float getMean()
          Returns the variable's mean.
 float getValue()
          Returns a sample value according to the variable's distribution.
 
Methods inherited from class com.threerings.util.DeepObject
clone, copy, copy, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

minimum

@Editable(min=-1d/0d,
          max=-1d/0d,
          step=-1d/0d,
          scale=-1d/0d)
public float minimum
The minimum value to return.


maximum

@Editable(min=-1d/0d,
          max=-1d/0d,
          step=-1d/0d,
          scale=-1d/0d)
public float maximum
The maximum value to return.

Constructor Detail

FloatVariable.Uniform

public FloatVariable.Uniform(float minimum,
                             float maximum)
Creates a uniformly distributed variable with the specified minimum and maximum values.


FloatVariable.Uniform

public FloatVariable.Uniform(FloatVariable variable)
Creates a uniformly distributed variable with the specified variable's mean.


FloatVariable.Uniform

public FloatVariable.Uniform()
No-arg constructor for deserialization, etc.

Method Detail

getValue

public float getValue()
Description copied from class: FloatVariable
Returns a sample value according to the variable's distribution.

Specified by:
getValue in class FloatVariable

getMean

public float getMean()
Description copied from class: FloatVariable
Returns the variable's mean.

Specified by:
getMean in class FloatVariable


Copyright © 2011. All Rights Reserved.