The most time-consuming operation frequently performed by an actor is stochastic emitting an optimal output signal. The only actor type that was implemented in QSMM before version 1.15 is small actor. A small actor performs the operation of stochastic emitting an optimal output signal in the following steps:
From the standpoint of computer implementation, the most time-consuming is the first step when the actor calculates relative probabilities of all possible output signals. For example, to choose an optimal output signal from a set of 16 output signals, the small actor has to perform 16 evaluations of a relative probability function. This situation is illustrated in Figure 2.2.
The time necessary to complete sequential execution of this calculation process is the sum of time periods necessary for calculating the value of a relative probability function for every output signal. While calculating the value of a relative probability function can be time-expensive on account of performing many arithmetic operations, access to statistics storage required for fetching their input values adds significant time overhead to the calculation process.
To speed up emitting output signals by an actor, in QSMM version 1.15, the concept of large actor had been introduced. The number of relative probability function evaluations performed by a large actor is not equal to the number of its output signals but is equal to the product of the logarithm of that number and the logarithm base. Large actors provide fast stochastic selection of an output signal when the number of output signals is large or even huge. The only limitation is the amount of available memory for storing control structures of the large actor.
Efficiency in solving a problem by a large actor (as well as by small one) depends on a relative probability function used, i.e. on a function that returns the relative probability of signal emitting. The default function used by a large actor can provide moderate efficiency in solving certain kinds of problems, e.g. the identification of current environment state. Those developers, who are unsatisfied with results produced using that function, can supply a custom function via corresponding API calls.
A large actor supports fast stochastic choice of output signals by using a tree that contains nodes controlled by a small actor. With every tree node, the following entities are associated:
Tree structure is illustrated in Figure 2.3, where indexed letters “s” represent intermediate action choice states, and indexed letters “o” represent intermediate output signals.
A large actor performs the operation of stochastic emitting an optimal output signal by the following algorithm:
Thus, using a tree, represented in Figure 2.3, choosing an optimal output signal from a set of 16 output signals requires only 8 evaluations of a function that yields the relative probability of signal emitting. A taller binary tree would provide the selection of an optimal output signal from a set of 256 output signals using 16 evaluations of the function.
The structure of the tree affects the weights (or, in other words, the relative profile probabilities) of output signals of a large actor and the speed of emitting those signals by the large actor. Large actors use n-ary Huffman trees to stochastically generate optimal output signals. Using a Huffman tree built for a given list of output signal weights, emitting output signals having greater weights requires the same or smaller number of relative probability function evaluations compared with emitting output signals having lesser weights.
Although having much the same API, small and large actors are not fully interchangeable. There are specifics of using actors of every type.