Module SCA_RandomActuator :: Class SCA_RandomActuator

Class SCA_RandomActuator

SCA_ILogicBrick.SCA_ILogicBrick --+    
                                  |    
        SCA_IActuator.SCA_IActuator --+
                                      |
                                     SCA_RandomActuator

Random Actuator

Properties:

Instance Methods
 
setSeed(seed)
DEPRECATED: use the seed property Sets the seed of the random number generator.
integer
getSeed()
DEPRECATED: use the seed property Returns the initial seed of the generator.
float
getPara1()
DEPRECATED: use the para1 property Returns the first parameter of the active distribution.
float
getPara2()
DEPRECATED: use the para2 property Returns the second parameter of the active distribution.
distribution type
getDistribution()
DEPRECATED: use the distribution property Returns the type of random distribution.
 
setProperty(property)
DEPRECATED: use the property property Set the property to which the random value is assigned.
string
getProperty()
DEPRECATED: use the property property Returns the name of the property to set.
 
setBoolConst(value)
Sets this generator to produce a constant boolean value.
 
setBoolUniform()
Sets this generator to produce a uniform boolean distribution.
 
setBoolBernouilli(value)
Sets this generator to produce a Bernouilli distribution.
 
setIntConst(value)
Sets this generator to always produce the given value.
 
setIntUniform(lower_bound, upper_bound)
Sets this generator to produce a random value between the given lower and upper bounds (inclusive).
 
setIntPoisson(value)
Generate a Poisson-distributed number.
 
setFloatConst(value)
Always generate the given value.
 
setFloatUniform(lower_bound, upper_bound)
Generates a random float between lower_bound and upper_bound with a uniform distribution.
 
setFloatNormal(mean, standard_deviation)
Generates a random float from the given normal distribution.
 
setFloatNegativeExponential(half_life)
Generate negative-exponentially distributed numbers.
integer
getExecutePriority()
Gets the execution priority of this logic brick. (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
KX_GameObject
getOwner()
Gets the game object associated with this logic brick. (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
 
setExecutePriority(priority)
Sets the priority of this logic brick. (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
Instance Variables
integer, read-only distribution
distribution type: 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
int executePriority
This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first). (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
KX_GameObject or None in exceptional cases. owner
The game object this logic brick is attached to (read only). (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
float, read-only para1
the first parameter of the active distribution.
float, read-only para2
the second parameter of the active distribution.
string property
the name of the property to set with the random value.
integer seed
Seed of the random number generator.
Method Details

setSeed(seed)

 

DEPRECATED: use the seed property 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 (integer)

getPara1()

 

DEPRECATED: use the para1 property 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()

 

DEPRECATED: use the para2 property Returns the second parameter of the active distribution.

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

Returns: float

getDistribution()

 

DEPRECATED: use the distribution property Returns the type of random distribution.

Returns: distribution type
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

setProperty(property)

 

DEPRECATED: use the property 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 (string) - The name of the property to set.

setBoolConst(value)

 

Sets this generator to produce a constant boolean value.

Parameters:
  • value (boolean) - The value to return.

setBoolUniform()

 

Sets this generator to produce a uniform boolean distribution.

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

setBoolBernouilli(value)

 

Sets this generator to produce a Bernouilli distribution.

Parameters:
  • value (float) - Specifies the proportion of False values to produce.
    • 0.0: Always generate True
    • 1.0: Always generate False

setIntConst(value)

 

Sets this generator to always produce the given value.

Parameters:
  • value (integer) - the value this generator produces.

setIntUniform(lower_bound, upper_bound)

 

Sets this generator to produce a random value between the given lower and upper bounds (inclusive).

Parameters:
  • lower_bound (integer)
  • upper_bound (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 (float)

setFloatConst(value)

 

Always generate the given value.

Parameters:
  • value (float)

setFloatUniform(lower_bound, upper_bound)

 

Generates a random float between lower_bound and upper_bound with a uniform distribution.

Parameters:
  • lower_bound (float)
  • upper_bound (float)

setFloatNormal(mean, standard_deviation)

 

Generates a random float from the given normal distribution.

Parameters:
  • mean (float) - The mean (average) value of the generated numbers
  • standard_deviation (float) - The standard deviation of the generated numbers.

setFloatNegativeExponential(half_life)

 

Generate negative-exponentially distributed numbers.

The half-life 'time' is characterized by half_life.

Parameters:
  • half_life (float)

Instance Variable Details

para1

the first parameter of the active distribution. Refer to the documentation of the generator types for the meaning of this value.
Type:
float, read-only

para2

the second parameter of the active distribution. Refer to the documentation of the generator types for the meaning of this value.
Type:
float, read-only

property

the name of the property to set with the random value. If the generator and property types do not match, the assignment is ignored.
Type:
string

seed

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.
Type:
integer