skip to main content
Rulebased Simulation
Rule Agenda Order
An enhancement has been made to the Ruleset Editor to allow the user to specify whether the rule agenda will execute in ascending or descending priority order. This functionality was added to allow the user to decide which rule execution order is most appropriate. The user must select whether to execute the rules in the descending rule priority, 1, 2, 3, ..., or in ascending rule priority, ..., 3, 2, 1. (Remember rule 1 has a higher priority than rule 3) Rulesets, by default, will execute 1, 2, 3, ... and existing models are not affected. From the main Ruleset Editor dialog, select the triangle in the lower left corner to expand the window and access this option.
Rules Formatting and Printing
Functionality has been added to allow the user to format and print the rules. The user can configure line breaking and indenting in the Ruleset Layout Editor (accessed by selecting Ruleset->Ruleset Layout from the main Ruleset Editor). This is useful to prevent long, single line rules that do not fit on the screen. The user specifies the line breaking and indenting both before and after a rule statement or variable (e.g., IF, DO, +, <expr>). The ruleset, group, or a single rule can be printed to either the printer or a postscript file by selecting File->Print Ruleset from the Ruleset Editor dialog. The user can select the font, orientation, and whether various descriptors are printed. The user preferences, layout and printer settings, can be imported/exported to an ASCII file. This is useful if a user has a desired ruleset layout and would like to configure different rulesets and models to look the same.
New Palette Functions
WeightedSum
A new palette function called WeightedSum is available on the Rule Palette. The function calculates the normalized weighted sum of a list of numbers. The function takes two arguments, a list of values to be summed and a list of the weights of the values. It calculates the weighted sum as:
    
See the Rulebased Simulation Documentation online for more information.
Hypothetical Target Simulation (HypTargetSim)
A new palette function called HypTargetSim is available on the Rule Palette. This function finds a value which, when set on a given slot, will lead to a desired value on another slot. Given a control slot and a target slot, target date/time, and target value, the HypTargetSim function uses hypothetical simulation (see description of the predefined function HypSim) to find a value x such that if the control slot were set to x at all timesteps in the range [current date, target date], then the target slot’s value would equal the target value. The return type of this function is a NUMERIC with the value x. Details on the use of this function and the syntax involved are available in the Rulebased Simulation documentation online.
Hypothetical Target Simulation With Status (HypTargetSimWithStatus)
A new palette function called HypTargetSimWithStatus is available on the Rule Palette. This function finds a value which, when set on a given slot, will lead to a desired value on another slot. If a value satisfying this criterion is not found, then an attempt is made to find a value that comes close to doing so. Given a control slot and a target slot, target date/time, and target value, the HypTargetSimWithStatus function uses hypothetical simulation (see description of the predefined function HypSim) to find a value x such that if the control slot were set to x at all timesteps in the range [current date, target date], then the target slot’s value would equal the target value. A two-item list is returned. The first item in the list is a boolean TRUE value if a satisfying control slot value was found, FALSE otherwise. If the first item is TRUE, then the second item is the satisfying control slot value, otherwise this value is as close as the function could get to finding such a value.
Note: this function is very similar to HypTargetSim: this only difference is that HypTargetSim fails if it can not find a satisfying control slot value, whereas this function does not fail, rather it still returns a value, along with the indication that this value does not achieve the target.
Details on the use of this function and the syntax involved are available in the Rulebased Simulation documentation online.
Revised: 07/03/2024