Module SCA_RandomActuator
|
|
1
2
3 from SCA_IActuator import *
4
6 """
7 Random Actuator
8 """
10 """
11 Sets the seed of the random number generator.
12
13 Equal seeds produce equal series. If the seed is 0,
14 the generator will produce the same value on every call.
15
16 @type seed: integer
17 """
19 """
20 Returns the initial seed of the generator.
21
22 @rtype: integer
23 """
25 """
26 Returns the first parameter of the active distribution.
27
28 Refer to the documentation of the generator types for the meaning
29 of this value.
30
31 @rtype: float
32 """
34 """
35 Returns the second parameter of the active distribution.
36
37 Refer to the documentation of the generator types for the meaning
38 of this value.
39
40 @rtype: float
41 """
43 """
44 Returns the type of random distribution.
45
46 @rtype: distribution type
47 @return: KX_RANDOMACT_BOOL_CONST, KX_RANDOMACT_BOOL_UNIFORM, KX_RANDOMACT_BOOL_BERNOUILLI,
48 KX_RANDOMACT_INT_CONST, KX_RANDOMACT_INT_UNIFORM, KX_RANDOMACT_INT_POISSON,
49 KX_RANDOMACT_FLOAT_CONST, KX_RANDOMACT_FLOAT_UNIFORM, KX_RANDOMACT_FLOAT_NORMAL,
50 KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL
51 """
53 """
54 Set the property to which the random value is assigned.
55
56 If the generator and property types do not match, the assignment is ignored.
57
58 @type property: string
59 @param property: The name of the property to set.
60 """
62 """
63 Returns the name of the property to set.
64
65 @rtype: string
66 """
68 """
69 Sets this generator to produce a constant boolean value.
70
71 @param value: The value to return.
72 @type value: boolean
73 """
81 """
82 Sets this generator to produce a Bernouilli distribution.
83
84 @param value: Specifies the proportion of False values to produce.
85 - 0.0: Always generate True
86 - 1.0: Always generate False
87 @type value: float
88 """
90 """
91 Sets this generator to always produce the given value.
92
93 @param value: the value this generator produces.
94 @type value: integer
95 """
105 """
106 Generate a Poisson-distributed number.
107
108 This performs a series of Bernouilli tests with parameter value.
109 It returns the number of tries needed to achieve succes.
110
111 @type value: float
112 """
114 """
115 Always generate the given value.
116
117 @type value: float
118 """
128 """
129 Generates a random float from the given normal distribution.
130
131 @type mean: float
132 @param mean: The mean (average) value of the generated numbers
133 @type standard_deviation: float
134 @param standard_deviation: The standard deviation of the generated numbers.
135 """
137 """
138 Generate negative-exponentially distributed numbers.
139
140 The half-life 'time' is characterized by half_life.
141
142 @type half_life: float
143 """
144