ifference between revisions of "EMK:Formulae and Functions"
(Created page with "{{#hidens:}} Formula can be entered as substitutes for specific values into most fields in EMarket3 to control the derivation of variable values at run time. A formula can con...") |
|||
Line 1: | Line 1: | ||
{{#hidens:}} | {{#hidens:}} | ||
− | + | Formulae can be entered as substitutes for specific values into most fields in EMarket to control the derivation of variable values at run time. A formula can contain any combination of: | |
*Constants | *Constants | ||
*Variables | *Variables | ||
*Operators | *Operators | ||
*[[EMK:Entity.Traits | Entities and Traits]] | *[[EMK:Entity.Traits | Entities and Traits]] | ||
− | *Functions | + | *'''''Functions''''' |
+ | |||
+ | '''Constants''' | ||
+ | |||
+ | Constants can be: | ||
+ | *''Numbers:'' Integers or Reals (e.g. 1, 2.5, -3), they can also be entered in scientific notation e.g. '3E+10'. | ||
+ | *''Strings:'' Written inside double quotes e.g. "A Node" | ||
+ | *''Dates:'' Must be enclosed in single quotes e.g '1/3/2004' or '14 April 2005' | ||
+ | |||
+ | '''Warning:''' The format for entering dates should compatible with the computer's local date (locality) setting | ||
+ | |||
+ | '''Variables''' | ||
+ | |||
+ | Variables can be regarded as user-defined Entity.Traits which can be defined in the '''''Volatility Matrix''''' or the '''''Schedule.''''' Previously defined variables can be used in formulae. | ||
+ | |||
+ | Note: EMarket provides a 'system' variable the user need not define: 'DateTime' which is of type 'Date' and gives the current simulation date as the model runs. | ||
+ | |||
+ | '''Operators''' | ||
+ | |||
+ | Operators are all pre-defined in EMarket. Their purpose is to separate a formula into parts that are then combined to give a single value. | ||
+ | |||
+ | The following operators are shown descending order of precedence. | ||
+ | [[File:Operators.jpg|500px|left]] |
Revision as of 16:20, 20 November 2012
Formulae can be entered as substitutes for specific values into most fields in EMarket to control the derivation of variable values at run time. A formula can contain any combination of:
- Constants
- Variables
- Operators
- Entities and Traits
- Functions
Constants
Constants can be:
- Numbers: Integers or Reals (e.g. 1, 2.5, -3), they can also be entered in scientific notation e.g. '3E+10'.
- Strings: Written inside double quotes e.g. "A Node"
- Dates: Must be enclosed in single quotes e.g '1/3/2004' or '14 April 2005'
Warning: The format for entering dates should compatible with the computer's local date (locality) setting
Variables
Variables can be regarded as user-defined Entity.Traits which can be defined in the Volatility Matrix or the Schedule. Previously defined variables can be used in formulae.
Note: EMarket provides a 'system' variable the user need not define: 'DateTime' which is of type 'Date' and gives the current simulation date as the model runs.
Operators
Operators are all pre-defined in EMarket. Their purpose is to separate a formula into parts that are then combined to give a single value.
The following operators are shown descending order of precedence.