# DPL 9 Help

Defining Values (DPL Code)

# Defining Values (DPL Code)

A value is a variable that can depend on the state of events (decisions, chance events, and controlled events). You must define the events upon which a value depends (called conditioning events) before you define the value. DPL determines the number represented by a value based on the current state of its conditioning events. This means that a value can represent different numbers in different parts of a decision tree. (Defining a value does not imply that it is automatically received or paid when a decision is made or a chance event resolved. You must specify this in the sequence section.)

The following statement defines a value in DPL.

`value Base_Price = 585.30;`

The name of this value is Base_Price. Because the definition does not list any conditioning events, Base_Price represents the same number throughout the analysis.

The following statement defines a value, Inflation_Factor, that depends on two conditioning events.

```chance MoneySupply.{Lower,Constant,Higher}={.35,.55};
chance TaxRate.{Unchanged,Increased}={.1};
value Inflation_Factor given MoneySupply, TaxRate =
// TaxRate.Unchanged   Increased
1.14,               1.12,   // MoneySupply.Lower
1.11,               1.09,   // MoneySupply.Constant
1.09,               1.08;   // MoneySupply.Higher```

The order in which you list the numbers depends on the order in which you list the conditioning events. DPL uses the first number when all conditioning events are in their first state. The next number applies when the last conditioning event changes to its second state. After associating numbers with all the states of the last conditioning event, DPL varies the state of the next-to-last conditioning event and so on. This continues until a number is associated with all combinations of states.

During an analysis, whenever DPL needs to determine the number represented by Inflation_Factor, it checks the states of MoneySupply and TaxRate. If the state of either event is unknown, DPL generates an error message. Otherwise, it selects the number corresponding to the conditioning event states.

You can use expressions instead of numeric constants to specify the numbers associated with a value. For example, you could define a value called Price as follows:

```value Base_Price = 15000;
value Price = Inflation_Factor * Base_Price;```

Because the value called Inflation_Factor depends on events called MoneySupply and TaxRate, so do the numbers associated with Price. When DPL needs to evaluate Price during an analysis, it tries to evaluate Inflation_Factor. To do so, it checks the states of MoneySupply and TaxRate. Once DPL determines which number to associate with Inflation_Factor, it multiplies that number by the one associated with Base_Price. The result is the number represented by Price.

Versions: DPL Professional, DPL Enterprise, DPL Portfolio