Next: , Previous: , Up: Multinode Model   [Contents][Index]


4.10 Setting Look-ahead Signals

Look-ahead signals are the ones, which along with an identifier of instruction class and an instruction outcome are used after instruction invocation to determine a new node state. Maybe “look-ahead” is not a correct adjective chosen to denote those signals, it only indicates that in some situations those signals can convey look-ahead information. For example, when processing a sequence of symbols from left to right, look-ahead symbols can be passed to the multinode model in the form of look-ahead signals. In other situations, those signals can be used to pass even look-back information to the model.

The length of the look-ahead signal segment of a multinode model and ranges of signals, which can be assigned to elements of that segment, are specified using the fields ngram_env_la_sz, nsig_ngram_env_la, and range_sig_env_la_p of structure qsmm_desc_s when creating the multinode model by the function qsmm_create. Those parameters can be retrieved later using the functions qsmm_get_ngram_env_la_sz and qsmm_get_nsig_ngram_env_la called for the multinode model and using the function qsmm_get_actor_range_sig called for the environment state identification engine that corresponds to the multinode model.

An important limitation imposed on a model when its look-ahead signal segment has positive length is that assembler programs cannot be loaded into nodes of such model. This limitation is also pertinent to loading default uniform probability profiles into nodes of the model using implicitly generated assembler programs when the model contains multiple nodes and the environment state identification engine and/or the instruction emitting engine are represented by large actors. When the look-ahead signal segment has positive length, such probability profiles cannot be loaded into nodes of the model, and the nodes cannot be called. Therefore, when you need to use a look-ahead signal segment of positive length for a model, one or both engines of which are represented by large actors, use a single-node model that contains only a node with identifier 0.

To get or set signals of the look-ahead signal segment at given positions, the following functions can be used.

Function: int qsmm_get_la_sig (qsmm_t model, int pos, qsmm_sig_t *sigp)

This function sets *sigp to an element of the look-ahead signal segment of multinode model at position pos. If sigp is NULL, then *sigp will not be set.

On success, the function returns a non-negative value. If pos is negative or is greater than or equal to the length of the look-ahead signal segment, then negative error code QSMM_ERR_INVAL will be returned.

Function: int qsmm_set_la_sig (qsmm_t model, int pos, qsmm_sig_t sig)

This function sets an element of the look-ahead signal segment of multinode model at position pos to sig.

On success, the function returns a non-negative value. If pos is negative or is greater than or equal to the length of the look-ahead signal segment, or sig does not fall into a range of allowed signal identifiers at position pos of the look-ahead signal segment, then negative error code QSMM_ERR_INVAL will be returned.

The functions qsmm_get_la_sig and qsmm_set_la_sig can be called at any point after creating a multinode model. For example, they can be called when processing event QSMM_EVT_NODE_ENTER by the event handler function of instruction class set or when processing event QSMM_EVT_ACTIVATE by the event handler function of instruction meta-class.

If the field range_sig_env_la_p of structure qsmm_desc_s has the NULL value, then the function qsmm_create will initialize elements of the look-ahead signal segment to 0. If that field has a non-zero value, then the function qsmm_create will initialize elements of the look-ahead signal segment to values of field first of corresponding elements of array range_sig_env_la_p.


Next: , Previous: , Up: Multinode Model   [Contents][Index]