Jump to content

Language Reference 2: Difference between revisions

From SELESwiki
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:


==IF Expr==
==IF Expr==
        Procedural IF statement to process the first set
   
… of sub-expressions denoted by “…”if the
 
DESCRIPTION:
DESCRIPTION:
Procedural IF statement to process the first set
of sub-expressions denoted by “…”if the


USAGE:         
USAGE:         
Line 47: Line 46:


Example 1:   
Example 1:   
//Note this example is out of context. //See [[Spreading2#Spreading.lse|Spreading.lse]] for the working example.
distInc = IF SpreadType EQ 0 THEN 1 ELSE MAX(0,d - SOURCE d)


Example 2:   
Example 2:   
Line 66: Line 67:


Example 1:   
Example 1:   
//Note this example is out of context. //See [[LSStats#nn.lse|nn.lse]] for the working example.
INSERT(nnGraph[currType], patchVar)


Example 2:   
Example 2:   
Line 72: Line 75:
[[Model Builder's Guide Chapter 9#Set Functions]]
[[Model Builder's Guide Chapter 9#Set Functions]]


==INSERT HEAD==
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 


==INSERT HEAD==
Example 2: 
 
SAMPLE MODELS:
[[Model Builder's Guide Chapter 9#List Functions]]


==INSERT LINK==
DESCRIPTION:
DESCRIPTION:


Line 86: Line 106:


Example 1:   
Example 1:   
//Note this example is out of context. //See [[LSStats#nn.lse|nn.lse]] for the working example.
INSERT LINK(nnGraph[currType], patchPos, nPos2, edgeVar)


Example 2:   
Example 2:   
Line 105: Line 127:


Example 1:   
Example 1:   
//Note this example is out of context. //See [[LSStats#identifyPatches.lse|identifyPatches.lse]] for the working example
INSERT TAIL(patchList[currType], patchVar)


Example 2:   
Example 2:   
//Note this example is out of context. //See [[LSStats#identifyPatches.lse|identifyPatches.lse]] for the working example
INSERT TAIL(coreAreaList[PatchLayer], patchVar)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 309: Line 335:
<links to sample models where this function is used>
<links to sample models where this function is used>


==LOCATION==
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
//Note this example is out of context. //See [[Convex Hull#ConvexHull.lse|ConvexHull.lse]] for the working example.
EdgeLocation = LOCATION(EdgeRow, EdgeCol)
Example 2: 
SAMPLE MODELS:
<links to sample models where this function is used>


==LOG(Expr)==
==LOG(Expr)==
Line 618: Line 662:
==MIN==
==MIN==
minimum of the sub-expressions  
minimum of the sub-expressions  
[[Model Builder's Guide Chapter 9#Composite Functions]]


DESCRIPTION:
DESCRIPTION:
Line 631: Line 673:
SEE ALSO:  
SEE ALSO:  


Example 1:   
Example 1: //Note this example is out of context.//See [[Spreading2#Spreading.lse|Spreading.lse]] for the working example
 
  TimeSinceFire = MIN(TimeSinceFire+1, MaxTSF)
Example 2:   
Example 2:   


SAMPLE MODELS:  
SAMPLE MODELS:  
<links to sample models where this function is used>
[[Model Builder's Guide Chapter 9#Composite Functions]]


==MIN POSITION==
==MIN POSITION==
Line 696: Line 738:


Example 1:   
Example 1:   
//Note this example is out of context. //See [[LSStats#centroid.lse|centroid.lse]] for the working example.
nextPos = NEXT(patchList[i], pos1)


Example 2:   
Example 2:   
//Note this example is out of context. //See [[LSStats#nn.lse|nn.lse]] for the working example.
pos = NEXT(nnGraph[pType], pos)


SAMPLE MODELS:  
SAMPLE MODELS:  
[[Model Builder's Guide Chapter 9#General Set, List and Graph Functions]]  
[[Model Builder's Guide Chapter 9#General Set, List and Graph Functions]]


==NEXT LINK==
==NEXT LINK==
Line 715: Line 761:


Example 1:   
Example 1:   
//Note this example is out of context. //See [[LSStats#nn.lse|nn.lse]] for the working example.
pos = NEXT LINK(nnGraph[pType], pos)


Example 2:   
Example 2:   


SAMPLE MODELS:  
SAMPLE MODELS:  
[[Model Builder's Guide Chapter 9#Graph Functions]]  
[[Model Builder's Guide Chapter 9#Graph Functions]]


==NORMAL==
==NORMAL==

Latest revision as of 22:50, 15 November 2006

IF Expr

DESCRIPTION: Procedural IF statement to process the first set of sub-expressions denoted by “…”if the

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1://Note this example is out of context. //See identifyPatches.lse for the working example.

IF (PatchId EQ 0) // not visited...
  pId = pId + 1
  NumPatches[PatchLayer] = NumPatches[PatchLayer] + 1
ENDFN

Example 2://Note this example is out of context. //See stats.lse for the working example.

IF pos
  MaxPS[i] = patchVar[rArea]
  MinPS[i] = patchVar[rArea]
ENDFN

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: //Note this example is out of context. //See Spreading.lse for the working example.

distInc = IF SpreadType EQ 0 THEN 1 ELSE MAX(0,d - SOURCE d)

Example 2:

SAMPLE MODELS: <links to sample models where this function is used>

INSERT

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1: //Note this example is out of context. //See nn.lse for the working example.

INSERT(nnGraph[currType], patchVar)

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

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1: //Note this example is out of context. //See nn.lse for the working example.

INSERT LINK(nnGraph[currType], patchPos, nPos2, edgeVar)

Example 2:

SAMPLE MODELS: Model Builder's Guide Chapter 9#List Functions

INSERT TAIL

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1: //Note this example is out of context. //See identifyPatches.lse for the working example

INSERT TAIL(patchList[currType], patchVar)

Example 2: //Note this example is out of context. //See identifyPatches.lse for the working example

INSERT TAIL(coreAreaList[PatchLayer], patchVar)

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


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>

LOCATION

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1: //Note this example is out of context. //See ConvexHull.lse for the working example.

EdgeLocation = LOCATION(EdgeRow, EdgeCol)

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: α

34=3×3×3×3=81.

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:

log3(81)=4,
Failed to parse (syntax error): {\displaystyle \4^3=81\,\! }

In this program, it is assumed that the base is 10, ie:

log(10)=log10(10)

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,

loge(x)

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

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1: //Note this example is out of context.//See Spreading.lse for the working example

TimeSinceFire = MIN(TimeSinceFire+1, MaxTSF)

Example 2:

SAMPLE MODELS: 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

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: //Note this example is out of context. //See centroid.lse for the working example.

nextPos = NEXT(patchList[i], pos1)

Example 2: //Note this example is out of context. //See nn.lse for the working example.

pos = NEXT(nnGraph[pType], pos)

SAMPLE MODELS: Model Builder's Guide Chapter 9#General Set, List and Graph Functions

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1: //Note this example is out of context. //See nn.lse for the working example.

pos = NEXT LINK(nnGraph[pType], pos)

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>