Module SCA_RandomActuator :: Class SCA_RandomActuator
[frames | no frames]

Class SCA_RandomActuator

SCA_ILogicBrick --+    
                  |    
      SCA_IActuator --+
                      |
                     SCA_RandomActuator


Random Actuator
Method Summary
distribution type getDistribution()
Returns the type of random distribution.
float getPara1()
Returns the first parameter of the active distribution.
float getPara2()
Returns the second parameter of the active distribution.
string getProperty()
Returns the name of the property to set.
integer getSeed()
Returns the initial seed of the generator.
  setBoolBernouilli(value)
Sets this generator to produce a Bernouilli distribution.
  setBoolConst(value)
Sets this generator to produce a constant boolean value.
  setBoolUniform()
Sets this generator to produce a uniform boolean distribution.
  setFloatConst(value)
Always generate the given value.
  setFloatNegativeExponential(half_life)
Generate negative-exponentially distributed numbers.
  setFloatNormal(mean, standard_deviation)
Generates a random float from the given normal distribution.
  setFloatUniform(lower_bound, upper_bound)
Generates a random float between lower_bound and upper_bound with a uniform distribution.
  setIntConst(value)
Sets this generator to always produce the given value.
  setIntPoisson(value)
Generate a Poisson-distributed number.
  setIntUniform(lower_bound, upper_bound)
Sets this generator to produce a random value between the given lower and upper bounds (inclusive).
  setProperty(property)
Set the property to which the random value is assigned.
  setSeed(seed)
Sets the seed of the random number generator.
    Inherited from SCA_ILogicBrick
integer getExecutePriority()
Gets the execution priority of this logic brick.
KX_GameObject getOwner()
Gets the game object associated with this logic brick.
  setExecutePriority(priority)
Sets the priority of this logic brick.

Method Details

getDistribution()

Returns the type of random distribution.
Returns:
KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI, KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON, KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL, KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL
           (type=distribution type)

getPara1()

Returns the first parameter of the active distribution.

Refer to the documentation of the generator types for the meaning of this value.
Returns:
float

getPara2()

Returns the second parameter of the active distribution.

Refer to the documentation of the generator types for the meaning of this value.
Returns:
float

getProperty()

Returns the name of the property to set.
Returns:
string

getSeed()

Returns the initial seed of the generator.
Returns:
integer

setBoolBernouilli(value)

Sets this generator to produce a Bernouilli distribution.
Parameters:
value - Specifies the proportion of False values to produce.
  • 0.0: Always generate True
  • 1.0: Always generate False

           (type=float)

setBoolConst(value)

Sets this generator to produce a constant boolean value.
Parameters:
value - The value to return.
           (type=boolean)

setBoolUniform()

Sets this generator to produce a uniform boolean distribution.

The generator will generate True or False with 50% chance.

setFloatConst(value)

Always generate the given value.
Parameters:
value
           (type=float)

setFloatNegativeExponential(half_life)

Generate negative-exponentially distributed numbers.

The half-life 'time' is characterized by half_life.
Parameters:
half_life
           (type=float)

setFloatNormal(mean, standard_deviation)

Generates a random float from the given normal distribution.
Parameters:
mean - The mean (average) value of the generated numbers
           (type=float)
standard_deviation - The standard deviation of the generated numbers.
           (type=float)

setFloatUniform(lower_bound, upper_bound)

Generates a random float between lower_bound and upper_bound with a uniform distribution.
Parameters:
lower_bound
           (type=float)
upper_bound
           (type=float)

setIntConst(value)

Sets this generator to always produce the given value.
Parameters:
value - the value this generator produces.
           (type=integer)

setIntPoisson(value)

Generate a Poisson-distributed number.

This performs a series of Bernouilli tests with parameter value. It returns the number of tries needed to achieve succes.
Parameters:
value
           (type=float)

setIntUniform(lower_bound, upper_bound)

Sets this generator to produce a random value between the given lower and upper bounds (inclusive).
Parameters:
lower_bound
           (type=integer)
upper_bound
           (type=integer)

setProperty(property)

Set the property to which the random value is assigned.

If the generator and property types do not match, the assignment is ignored.
Parameters:
property - The name of the property to set.
           (type=string)

setSeed(seed)

Sets the seed of the random number generator.

Equal seeds produce equal series. If the seed is 0, the generator will produce the same value on every call.
Parameters:
seed
           (type=integer)

Generated by Epydoc 2.1 on Thu Feb 1 00:12:33 2007 http://epydoc.sf.net