Next: , Up: Specifying Output Signal Weights   [Contents][Index]


2.7.1 Setting a Weight for an Output Signal

Small actors support setting the weight of an output signal for all possible action choice states at once. The functions qsmm_get_actor_sig_weight and qsmm_set_actor_sig_weight described below can inspect or modify the array of weights of output signals of a small actor. A large actor does not support setting the weight of an output signal for all possible action choice states at once and does not use that array.

The function qsmm_actor_create initializes to 1 the weights of all output signals of a newly created small actor in the array. If an output signal of a small actor has a profile probability specified for an action choice state in statistics storage, the overall weight of this output signal is the product of a corresponding weight in the array and the profile probability.

The function qsmm_actor_calc_action_prob always applies weights contained in the array to computed relative probabilities, disregarding of a requested type of probabilities to calculate. After multiplying computed relative probabilities by corresponding weights, qsmm_actor_calc_action_prob normalizes a resulting array to obtain probabilities that sum up to 1.

Function: int qsmm_get_actor_sig_weight (qsmm_actor_t actor, qsmm_sig_t sig, double *weight_p)

This function sets *weight_p to the weight of output signal sig of an actor. If weight_p is NULL, the function does not set *weight_p. Otherwise, *weight_p is a finite and non-negative number.

The function returns a non-negative value on success or a negative error code on failure. Currently, the function can return the following error codes.

QSMM_ERR_INVAL

Signal sig is not an output signal of the actor.

QSMM_ERR_NOTSUP

The actor is the large one.

Function: int qsmm_set_actor_sig_weight (qsmm_actor_t actor, qsmm_sig_t sig, double weight)

This function sets the weight of output signal sig of an actor to weight.

The function returns a non-negative value on success or a negative error code on failure. Currently, the function can return the following error codes.

QSMM_ERR_INVAL

Signal sig is not an output signal of the actor, or weight is not a finite number or is a negative number.

QSMM_ERR_NOTSUP

The actor is the large one.


Next: , Up: Specifying Output Signal Weights   [Contents][Index]