Next: Retrieving and Storing Statistics, Previous: Storage Types, Up: Statistics Storage [Contents][Index]

The following structure holds the condition of an action choice state.

- Structure:
**qsmm_state_s** This structure holds the condition of an action choice state

*h*(see Relative Probability Function Types, for formulas involving*h*). The structure contains the following fields.- Field:
*int***nsig_pos** This field contains information on the number of cycle types

*<h,x>*(i.e. starting at this action choice state*h*) with positive profile probabilities assigned, where*x*is a possible cycle direction. The meanings of various values of this field are below.- 0
The action choice state does not have a probability profile specified.

*i>1*The number

*i*of types of cycles that start at this action choice state and have positive profile probabilities assigned. At present, an actor uses that number to determine whether to utilize ordinary vectors or sparse vectors to store the relative probabilities of output signals.*i<0*Only one cycle type has a positive profile probability assigned, and

*-i-1*is equal to the identifier*x*of an output signal only allowed by the probability profile.- 1
Disallowed and causes undefined behavior.

The default value is 0.

- Field:
*long***tmd0** The discrete time of last occurrence of a cycle of

*<h,z>*type throughout event history, where the field`sig_cycle_next`

of this structure specifies*z*. If the field`tmd0`

is non-negative, and`sig_cycle_next`

is not`QSMM_SIG_INVALID`

,`tmd0`

indicates the discrete time of last emitting output signal*z*in action choice state*h*. The function`qsmm_actor_reg_sig_action`

records that discrete time before incrementing it. The default value of this field is -1.

- Field:
*double***tmc0** The continuous time of last occurrence of a cycle of

*<h,z>*type throughout event history, where the field`sig_cycle_next`

of this structure specifies*z*. That continuous time corresponds to discrete time in the field`tmd0`

of this structure. If the field`tmc0`

is non-negative, and`sig_cycle_next`

is not`QSMM_SIG_INVALID`

,`tmc0`

indicates the continuous time of last emitting output signal*z*in action choice state*h*. The function`qsmm_actor_reg_sig_action`

records that continuous time. The default value of this field is -1.

- Field:
*double***nsig_ctrl** The nominal number of output signals for the probability profile of this action choice state. See Number of Output Signals, for the explanation of the concept of the nominal number of output signals for an action choice state. If the field

`nsig_pos`

of this structure is greater than 1, the field`nsig_ctrl`

must be greater than 1 and less than or equal to`nsig_pos`

. If`nsig_pos`

is 0,`nsig_ctrl`

must be 0. If`nsig_pos`

is negative,`nsig_ctrl`

must be 1. The default value of this field is 0.

- Field:
*qsmm_sig_t***sig_cycle_next** An output signal indicating the direction of last cycle started at this action choice state. If no cycles started at this action choice state yet, then

`QSMM_SIG_INVALID`

. The default value is`QSMM_SIG_INVALID`

.

- Field:

The condition of an action choice state includes an array of instances of a structure holding the value of spur recorded by the function `qsmm_actor_reg_sig_action`

for last cycle 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 associating other information with an action choice state and a spur type for research purposes.
When storage prepares an instance of that structure for first use, it initializes the instance with zeroes by the function `memset`

, so fields you may have added will initially be zero.

The structure description is below.

- Structure:
**qsmm_sspur_s** This structure holds condition associated with an action choice state and a spur type. The structure contains the following field.

- Field:
*double***val0** The value of spur recorded for last cycle started at the action choice state, that is, at the latest time when the function

`qsmm_actor_reg_sig_action`

registered emitting an output signal in that action choice state.

- Field:

The following structure holds statistics on a cycle type.

- Structure:
**qsmm_cycle_s** This structure holds statistics on a cycle type—a pair comprised of an action choice state and a cycle direction (i.e. an output signal emittable in the action choice state). In Spur Perception, the notation

*<h,z>*is a cycle type for action choice state*h*and cycle direction*z*. The structure contains the following fields.- Field:
*long***fq** The number of cycles of

*<h,z>*type registered throughout event history.

- Field:
*long***period_sum_d** The total length of cycles of

*<h,z>*type measured in discrete time. In Spur Perception, the notation*ω*is that total length measured in discrete or continuous time.^{(h,z)}

- Field:
*double***period_sum_c** The total length of cycles of

*<h,z>*type measured in continuous time. In Spur Perception, the notation*ω*is that total length measured in discrete or continuous time.^{(h,z)}

- Field:
*double***profile** A profile probability—weight to multiply the relative probability of output signal

*z*selectable in action choice state*h*. The function`qsmm_actor_calc_action_prob`

uses this field if the field`nsig_pos`

of`qsmm_state_s`

structure holding the condition of action choice state*h*is non-zero. In this case, the sum of profile probabilities of all cycle types for action choice state*h*must be equal to 1.

- Field:

The statistics on a cycle type includes an array of instances of a structure holding the sum of spur increments over cycles of this 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 associating other information with a cycle type and a spur type for research purposes.
When storage prepares an instance of that structure for first use, it initializes the instance with zeroes by the function `memset`

, so fields you may have added will initially be zero.

The structure description is below.

- Structure:
**qsmm_cspur_s** This structure holds statistics associated with cycle type

*<h,z>*and spur type*i*. The structure contains the following field.- Field:
*double***delta_sum** The sum of increments of spur of

*i*type over cycles of*<h,z>*type throughout event history. In Spur Perception, the notation*H*is that sum. Each spur increment is the difference between a spur value at the time of cycle end and a spur value at the time of cycle start stored in the field^{(h,z)}[i]`val0`

of`qsmm_sspur_s`

structure.The time of cycle start is the time of an occurrence of action choice state

*h*with emitting output signal*z*. The time of cycle end is the time of the next occurrence of action choice state*h*in the event history.

- Field: