A model node has the following basic parameters:
qsmm_node_create_v2 creates a node with a specified identifier or finds an unused identifier for a node to create.
The macro QSMM_NODE_CREATE creates a node with a specified identifier.
See Creating Nodes.
qsmm_set_nstate_max called for a node class the node belongs to specifies the default number of node states for a default (uniform) probability profile.
That number is also the maximum allowed number of node states for a default probability profile.
The function qsmm_set_node_nstate can set the number of node states for a default probability profile to a lesser value.
The number of node states for a default probability profile does not restrict the number of node states for a custom probability profile set by loading an assembler program into the node or cloning a probability profile for it in simple or deferred mode.
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.
qsmm_set_node_ptr associates a user pointer with a node.
See Associating Parameters with a Model.
qsmm_reg_var_prob or macro QSMM_REG_VAR_PROB registers 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.
qsmm_set_instr_class_weight and qsmm_set_instr_class_weight_by_name_f change the 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:
qsmm_prob_e.
See Dumping the State Transition Matrix.
qsmm_prob_e.
See Dumping the Action Emission Matrix.
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.
By default, the node has a uniform probability profile occupying all node states.
In this profile, probabilities of transitions between all node states are equal, and probabilities of emitting all instructions in all node states are equal.
A default uniform probability profile occupies the number of states less than or equal to the number of node states specified by the function qsmm_set_nstate_max for the instruction class set.
The function qsmm_set_node_nstate can set the number of states of a default uniform probabilitiy profile to a lesser value for the node.
Default uniform probability profiles do not exist for nodes in a model:
engine_desc[QSMM_ENGINE_ENV].is_determ of qsmm_desc_s structure is non-zero);
in this case, the node requires explicit specification of a probability profile;
engine_desc[QSMM_ENGINE_IEE].is_determ of qsmm_desc_s is non-zero), and the number of instruction classes in the instruction class set is not 1;
in this case, the node requires explicit specification of a probability profile;
nnode_max of qsmm_desc_s) greater than 1, a large actor representing the environment state identification engine (field engine_desc[QSMM_ENGINE_ENV].large_desc_p of qsmm_desc_s is not NULL) or the instruction emitting engine (field engine_desc[QSMM_ENGINE_IEE].large_desc_p of qsmm_desc_s is not NULL), and positive length of look-ahead signal segment (field ngram_env_la_sz of qsmm_desc_s is positive);
in this case, the function qsmm_node_call_default cannot transfer control to a node, and all model nodes are unusable;
this limitation can disappear in future QSMM versions.
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.
qsmm_node_asm loads an assembler program into the node, the assembler program specifies the initial values.
If qsmm_node_profile_clone or qsmm_set_node_profile_source sets a probability profile for the node, a source node provides the initial values.
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 the rules.
See Controlled Variables.
qsmm_node_asm loads an assembler program into the node, the assembler program specifies the names.
If qsmm_node_profile_clone or qsmm_set_node_profile_source sets a probability profile for the node, a source node provides the 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.
qsmm_node_disasm.
If qsmm_node_asm loads an assembler program with the flag QSMM_ASM_TEMPLATE, the assembler program becomes the template.
If qsmm_node_profile_clone or qsmm_set_node_profile_source specifies a probability profile for the node, a source node provides the template.
qsmm_node_asm loads an assembler program into the node, the assembler program defines output probability variables and arrays.
If qsmm_node_profile_clone or qsmm_set_node_profile_source specifies a probability profile for the node, a source node defines output probability variables and arrays.
See Output Variables.
qsmm_get_node_var_prob_out caches the calculated value of an output probability variable.
Additionally, that function and the function qsmm_get_node_array_prob_out cache probabilities of all choice alternatives that include a choice alternative for a calculated output probability variable or array element.
The function qsmm_node_var_out_forget called implicitly in certain cases or explicitly clears both caches.
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 the 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.