Don't take unnecessary risks! Keep your DPL Support plan current.

Find out more about DPL software's history -- one that spans over 20 years

Meet the folks behind the DPL Software

Discover opportunities at Syncopation Software

DPL 9 Help

Default ... Case Notation (DPL Code)

Default ... Case Notation (DPL Code)

DPL provides another way to specify the probabilities for a chance event that depends on other events. This approach can simplify the task of specifying the probabilities when the conditioning events have many combinations of states.

Errors in associating probabilities with conditioning event states are easy to make and cannot be detected by the compiler. This method of specification can help reduce errors when there are many probability distributions because you are explicitly identifying the distribution being initialized.

For example, rather than specifying each probability distribution individually:

The keyword default specifies a set of probabilities for all combinations of conditioning event states. The keyword case substitutes another set of probabilities for certain combinations of conditioning event states. You indicate which combinations are affected immediately following the keyword.

If there are multiple conditioning events, you can use logical OR (||) and logical AND (&&) to specify combinations of events for the cases. For example, the following definition for the chance event called Research_Cost is equivalent to the ones above.

In the example above, the default clause sets the outcome probabilities to 0.2, 0.4, and 0.4 for all conditioning event states. The first case clause changes the outcome probabilities to 0.4, 0.3, and 0.3 when the state of Research_Funding is Low or Medium and the state of Research_Time is Short or Medium. Each succeeding case clause overrides some of the previous assignments. Usually you should start with case clauses that reference many combinations of conditioning event states and end with case clauses that only refer to a few.

As with the probability distributions in chance event definitions, you can save time and effort in a value definition by defining one value as the default for the value and identifying particular cases for other definitions.

The default clause refers to the value BaseYearGNP, whereas the first case clause refers to the chance event. DPL can tell them apart by the context in which the name appears. The number represented by GNP depends on the events TaxRate and MoneySupply both directly and indirectly. The states of these events determine the expression used to evaluate GNP. They also determine the value called Inflation_Factor, which appears as a term in expressions for GNP.