Language Reference 2: Difference between revisions
No edit summary |
|||
| Line 13: | Line 13: | ||
(Expr ? Expr : Expr) Same as above, but this form can be used as an | (Expr ? Expr : Expr) Same as above, but this form can be used as an | ||
embedded sub-expression.[[Model Builder's Guide Chapter 9#Control Expressions]] | embedded sub-expression.[[Model Builder's Guide Chapter 9#Control Expressions]] | ||
==INSERT== | |||
==INSERT HEAD== | |||
==INSERT TAIL== | |||
==INTERPOLATE==(X) return an interpolated value where the value of | ==INTERPOLATE==(X) return an interpolated value where the value of | ||
CLASS Number: Number variable X is placed between two classes or at | CLASS Number: Number variable X is placed between two classes or at | ||
| Line 50: | Line 52: | ||
==IS EMPTY== | |||
==IS EMPTY LINKS== | |||
==LINKED== | |||
| Line 236: | Line 240: | ||
mean | mean | ||
POISSION(Expr) draw a value from a Poisson distribution | POISSION(Expr) draw a value from a Poisson distribution | ||
==NEXT== | |||
==NEXT LINK== | |||
==NORMAL== | ==NORMAL== | ||
Revision as of 19:22, 18 October 2006
IF Expr
Procedural IF statement to process
… sub-expressions denoted by “…” only if the
ENDFN expression evaluates to TRUEModel Builder's Guide Chapter 9#Control Expressions
IF Expr
Procedural IF statement to process the first set … of sub-expressions denoted by “…”if the
IF Expr THEN Expr ELSE
Expr if value of the IF expression is TRUE (>= 1), then return the value of the THEN expression, otherwise return value of the ELSE expression
(Expr ? Expr : Expr) Same as above, but this form can be used as an embedded sub-expression.Model Builder's Guide Chapter 9#Control Expressions
INSERT
INSERT HEAD
INSERT TAIL
==INTERPOLATE==(X) return an interpolated value where the value of CLASS Number: Number variable X is placed between two classes or at
: either end of the table.
Model Builder's Guide Chapter 9#Classified and Discrete Functions ENDFN Model Builder's Guide Chapter 9#Classified and Discrete Functions
INTERPOLATE
(X): ( Number+) same as above, except the classes are implicitly 0, …. k-1 Model Builder's Guide Chapter 9#Classified and Discrete Functions
INTERPOLATE
(X) same as above, except the values in the CLASS Number: Expr table are obtained by evaluating expressions : Model Builder's Guide Chapter 9#Classified and Discrete Functions ENDFN Model Builder's Guide Chapter 9#Classified and Discrete Functions
==INTERPOLATE==(X) same as above, except the classes are Expr implicitly 0, …, k-1
:
Model Builder's Guide Chapter 9#Classified and Discrete Functions ENDFN Model Builder's Guide Chapter 9#Classified and Discrete Functions
==INTERPOLATE==(X): Filename uses the table in the named file, which is assumed to consist of class:value pairs Model Builder's Guide Chapter 9#Classified and Discrete Functions ==INTERPOLATE==(X): Filename Key uses the table in the named file, which is assumed to consist of class:value pairs. The key is used to specify a sub-table in a multi-table file. Model Builder's Guide Chapter 9#Classified and Discrete Functions
IS EMPTY
IS EMPTY LINKS
LINKED
LOG(Expr)
DESCRIPTION: The logarithm operator
USAGE:
x=LOG(Expr)
REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value
VALUE:
Natural logarithm of the value of the expression. This is a mathematical operation that is the inverse of exponentiation(raising a constant, the base, to a power) Ex:
- Failed to parse (syntax error): {\displaystyle \4^3=81\,\! }
In this program, it is assumed that the base is 10, ie:
Note that the natural Logarithm is the inverse of the natural exponential function, ie: (x), which is the same as In(x) for all positive x and
- Failed to parse (unknown function "\In"): {\displaystyle \In(e^x)=x \,\! }
for all real x. The only difference between Log and natural Log is their bases that Log uses 10 and natural Log uses e. For convenience,
is usually written in a different notation: In(x). SEE ALSO: Model Builder's Guide Chapter 9#Expressions:
Example 1:
x=LOG(0.773) =-0.111820506
SAMPLE MODELS: <links to sample models where this function is used>
LOG NORMAL CDF
(Expr, Expr, Expr) log normal cumulative density function, where the first expression specifies the value, the second is the mean and the third is the standard deviation Model Builder's Guide Chapter 9#Probability Density and Cumulative Density Functions
LOG NORMAL PDF
(Expr, Expr, Expr) log normal probability density function, where the first expression specifies the value, the second is the mean and the third is the standard deviation Model Builder's Guide Chapter 9#Probability Density and Cumulative Density Functions
LOG NORMAL TEMPORAL PDF
(Expr, Expr, Expr) temporal log normal probability density function Model Builder's Guide Chapter 9#Probability Density and Cumulative Density Functions
LOOKUP
(X): ( Number+) same as above, except the classes are implicitly 0, …. k-1 Model Builder's Guide Chapter 9#Classified and Discrete Functions
LOOKUP
(X) same as above, except the values in the CLASS Number: Expr table are obtained by evaluating expressions : Model Builder's Guide Chapter 9#Classified and Discrete Functions ENDFN Model Builder's Guide Chapter 9#Classified and Discrete Functions
LOOKUP
(X) same as above, except the classes are Expr implicitly 0, …, k-1
:
Model Builder's Guide Chapter 9#Classified and Discrete Functions ENDFN Model Builder's Guide Chapter 9#Classified and Discrete Functions
LOOKUP
(X): Filename uses the table in the named file, which is assumed to consist of class:value pairs Model Builder's Guide Chapter 9#Classified and Discrete Functions
LOOKUP
(X): Filename Key uses the table in the named file, which is assumed to consist of class:value pairs. The key is used to specify a sub-table in a multi-table file Model Builder's Guide Chapter 9#Classified and Discrete Functions
Expr EQ Expr TRUE if the values of the two expressions are equal; otherwise FALSE Model Builder's Guide Chapter 9#Boolean Functions Expr == Expr alternate form of EQ comparison (Note: two equal signs distinguish this from an assignment)Model Builder's Guide Chapter 9#Boolean Functions
Expr NEQ Expr TRUE if the values are not equal; otherwise FALSEModel Builder's Guide Chapter 9#Boolean Functions Expr != Expr alternate form of NOT EQUAL comparisonModel Builder's Guide Chapter 9#Boolean Functions
Expr < Expr TRUE if the value of the first expression is less than the value of the second expression; otherwise FALSEModel Builder's Guide Chapter 9#Boolean Functions Expr <= Expr TRUE if the value of the first expression is less than or equal to the value of the second expression; otherwise FALSEModel Builder's Guide Chapter 9#Boolean Functions
Expr > Expr TRUE if the value of the first expression is greater than the value of the second expression; otherwise FALSEModel Builder's Guide Chapter 9#Boolean Functions Expr >= Expr TRUE if the value of the first expression is greater than or equal to the value of the second expression; otherwise FALSEModel Builder's Guide Chapter 9#Boolean Functions
!Expr Negates the expression Boolean valueModel Builder's Guide Chapter 9#Boolean Functions
Expr AND Expr TRUE if values of both expressions are TRUE and FALSE otherwiseModel Builder's Guide Chapter 9#Boolean Functions
Expr OR Expr TRUE if value of at least one expression is TRUE and FALSE otherwise
MAX POSITION
DESCRIPTION: A Bit-Vector function that returns the maximun 0-based bit position that is set to one in the expression value(interpreted as a bit-vector),or-1 if no bits are set
USAGE:
MAX POSITION(Expr)
REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value
VALUE:
?????
SEE ALSO: Model Builder's Guide Chapter 9#Bit-Vector Functions
Example 1:
MAX POSITION(12)
<figure out an end example indicator. For example, ***>
SAMPLE MODELS: <links to sample models where this function is used>
MEAN
average of the sub-expressions
Model Builder's Guide Chapter 9#Composite Functions
MAX
maximum of the sub-expressions
Model Builder's Guide Chapter 9#Composite Functions
MIN
minimum of the sub-expressions
Model Builder's Guide Chapter 9#Composite Functions
MIN POSITION
DESCRIPTION: A Bit-Vector function that returns the minimun 0-based bit position that is set to one in the expression value(interpreted as a bit-vector),or-1 if no bits are set
USAGE:
MIN POSITION(Expr)
REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value
VALUE:
?????
SEE ALSO: Model Builder's Guide Chapter 9#Bit-Vector Functions
Example 1:
MIN POSITION(12)
<figure out an end example indicator. For example, ***>
SAMPLE MODELS: <links to sample models where this function is used>
NEGEXP
(Expr) draw a value from a negative exponential distribution, where the expression specifies the mean
POISSION(Expr) draw a value from a Poisson distribution
NEXT
NEXT LINK
NORMAL
DESCRIPTION: draw a value from a normal distribution
USAGE:
x=NORMAL(Expr1,Expr2)
REQUIRED ARGUMENTS: Expr1 is the mean, and Expr2 is the variance.
VALUE: A single value sampled from a normal distribution.
NOTES: <define gaussian distribution, web refs?, etc>
SEE ALSO: Model Builder's Guide Chapter 9#Composite Functions
EXAMPLES: <add carriage return here> Example 1:
x = NORMAL(10,5)
<figure out an end example indicator. For example, ***>
SAMPLE MODELS: <links to sample models where this function is used>
NORMAL CDF
(Expr, Expr, Expr) normal cumulative density function, where the first expression is the value, the second is the mean and the third is the standard deviation Model Builder's Guide Chapter 9#Probability Density and Cumulative Density Functions
NORMAL PDF
(Expr, Expr, Expr) normal probability density function, where the first expression is the value, the second is the mean and the third is the standard deviation Model Builder's Guide Chapter 9#Probability Density and Cumulative Density Functions
NORMAL TEMPORAL PDF
(Expr, Expr, Expr) temporal normal probability density function Model Builder's Guide Chapter 9#Probability Density and Cumulative Density Functions
NOT EQUAL
FALSE (0) if the sub-expressions all evaluate to the same value and TRUE (1) otherwise