Language Reference 2: Difference between revisions
| Line 15: | Line 15: | ||
SEE ALSO: | SEE ALSO: | ||
Example 1://Note this example is out of context. //See [[LSStats#identifyPatches.lse | Example 1://Note this example is out of context. //See [[LSStats#identifyPatches.lse|identifyPatches.lse]] for the working example. | ||
IF (isPatchEvent) | IF (isPatchEvent) | ||
Area[PatchLayer] = Area[PatchLayer] + 1 | Area[PatchLayer] = Area[PatchLayer] + 1 | ||
Revision as of 19:39, 15 November 2006
IF Expr
Procedural IF statement to process the first set … of sub-expressions denoted by “…”if the
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1://Note this example is out of context. //See identifyPatches.lse for the working example.
IF (isPatchEvent) Area[PatchLayer] = Area[PatchLayer] + 1 IF (PatchId EQ 0) // not visited... pId = pId + 1 NumPatches[PatchLayer] = NumPatches[PatchLayer] + 1 ENDFN
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
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 DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
INSERT
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: Model Builder's Guide Chapter 9#Set Functions
INSERT HEAD
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: Model Builder's Guide Chapter 9#List Functions
INSERT TAIL
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: Model Builder's Guide Chapter 9#List Functions
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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
(X): ( Number+) same as above, except the classes are implicitly 0, …. k-1 Model Builder's Guide Chapter 9#Classified and Discrete Functions
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
(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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
(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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
(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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
(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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
IS EMPTY
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: Model Builder's Guide Chapter 9#General Set, List and Graph Functions
IS EMPTY LINKS
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: Model Builder's Guide Chapter 9#Graph Functions
LINKED
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
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#Continuous Functions (Arithmetic Functions)
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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
(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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
(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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
(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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
(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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
MAX
maximum of the sub-expressions
Model Builder's Guide Chapter 9#Composite Functions
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
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)
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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
MIN
minimum of the sub-expressions
Model Builder's Guide Chapter 9#Composite Functions
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: Model Builder's Guide Chapter 9#Probability Distributions
NEXT
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: Model Builder's Guide Chapter 9#General Set, List and Graph Functions
NEXT LINK
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: Model Builder's Guide Chapter 9#Graph Functions
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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
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
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
NORMAL TEMPORAL PDF
(Expr, Expr, Expr) temporal normal probability density function Model Builder's Guide Chapter 9#Probability Density and Cumulative Density Functions
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>
NOT EQUAL
FALSE (0) if the sub-expressions all evaluate to the same value and TRUE (1) otherwise
Model Builder's Guide Chapter 9#Composite Functions
DESCRIPTION:
USAGE:
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
Example 2:
SAMPLE MODELS: <links to sample models where this function is used>