Next: Helper Relative Probability Functions, Up: Customizing the Relative Probability Function [Contents][Index]

Use the following functions to query or set the type of a relative probability function used by an actor.

- Function:
*enum qsmm_relprob_e***qsmm_get_actor_relprob_type***(qsmm_actor_t*`actor`) This function returns the type of a function used by an

`actor`to calculate the relative probability of an output signal. If the actor is the large one, the function returns the type of a function used by a small actor associated with the large actor.

- Function:
*void***qsmm_set_actor_relprob_type***(qsmm_actor_t*`actor`, enum qsmm_relprob_e`relprob_type`) This function sets to

`relprob_type`the type of a function used by an`actor`to calculate the relative probability of an output signal. If the actor is the large one,`qsmm_set_actor_relprob_type`

sets the type of a function used by a small actor associated with the large actor. The values of`relprob_type`not matching to the elements of`qsmm_relprob_e`

enumeration lead to undefined actor behavior.

Below there is a description of an enumeration specifying supported relative probability function types.

- Enumeration:
**qsmm_relprob_e** -
This enumeration specifies the supported types of a function used by an actor to calculate the relative probability of an output signal.

The descriptions of elements of this enumeration use the following notations.

*h*An action choice state.

*z*An output signal.

*n*_{e}The number of spur types.

*T*Actor temperature multiplied by some constant.

*F(h,z)*The relative probability of emitting output signal

*z*in action choice state*h*.*L*-
*Mean discrete cycle period*—mean discrete time period between every occurrence of action choice state*h*with emitting output signal*z*and a subsequent occurrence of*h*—multiplied by a value returned by the function`qsmm_get_actor_naction_per_evt`

. *n*_{out}The mean number of output signals of the actor (for more information on computing this number, see Number of Output Signals).

*W[i]*Spur weight for spur type

*i*.*C(h,z,i)*The ratio of spur increment velocities computed depending on the way of spur perception (see Spur Perception) for spur type

*i*.

The enumeration contains the following elements.

`QSMM_RELPROB_BUILTIN1`

The relative probability function has the formula

where

*κ=2L*. The paper “An Approach to Optimal Action Generation for a System that Interacts with the Environment” available from the project homepage provides more details about this formula.`QSMM_RELPROB_BUILTIN2`

The relative probability function has the formula

The author has empirically found this formula when developing QSMM 1.15 and making an actor emit output signals with frequencies proportional to output signal probabilities specified a priori. A spur increment supplied to the actor just after emitting an output signal was equal to the logarithm of its probability.

`QSMM_RELPROB_BUILTIN3`

The relative probability function has the formula

This formula is a simplification of

`QSMM_RELPROB_BUILTIN2`

and is for developers who prefer beauty and/or simplicity.`QSMM_RELPROB_USER1`

The relative probability function has the formula

where

*f(L)*is a function of`qsmm_relprob_user1_func_t`

type provided by a developer via a call to`qsmm_set_actor_relprob_helper`

(see Helper Relative Probability Functions). If the developer has not provided the function*f(L)*, that function is equal to 1 by default.`QSMM_RELPROB_USER2`

The relative probability function has the formula

where

*g*is a function of`qsmm_relprob_user2_func_t`

type provided by a developer via a call to`qsmm_set_actor_relprob_helper`

(see Helper Relative Probability Functions). The function*g*receives the value of*z*and statistics associated with*h*and*z*. These function arguments may be necessary to devise a sophisticated relative probability function.

When creating a small actor, the function `qsmm_actor_create`

initializes the type of relative probability function of this small actor to `QSMM_RELPROB_BUILTIN1`

.
When creating a large actor, the function `qsmm_actor_create`

initializes the type of relative probability function of a small actor associated with the large actor to `QSMM_RELPROB_BUILTIN2`

.