Module GameTypes :: Class SCA_RandomActuator
[hide private]
[frames] | no frames]

Class SCA_RandomActuator

source code

PyObjectPlus --+            
               |            
          CValue --+        
                   |        
     SCA_ILogicBrick --+    
                       |    
           SCA_IActuator --+
                           |
                          SCA_RandomActuator

Random Actuator

Properties:

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

setBoolConst(value)

source code 
Sets this generator to produce a constant boolean value.
Parameters:
  • value (boolean) - The value to return.

setBoolUniform()

source code 

Sets this generator to produce a uniform boolean distribution.

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

setBoolBernouilli(value)

source code 
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)

source code 
Sets this generator to always produce the given value.
Parameters:
  • value (integer) - the value this generator produces.

setIntUniform(lower_bound, upper_bound)

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

setIntPoisson(value)

source code 

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.

setFloatConst(value)

source code 
Always generate the given value.

setFloatUniform(lower_bound, upper_bound)

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

setFloatNormal(mean, standard_deviation)

source code 
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)

source code 

Generate negative-exponentially distributed numbers.

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

setSeed(seed)

source code 

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.

Deprecated: Use the seed attribute instead.

getSeed()

source code 
Returns the initial seed of the generator.
Returns: integer

Deprecated: Use the seed attribute instead.

getPara1()

source code 

Returns the first parameter of the active distribution.

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

Deprecated: Use the para1 attribute instead.

getPara2()

source code 

Returns the second parameter of the active distribution.

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

Deprecated: Use the para2 attribute instead.

getDistribution()

source code 
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

Deprecated: Use the distribution attribute instead.

setProperty(property)

source code 

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.

Deprecated: Use the propName attribute instead.

getProperty()

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

Deprecated: Use the propName attribute instead.


Instance Variable Details [hide private]

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

propName

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