Next: , Previous: , Up: Statistics Storage   [Contents][Index]


3.2 Structures for Accessing Storage

The following structure holds a condition for an action choice state.

Structure: qsmm_state_s

This structure is used for storing a condition for an action choice state. It contains the following fields.

Field: int nsig_pos

This field contains information on the number of types of cycles that start at this action choice state and have positive profile probabilities assigned. The meanings of various values of this field are given below.

0

The action choice state does not have a probability profile specified.

i>1

The number of types of cycles that start at this action choice state and have positive profile probabilities assigned. Is used to determine whether to utilize ordinary vectors or sparse vectors to store relative probabilities of output signals choice.

i<0

Only one cycle type has a positive profile probability assigned, and -i-1 is equal to an output signal, which is only allowed by the probability profile.

1

Disallowed and causes undefined behavior.

Field: long tmd0

A non-negative value of this field indicates discrete time of emitting an output signal, which corresponds to the last cycle started at this action choice state, recorded just before emitting the output signal. A negative value indicates that there were no cycles started at this action choice state yet.

Field: double tmc0

A non-negative value of this field indicates continuous time that corresponds to the value of field tmd0. A negative value indicates that there were no cycles started at this action choice state yet.

Field: double nsig_ctrl

The actual number of output signals, which corresponds to a probability profile for the action choice state. See Other Parameters of an Actor, for the explanation of the concept of the actual number of output signals for an action choice state.

Field: qsmm_sig_t sig_cycle_next

An output signal that indicates the direction of the last cycle started at this action choice state. If there are no cycles started at this action choice state yet, then the value of this field will be QSMM_SIG_INVALID.

To an action choice state there corresponds an array of instances of a structure, which holds an initial value of the spur recorded when the last cycle was started at the action choice state. The number of elements in the array is equal to the number of spur types supported by storage.

The structure contains only one field, but is designed as a structure to simplify adding to an action choice state for research purposes other information associated with a spur type. When storage prepares an instance of this structure for the first use, it initializes the instance with zeroes by the function memset, so fields you may have added initially will have zero values.

The structure is described below.

Structure: qsmm_sspur_s

This structure holds a condition associated with a spur type for an action choice state. The structure contains the following field.

Field: double val0

A value of the spur recorded when the last cycle was started at the action choice state, i.e. at the latest time when an output signal was emitted in this action choice state.

The following structure holds statistics for a cycle type.

Structure: qsmm_cycle_s

This structure holds statistics for a cycle type, i.e. a pair that consists of an action choice state and an output signal, which could be emitted in that action choice state. The structure contains the following fields.

Field: long fq

The number of cycles, which belong to this cycle type, registered in the event history so far.

Field: long period_sum_d

The total length of cycles, which belong to this cycle type, registered in the event history so far, measured in discrete time.

Field: double period_sum_c

The total length of cycles, which belong to this cycle type, registered in the event history so far, measured in continuous time.

Field: double profile

A profile probability—weight, by which a relative probability of output signal choice is multiplied. Is used when the field nsig_pos of an instance of structure qsmm_state_s, which holds a condition for corresponding action choice state, contains a non-zero value. If is used, then the sum of profile probabilities for all cycle types for the action choice state must be equal to 1.

To a cycle type there corresponds an array of instances of a structure, which holds the sum of spur increments over cycles of that type. The number of elements in the array is equal to the number of spur types supported by storage.

The structure contains only one field, but is designed as a structure to simplify adding to a cycle type for research purposes other information associated with a spur type. When storage prepares an instance of this structure for the first use, it initializes the instance with zeroes by the function memset, so fields you may have added initially will have zero values.

The structure is described below.

Structure: qsmm_cspur_s

This structure holds statistics associated with a spur type for a cycle type. The structure contains the following field.

Field: double delta_sum

The sum of spur increments over cycles of this type occurred in the event history so far. Each spur increment is the difference between the value of the spur at the time of cycle end and the value of the spur at the time of cycle start stored in the field val0 of structure qsmm_sspur_s.

To a cycle type an action choice state and an output signal correspond. The time of cycle start is the time when in the event history there did occur that action choice state, in which that output signal was emitted. The time of cycle end is the time when the action choice state did occur again in the event history.


Next: , Previous: , Up: Statistics Storage   [Contents][Index]