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


4.2.4 Node Parameters

A model node has the following basic parameters:

  1. Node identifier (index) in the scope of a multinode model. The function qsmm_node_create_v2 and the macro QSMM_NODE_CREATE create a node with a specified identifier. The function qsmm_node_create_v2 can find an unused identifier for a new node. See Creating Nodes.
  2. The number of states. The function qsmm_set_nstate_max called for a node class the node belongs to specifies the default number of node states. That number is also the maximum allowed number of node states. The function qsmm_set_node_nstate can set the number of node states to a lesser value.
  3. An instruction class set specifying a node class for the node. The function qsmm_node_create_v2 has an argument for the name of an instruction class set. The macro QSMM_NODE_CREATE uses ‘__FUNCTION__’ as the name of an instruction class set.
  4. User parameters specified by pointers. The function qsmm_set_node_ptr associates a user pointer with a node. See Associating Parameters with a Model.
  5. A list of controlled probability variables taken from an instruction class set. The function qsmm_reg_var_prob and the macro QSMM_REG_VAR_PROB register a controlled probability variable for the instruction class set. Every list element includes the name of a controlled probability variable, its index, and a probability value. The function qsmm_set_node_var_prob sets the probability value for the node. The initial probability value is 0. See Controlled Variables.
  6. The weights of all instruction classes of an instruction class set. The functions qsmm_set_instr_class_weight, qsmm_set_instr_class_weight_by_name_f, and qsmm_set_instr_meta_class_weight change those weights for the node. By default, all weights are equal to 1. See Setting Instruction Classes Weights.

The existence of model nodes is unrelated to the existence of model instance (see Creating the Model Instance). However, when the model instance exists, the node has extended parameters:

  1. The state transition matrix along with collected statistics for refilling the matrix and keeping it up-to-date maintained by the environment state identification engine. The identifiers of rows of that matrix are quadruples consisting of a previous node state, the index of instruction class of last instruction invoked by the node, the outcome of this instruction, and the content of look-ahead signal segment. The identifiers of columns of that matrix are the indices of next node states. The cells of that matrix hold state transition probabilities with types declared by the enumeration qsmm_prob_e. See Dumping the State Transition Matrix.
  2. The action emission matrix along with collected statistics for refilling the matrix and keeping it up-to-date maintained by the instruction emitting engine. The identifiers of rows of that matrix are the indices of node states. The identifiers of columns of that matrix are the indices of instruction classes. The cells of that matrix hold instruction emission probabilities with types declared by the enumeration qsmm_prob_e. See Dumping the Action Emission Matrix.
  3. A node probability profile written to the state transition matrix and action emission matrix by the function qsmm_node_asm or qsmm_node_profile_clone or copied from the state transition matrix and action emission matrix of another node in deferred mode by the function qsmm_set_node_profile_source. The probability profile occupies the number of states less than or equal to the number of node states specified using the functions qsmm_set_nstate_max and qsmm_set_node_nstate.

    By default, the node has an unset probability profile. The unset probability profile is an implicit uniform probability profile occupying all node states. In this uniform probability profile, the probabilities of transitions between all node states are equal, and the probabilities of emitting all instructions in all node states are equal. The implicit uniform probability profile does not exist for a model:

  4. An indication that the node is the source of a probability profile for other nodes or is a user of a probability profile provided by another node. The function qsmm_set_node_profile_source sets this mode. In this mode, some operations on the node result in reporting QSMM_ERR_PROFSRCP or QSMM_ERR_PROFSRCU respectively. See Memory Efficient Cloning the Probability Profile.
  5. The initial values of controlled probability variables. If the function qsmm_node_asm loads an assembler program into the node, the assembler program specifies those initial values. If the function qsmm_node_profile_clone or qsmm_set_node_profile_source specifies a probability profile for the node, a source node provides those initial values.
  6. Rules for recomputing profile probabilities in cells of the state transition matrix and action emission matrix on changing the values of controlled probability variables. Every element of the list of controlled probability variables additionally contains an indication whether the value of a controlled probability variable set by the function qsmm_set_node_var_prob needs committing to the state transition matrix or action emission matrix by the function qsmm_node_var_realize according to those rules. See Controlled Variables.
  7. Optional names of node states corresponding to their indices. If the function qsmm_node_asm loads an assembler program into the node, the assembler program specifies those names. If the function qsmm_node_profile_clone or qsmm_set_node_profile_source specifies a probability profile for the node, a source node provides those names. The function qsmm_get_node_state_name retrieves the name of a node state by its index. The function qsmm_get_node_state_by_name retrieves the index of a node state by its name.
  8. An assembler program template for disassembling the node by the function qsmm_node_disasm. If the function qsmm_node_asm loads an assembler program with the flag QSMM_ASM_TEMPLATE, the assembler program becomes the template. If the function qsmm_node_profile_clone or qsmm_set_node_profile_source specifies a probability profile for the node, a source node provides the template.
  9. Rules for calculating the values of output probability variables and arrays. If the function qsmm_node_asm loads an assembler program into the node, the assembler program defines the output probability variables and arrays. If the function qsmm_node_profile_clone or qsmm_set_node_profile_source specifies a probability profile for the node, a source node defines the output probability variables and arrays. See Output Variables.
  10. The cache of values of output probability variables and arrays. Calculating an output probability variable by the function qsmm_get_node_var_prob_out or array elements by the function qsmm_get_node_array_prob_out results in calculating related output probability variables or array elements. The cache holds all those calculated values. The function qsmm_node_var_out_forget called explicitly or implicitly in certain cases clears the cache.
  11. The number of times the function qsmm_node_call_default called the node and the number of times that function transferred control to the node but not yet returned control from it. The functions qsmm_get_node_fq and qsmm_get_node_recurs retrieve those numbers. The initial values are 0. See Calling a Node.

The node parameters tied to the model instance and listed above take the same initial values in case of creating the model instance after creating the node and in case of creating the node after creating the model instance.

The function qsmm_node_unload (see Unloading the Probability Profile) called for a node causes unsetting all node parameters tied to the model instance except for the parameters retrieved by the functions qsmm_get_node_fq and qsmm_get_node_recurs. The unset parameters take their initial values they have just after creating the model instance.


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