5.11 Unloading the Probability Profile

Use the function described below to unload statistics and a probability profile from a node.

Function: int qsmm_node_unload (qsmm_t model, qsmm_sig_t node)

This function performs the following operations on a node of a multinode model:

  • if the node is a probability profile user, break off its correspondence with a node acting as a probability profile source;
  • unload statistics collected on the event history for the node;
  • unload the probability profile of the node;
  • if the node has an assembler program loaded, unload information on controlled and output probability variables defined in the assembler program;
  • if the node has an assembler program loaded, unload information about names assigned to the states of the assembler program;
  • unload an assembler program template used for disassembling;
  • destroy the cache of calculated probabilities of output probability variables and the cache of calculated probabilities of choice alternatives.

The argument node specifies the identifier of the node.

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_NOTFOUND

A node with identifier node does not exist.

QSMM_ERR_UNTIMELY

A model instance does not exist.

QSMM_ERR_PROFSRCP

The node is a probability profile source for other nodes. See Memory Efficient Cloning the Probability Profile, for more information on this mode.

QSMM_ERR_NOMEM

There was not enough memory to perform the operation.

Error QSMM_ERR_NOMEM can leave the probability profile of the node or its statistics in inconsistent state. If after removing a reason of the error a repeated call to this function succeeds, the probability profile and statistics become unloaded.