Special Keys
List of Special Keys
As noted in the discussion of the Value Dictionary, the Value Dictionary key-value pairs consist of:
- Values extracted from Raw Input data for the current element
- Values extracted from your Model Parameters for the current element and period
- Values added by JFunctions calculated at runtime
It was also noted that, in addition to the above classes of information, the Value Dictionary also contains special key-value pairs that are automatically added by the model to help you in decision making. This information includes aspects such as the current model period, the name of the next treatment (most likely a committed treatment), or the name of the current treatment (if a treatment was assigned in the current period).
This additional information can thus also be used by your JFunctions to make decisions, calculate increments or resets and so forth.
The following sections outline the special keys you need to use for your JFunctions to make use of this information.
‘elem_index’
The value mapped to this key is the zero-based row index of the current element, mapping to the same index in your input file.
‘period’
The value mapped to this key is the modelling period, with 1 being the first model period in which treatments can be applied.
‘period_calendar’
The value mapped to this key is the modelling period in calendar terms. This value is the Model Initialisation period (which you set in the Model Configuration) plus the modelling period. An example will be 2024 if the modelling period is 1 and the Model Initialisation year is 2023.
‘next_treatment_name’
The value mapped to this key is the Name of the next treatment on the element, if any. This can only be a committed treatment. If there is no next treatment, the value mapped to this key will be ‘none’.
This is a useful parameter to ensure your model does not place a treatment if there is already a committed treatment scheduled to be executed in the next few periods.
‘next_treatment_cat’
As with the value described above, the value mapped to this key is the Category of the Next Treatment (if any). If there is no next treatment, the value mapped to this key will be ‘none’.
‘next_treatment_comment’
As with the value described above, the value mapped to this key is the ‘Comment’ attribute of the Next Treatment (if any). If there is no next treatment, the value mapped to this key will be ‘none’. Note: this key only applies to Cassandra versions LATER than V-0-5-4.
‘next_treatment_reason’
As with the value described above, the value mapped to this key is the ‘Reason’ attribute of the Next Treatment (if any). If there is no next treatment, the value mapped to this key will be ‘none’. Note: this key only applies to Cassandra versions LATER than V-0-5-4.
‘next_treatment_period’
The value mapped to this key is the model period in which the next treatment is set to occur, if any. This can only be a committed treatment. If there is no next treatment, the value mapped to this key will be 999.
‘periods_to_next_treatment’
The value mapped to this key is the number of period to the next treatment, if any. This can only be a committed treatment. If there is no next treatment, the value mapped to this key will be 999.
‘next_treatment_is_committed’
The value mapped to this key is a ‘true’ or ‘false’ value indicating of the next treatment, if any, is a committed treatment. If there is no next treatment, the value mapped to this key will be ‘false’. Note: this key only applies to Cassandra versions LATER than V-0-5-4.
‘this_treatment_name’
The value mapped to this key is the Name of the treatment in the current period, if any. This can be a committed treatment or a triggered treatment. If there is no next treatment, the value mapped to this key will be ‘none’.
This key is typically needed in your JFunctions that deal with Resetting condition parameters. You can use the value mapped to this key in your JFunctions to code the logic that determines what resets will be applied for different treatments.
‘this_treatment_cat’
Same as described in the preceding paragraph, but here the value mapped to the key is the Category of the treatment.
‘this_treatment_comment’
As with the value described above, the value mapped to this key is the ‘Comment’ attribute of the Treatment (if any) in the current period. If there is no treatment, the value mapped to this key will be ‘none’. Note: this key only applies to Cassandra versions LATER than V-0-5-4.
‘this_treatment_reason’
As with the value described above, the value mapped to this key is the ‘Reason’ attribute of the Treatment (if any) in the current period. If there is no treatment, the value mapped to this key will be ‘none’. Note: this key only applies to Cassandra versions LATER than V-0-5-4.
‘this_treatment_cost’
Same as described for key ‘this_treatment_name’ but here the value mapped to the key is the Cost of the treatment.
‘this_treatment_is_committed’
The value mapped to this key is a ‘true’ or ‘false’ value indicating of the treatment in the current period, if any, is a committed treatment. If there is no treatment, the value mapped to this key will be ‘false’. Note: this key only applies to Cassandra versions LATER than V-0-5-4.