An actor normally uses a random number generator to select a signal from a set of possible signals according to their specific relative probabilities.
qsmm_get_actor_sig_action performs such selection.
The actor does not use the random number generator only when there is just one signal with a positive relative probability.
In this case, the actor simply selects that signal.
For a small actor, the function
qsmm_get_actor_sig_action selects an output signal of the small actor based on relative probabilities of output signals previously calculated by the function
When selecting an output signal of a large actor, the function
qsmm_get_actor_sig_action indirectly calls itself a number of times for a small actor associated with the large actor.
As a consequence of this, the large actor traverses the Huffman tree of the current action choice state and selects an output signal that corresponds to one of its leaves.
A random number generator used by an actor, either supplied when creating the actor or, if not supplied, an instance of a default random number generator allocated automatically, can be obtained using the following function.
This function returns the handle of a random number generator used by an actor when generating output signals.
Argument actor specifies the handle of the actor.
The function never returns
The handle of a random number generator returned is typically used to seed the generator after creating the actor. For information on how to seed a random number generator and perform other operations on it, see Random Number Generators.
A useful approach to determine the amount of contribution of the optimization mechanism provided by an actor to overall operating optimality of an intelligent system is comparing a measure of optimality of normal system operation with a measure of optimality calculated for almost completely random behavior of the actor. The greater the difference is between those values the more optimization is provided by the actor thus increasing overall operating optimality of the intelligent system.
Use the following functions to query the current mode of behavior of an actor and to switch the actor to nonoptimal or normal behavior mode.
This function returns a positive value if an actor is currently in nonoptimal behavior mode or zero value if the actor is in optimal (normal) behavior mode. Argument actor specifies the handle of this actor. The function never returns negative values.
This function switches the current mode of behavior of an actor specified by handle actor to nonoptimal or optimal (normal) mode. If flag is non-zero, then the current mode will be switched to nonoptimal mode. If flag is zero, then the current mode will be switched to optimal mode.
For a small actor, nonoptimal and optimal behavior modes affect how the function
qsmm_actor_calc_action_prob calculates probabilities of type
In the nonoptimal mode, the function
qsmm_actor_calc_action_prob called for a small actor does not calculate relative probabilities of output signals in the normal way but uses output signal weights as their values.
When the type of probabilities to calculate is
QSMM_PROB_AGGR, that function additionally applies a probability profile to those weights if the probability profile exists in actor’s statistics storage for the current action choice state.
Finally, the function normalizes the resulting values.
For a large actor, nonoptimal and optimal behavior modes are actually the behavior modes of a small actor associated with the large actor.
qsmm_actor_create initializes the current mode of behavior of a newly created actor to optimal (normal) mode.