Jump to content

Language Reference 1: Difference between revisions

From SELESwiki
 
(88 intermediate revisions by 2 users not shown)
Line 4: Line 4:


USAGE:  
USAGE:  
  x=Expr+Expr
x=Expr+Expr
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 13: Line 13:


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions) ]]


Example 1:
Example 1:
  x=1+2
x=1+2
    =3
(the result for x will be 3)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 27: Line 27:


USAGE:  
USAGE:  
  x=Expr-Expr
x=Expr-Expr
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 39: Line 39:


Example 1:
Example 1:
  x=15-2
x=15-2
    =13
(the result for x will be 13)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 50: Line 50:


USAGE:  
USAGE:  
  x=Expr*Expr
x=Expr*Expr
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 62: Line 62:


Example 1:
Example 1:
  x=5*4
x=5*4
    =20
(the result for x will be 20)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 86: Line 86:
Example 1:
Example 1:
   x=60/6
   x=60/6
     =10
     (the result for x will be 10)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 109: Line 109:
Example 1:
Example 1:
   x=7^3
   x=7^3
     =343
     (the result for x will be 343)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 119: Line 119:


USAGE:  
USAGE:  
      x=Expr % Expr  
x=Expr % Expr  
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 131: Line 131:


Example 1:  
Example 1:  
          x=19 % 12
x=19 % 12
            =7
(the result for x will be 7)


Example 2:
Example 2:
          x=10 % 20
x=10 % 20
            =10
(the result for x will be 10)


Example 3:
Example 3:
          x=10 % 10
x=10 % 10
            =0
(the result for x will be 0)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 160: Line 160:


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]
[[Model Builder's Guide Chapter 9#Boolean Functions]]  


Example 1:
Example 1:
   x=(|-9|)==(9) (TRUE)
   x=(|-9|)==(9) //(TRUE)
     =1
     (the result for x will be 1)


Example 2:
Example 2:
   x=(2*8)==(4*4) (TRUE)
   x=(2*8)==(4*4) //(TRUE)
     =1
     (the result for x will be 1)


Example 3:
Example 3:
   x=(2*0)==(-1)  (FALSE)
   x=(2*0)==(-1)  //(FALSE)
     =0   
     (the result for x will be 0)    


Example 4:
Example 4:
  x=(|-9|)EQ(9) (TRUE)
  x=(|-9|)EQ(9) //(TRUE)
   =1
   (the result for x will be 1)


Example 5:
Example 5:
   x=(2*6)EQ(4*4) (FALSE)
   x=(2*6)EQ(4*4) //(FALSE)
     =0
     (the result for x will be 0)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 199: Line 199:


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]
[[Model Builder's Guide Chapter 9#Boolean Functions]]  


Example 1:
Example 1:
  x=(|-9|)!=(-9)(TRUE)
x=(|-9|)!=(-9) //(TRUE)
    =1
(the result for x will be 1)


Example 2:
Example 2:
  x=(2*8)!=(4*3) (TRUE)
x=(2*8)!=(4*3) //(TRUE)
    =1   
(the result for x will be 1)    


Example 3:
Example 3:
  x=(2*8)!=(2*8) (FALSE)
x=(2*8)!=(2*8) //(FALSE)
    =0
(the result for x will be 0)


Example 4:
Example 4:
  x=(1+7)NEQ(8)(FALSE)
  x=(1+7)NEQ(8) //(FALSE)
  =0
(the result for x will be 0)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 225: Line 225:


USAGE:  
USAGE:  
  x=(Expr)<(Expr)=(Expr)LESS THAN(Expr)
x=(Expr)<(Expr)=(Expr)LESS THAN(Expr)
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 234: Line 234:


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]
[[Model Builder's Guide Chapter 9#Boolean Functions]]


Example 1:
Example 1:
  x=(17)<(21) (TRUE)
x=(17)<(21) //(TRUE)
    =1
(the result for x will be 1)
Example 2:
Example 2:
  x=(-17)LESS THAN(-17) (FALSE)     
x=(-17)LESS THAN(-17) //(FALSE)     
    =0
(the result for x will be 0)




Line 252: Line 252:


USAGE:  
USAGE:  
  x=(Expr)<=(Expr)=(Expr)LESS OR EQUAL(Expr)
x=(Expr)<=(Expr)=(Expr)LESS OR EQUAL(Expr)
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 261: Line 261:


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]
[[Model Builder's Guide Chapter 9#Boolean Functions]]


Example 1:
Example 1:
  x=17<=21 (TRUE)
x=17<=21 //(TRUE)
    =1
(the result for x will be 1)


Example 2:
Example 2:
  x=(-17)LESS OR EQUAL(|-17|) (TRUE)     
x=(-17)LESS OR EQUAL(|-17|) //(TRUE)     
    =1
(the result for x will be 1)


Example 3:
Example 3:
  x=-17<=-18 (FALSE)
x=-17<=-18 //(FALSE)
    =0
(the result for x will be 0)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 283: Line 283:


USAGE:  
USAGE:  
  x=(Expr)>(Expr)=(Expr)GREATER THAN(Expr)
x=(Expr)>(Expr)=(Expr)GREATER THAN(Expr)
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 292: Line 292:


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]
[[Model Builder's Guide Chapter 9#Boolean Functions ]]


Example 1:
Example 1:
  x=5>2 (TRUE)
x=5>2 //(TRUE)
    =1
(the result for x will be 1)


Example 2:
Example 2:
  x=(5)GREATER THAN(5) (FALSE)
x=(5)GREATER THAN(5) //(FALSE)
    =0
(the result for x will be 0)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 310: Line 310:


USAGE:  
USAGE:  
  x=(Expr)>=(Expr)=(Expr)GREATER OR EQUAL(Expr)
x=(Expr)>=(Expr)=(Expr)GREATER OR EQUAL(Expr)
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 319: Line 319:


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]
[[Model Builder's Guide Chapter 9#Boolean Functions]]


Example 1:
Example 1:
  x=5>=2 (TRUE)
x=5>=2 //(TRUE)
    =1
(the result for x will be 1)


Example 2:
Example 2:
  x=(5)GREATER OR EQUAL(5) (TRUE)
x=(5)GREATER OR EQUAL(5) //(TRUE)
    =1
(the result for x will be 1)


Example 3:
Example 3:
  x=5>=6 (FALSE)
x=5>=6 //(FALSE)
    =0
(the result for x will be 0)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 341: Line 341:


USAGE:  
USAGE:  
  x=!Expr
x=!Expr
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 350: Line 350:


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]
[[Model Builder's Guide Chapter 9#Boolean Functions]]


Example 1:
Example 1:
  y = TRUE x=IF !y THEN 3 ELSE 4
y = TRUE x=IF !y THEN 3 ELSE 4
    =4
(the result for x will be 4)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 364: Line 364:


USAGE:  
USAGE:  
  x=ABS(Expr)=|Expr|=ABSOLUTE(Expr)
x=ABS(Expr)=|Expr|=ABSOLUTE(Expr)
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 376: Line 376:


Example 1:
Example 1:
  x=ABS(-12)==12 (TRUE)
x=ABS(-12)
    =1
(the result for x will be 12)


Example 2:
Example 2:
  x=|-12|==12 (TRUE)
x=|-12|
    =1
(the result for x will be 12)


Example 3:
Example 3:
  x=ABSOLUTE(-12)==12 (TRUE)
  x=ABSOLUTE(-12)  
  =1
  (the result for x will be 12)
 
Example 4:
  x=ABS(12)==57 (FALSE)
  =0


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 399: Line 395:


USAGE:  
USAGE:  
  x= Expr AND Expr
x= Expr AND Expr
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 408: Line 404:


NOTES:
NOTES:
 
The AND operation is equivalent to the multiplication operator. For example: if A is TRUE, which can also be represented by 1 and B is FALSE, which can be represented by 0, then A AND B means that A is multiplied by B, ie: 1*0, which gives FALSE (0).
SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]
[[Model Builder's Guide Chapter 9#Boolean Functions]]


Example 1:
Example 1:
  x=(3>6) AND (14>9)
x=(3>6) AND (14>9)
    =FALSE(0)
(the result for x will be FALSE(0))


Example 2:
Example 2:
  x=(6>3) AND (14>9)
x=(6>3) AND (14>9)
    =TRUE(1)
(the result for x will be TRUE(1))


Example 3:
Example 3:
  x=10 AND (9<14)
x=10 AND (9<14)
    =10
(the result for x will be 10)
      
      
Example 4:
Example 4:
  x=10 AND -5
x=10 AND -5
    =-50
(the result for x will be -50)


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


==ARCCOS==(Expr) inverse cos of the value of the expression [[Model Builder's Guide Chapter 9#Continuous Functions (Trigonometric Functions)]]
 


==ARCCOS==
==ARCCOS==
Line 452: Line 448:
Example 1:
Example 1:
   x=ARCCOS(0.5)
   x=ARCCOS(0.5)
     =59.9999999999998
     (the result for x will be 59.9999999999998)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 475: Line 471:
Example 1:
Example 1:
   x=ARCSIN(1)
   x=ARCSIN(1)
     =89.9999999999998
     (the result for x will be 89.9999999999998)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 498: Line 494:
Example 1:
Example 1:
   x=ARCTAN(1)
   x=ARCTAN(1)
     =44.9999999999999
     (the result for x will be 44.9999999999999)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 521: Line 517:
Example 1:
Example 1:
     x=ARCTAN(5,9)
     x=ARCTAN(5,9)
     =60.9453959009227
     (the result for x will be 60.9453959009227)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 528: Line 524:
==BITWISE OR==
==BITWISE OR==
(Expr, Expr) Bitwise OR of two values[[Model Builder's Guide Chapter 9#Bit-Vector Functions]]
(Expr, Expr) Bitwise OR of two values[[Model Builder's Guide Chapter 9#Bit-Vector Functions]]
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
Example 2: 
SAMPLE MODELS:
<links to sample models where this function is used>
==BITWISE AND==
==BITWISE AND==
(Expr, Expr) Bitwise AND of two values[[Model Builder's Guide Chapter 9#Bit-Vector Functions]]
(Expr, Expr) Bitwise AND of two values[[Model Builder's Guide Chapter 9#Bit-Vector Functions]]
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
Example 2: 
SAMPLE MODELS:
<links to sample models where this function is used>
==BITWISE XOR==
==BITWISE XOR==
(Expr, Expr) Bitwise exclusive-OR of two values[[Model Builder's Guide Chapter 9#Bit-Vector Functions]]
(Expr, Expr) Bitwise exclusive-OR of two values[[Model Builder's Guide Chapter 9#Bit-Vector Functions]]
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
Example 2: 
SAMPLE MODELS:
<links to sample models where this function is used>
==BITWISE NOT==
==BITWISE NOT==
  Expr Bitwise NOT of a value[[Model Builder's Guide Chapter 9#Bit-Vector Functions]]
  Expr Bitwise NOT of a value[[Model Builder's Guide Chapter 9#Bit-Vector Functions]]
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
Example 2: 
SAMPLE MODELS:
<links to sample models where this function is used>


==CEILING(Expr)==
==CEILING(Expr)==
Line 540: Line 608:


USAGE:  
USAGE:  
  x=CEILING(Expr)
x=CEILING(Expr)
        
        
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Line 549: Line 617:


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Expressions:]]
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]


Example 1:
Example 1:
  x=CEILING(0.01)
x=CEILING(0.01)
    =1
(the result for x will be 1)


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


==CLAMP==
==CLAMP==
Line 592: Line 658:
[[Model Builder's Guide Chapter 9#Classified and Discrete Functions]]
[[Model Builder's Guide Chapter 9#Classified and Discrete Functions]]


==CLASSIFY==
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1:
//Note this example is out of context. It will not run in the value model.
//See [[Markov chains#MarkovChain.lse|MarkovChain.lse]] for the working example.
CellState = CLASSIFY(currState)
                0: 0
                1: CLASSIFIED_DIST
                    1:1 - pChange
                    2:pChange
                  ENDFN
                2: CLASSIFIED_DIST
                    2:1 - pChange
                    3:pChange
                  ENDFN
                3: CLASSIFIED_DIST
                    3:1 - pChange
                    4:pChange
                  ENDFN
                4: CLASSIFIED_DIST
                    0: pChange
                    4:1 - pChange
                  ENDFN
              ENDFN
ENDTR
 
Example 2: 
 
SAMPLE MODELS:
<links to sample models where this function is used>
 
:***
(X) return the result of the kth expression in the list,
(X) return the result of the kth expression in the list,
Expr where k = X – minimum value of the variables
Expr where k = X – minimum value of the variables
Line 602: Line 707:




==CLASSIFY==
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
 
Example 2: 
 
SAMPLE MODELS:
<links to sample models where this function is used>
***
(X): ( Number+) return the kth number in the list, where  
(X): ( Number+) return the kth number in the list, where  
k = X – minimum value of the variable (this
k = X – minimum value of the variable (this
may be non-0 only for layers)[[Model Builder's Guide Chapter 9#Classified and Discrete Functions]]
may be non-0 only for layers)[[Model Builder's Guide Chapter 9#Classified and Discrete Functions]]


==CLASSIFY==
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  
(X): Filename uses the table in the named file, which is  
assumed to consist of class:value pairs. Rarely
assumed to consist of class:value pairs. Rarely
Line 613: Line 751:
[[Model Builder's Guide Chapter 9#Classified and Discrete Functions]]
[[Model Builder's Guide Chapter 9#Classified and Discrete Functions]]


==CLASSIFY==
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  
(X): Filename Key uses the table in the named file, which is  
assumed to consist of class:value pairs. The key  
assumed to consist of class:value pairs. The key  
Line 621: Line 775:
Classified functions use the variable as an index into the list of numbers or expressions that follow. The “CLASS” keyword is optional.  This variable must be non-negative. If “CLASS # :” is used, then the number refers to the value of the indexing variable. If a class is not specified for a given value, its expression is implicitly ZERO.  Interpolation tables are very similar except that the variable is assumed to be continuous instead of classified.  An interpolated value between classes is returned.  Lookup tables are also similar, except that both the variable and classes are assumed to be continuous values. An interpolated value between classes is also returned. Rarely used.
Classified functions use the variable as an index into the list of numbers or expressions that follow. The “CLASS” keyword is optional.  This variable must be non-negative. If “CLASS # :” is used, then the number refers to the value of the indexing variable. If a class is not specified for a given value, its expression is implicitly ZERO.  Interpolation tables are very similar except that the variable is assumed to be continuous instead of classified.  An interpolated value between classes is returned.  Lookup tables are also similar, except that both the variable and classes are assumed to be continuous values. An interpolated value between classes is also returned. Rarely used.
[[Model Builder's Guide Chapter 9#Classified and Discrete Functions]]
[[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>


==CLASSIFIED_DIST==
==CLASSIFIED_DIST==
draw a value from a discrete distribution, where CLASS Number: Expr each expression determines the relative  : probability of its associated class being drawn. ENDFN The CLASS keyword is optional.
draw a value from a discrete distribution, where CLASS Number: Expr each expression determines the relative  : probability of its associated class being drawn. ENDFN The CLASS keyword is optional.


==CLASSIFIED_DIST==
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
 
Example 2: 
 
SAMPLE MODELS:
<links to sample models where this function is used>
***
( Number+) in this form, the classes are assumed to start at zero. Only constant probabilities can be given.
( Number+) in this form, the classes are assumed to start at zero. Only constant probabilities can be given.
==CLASSIFIED_DIST==
 
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
 
Example 2: 
 
SAMPLE MODELS:
<links to sample models where this function is used>
***
in this form, the classes are assumed to start at Expr zero    :
in this form, the classes are assumed to start at Expr zero    :
ENDFN
ENDFN


==CLASSIFIED_DIST[M]==
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
 
Example 2: 
 
SAMPLE MODELS:
<links to sample models where this function is used>
***
[M]
In this form, the classes in a one-dimensional
In this form, the classes in a one-dimensional
array M, and so start at zero.
array M, and so start at zero.
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
Example 2: 
SAMPLE MODELS:
<links to sample models where this function is used>
==CONTAINS==
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
Example 2: 
SAMPLE MODELS:
[[Model Builder's Guide Chapter 9#Set Functions]]
==CONTAINS LINK==
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
Example 2: 
SAMPLE MODELS:
[[Model Builder's Guide Chapter 9#Graph Functions]]
==COS==
==COS==
DESCRIPTION:  
DESCRIPTION:  
Line 652: Line 929:
Example 1:
Example 1:
   x=COS(0.5)
   x=COS(0.5)
     =0.99996192306417
     (the result for x will be 0.99996192306417)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 662: Line 939:
(i.e. shared with another application).[[Model Builder's Guide Chapter 9#Control Expressions]]
(i.e. shared with another application).[[Model Builder's Guide Chapter 9#Control Expressions]]


DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
Example 2: 
SAMPLE MODELS:
<links to sample models where this function is used>


==DEBUG==
==DEBUG==
Line 668: Line 962:
event behaviour.[[Model Builder's Guide Chapter 9#Control Expressions]]
event behaviour.[[Model Builder's Guide Chapter 9#Control Expressions]]


==DECISION==
DESCRIPTION:
Expr approximation of line between end cells
 
Cost surface and least-cost path regions are advanced features that are best understood with an example model.
USAGE:       
[[Model Builder's Guide Chapter 9#Region Functions]]
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
 
Example 2: 
 
SAMPLE MODELS:
<links to sample models where this function is used>
 




Line 679: Line 986:
[[Model Builder's Guide Chapter 9#Region Functions]]
[[Model Builder's Guide Chapter 9#Region Functions]]


==DECISION== Expr location indices stored in one-dimensional X.  
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
 
Example 2: 
 
SAMPLE MODELS:
<links to sample models where this function is used>
 
==DECISION==  
Expr location indices stored in one-dimensional X.  
[[Model Builder's Guide Chapter 9#Region Functions]]
[[Model Builder's Guide Chapter 9#Region Functions]]


==DECISION== Expr location index. If there is a decision expression,
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
 
Example 2: 
 
SAMPLE MODELS:
<links to sample models where this function is used>
 
==DECISION==  
Expr location index. If there is a decision expression,
then only those cells for which this expression
then only those cells for which this expression
returns TRUE will be included.
returns TRUE will be included.
[[Model Builder's Guide Chapter 9#Region Functions]]
[[Model Builder's Guide Chapter 9#Region Functions]]
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
Example 2: 
SAMPLE MODELS:
<links to sample models where this function is used>


==DECISION==  
==DECISION==  
Line 695: Line 1,055:
DistanceType is either CARDINAL or EUCLIDEAN (the default). Cardinal distance between two cells is the minimum number of cardinal steps (up, down, left, right) to reach one cell from the other. Euclidean distance is the straight-line distance between two points. The WRAPPED flag, if present indicates that the region wraps around the sides (vertically and horizontally) of the landscape (e.g. a location x positions beyond the right-hand side of a raster will be mapped to x positions in from the left-hand side of the raster). If not present, the landscape does not wrap.
DistanceType is either CARDINAL or EUCLIDEAN (the default). Cardinal distance between two cells is the minimum number of cardinal steps (up, down, left, right) to reach one cell from the other. Euclidean distance is the straight-line distance between two points. The WRAPPED flag, if present indicates that the region wraps around the sides (vertically and horizontally) of the landscape (e.g. a location x positions beyond the right-hand side of a raster will be mapped to x positions in from the left-hand side of the raster). If not present, the landscape does not wrap.
[[Model Builder's Guide Chapter 9#Region Functions]]
[[Model Builder's Guide Chapter 9#Region Functions]]
DESCRIPTION:  
DESCRIPTION:  
Defines a region centred on the current cell. If there is a decision expression, then only those cells for which this expression returns TRUE will be included.
Defines a region centred on the current cell. If there is a decision expression, then only those cells for which this expression returns TRUE will be included.
Line 714: Line 1,075:
Example 1:
Example 1:
   x=(3>6) AND (14>9)
   x=(3>6) AND (14>9)
     =FALSE(0)
     (the result for x will be FALSE(0))


Example 2:
Example 2:
   x=(6>3) AND (14>9)
   x=(6>3) AND (14>9)
     =TRUE(1)
     (the result for x will be TRUE(1))


Example 3:
Example 3:
   x=10 AND (9<14)
   x=10 AND (9<14)
     =10
     (the result for x will be 10)
      
      
Example 4:
Example 4:
   x=10 AND -5
   x=10 AND -5
     =-50
     (the result for x will be -50)


SAMPLE MODELS:  
SAMPLE MODELS:  
Line 735: Line 1,096:
[[Model Builder's Guide Chapter 9#Continuous Functions (Miscellaneous)]]
[[Model Builder's Guide Chapter 9#Continuous Functions (Miscellaneous)]]


==DISPLAY== Display on the screen the labelled Label: Expr values computed with the expressions listed.
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
 
Example 2: 
 
SAMPLE MODELS:
<links to sample models where this function is used>
 
==DISPLAY==
Display on the screen the labelled Label: Expr values computed with the expressions listed.
      …. If no label is given, the expression must
      …. If no label is given, the expression must
ENDFN be a variable, and this is used for the label.
ENDFN be a variable, and this is used for the label.
Line 763: Line 1,142:
<links to sample models where this function is used>
<links to sample models where this function is used>


==DISPLAY== Same as above, but only display if the  DECISION Expr decision expression evaluates to TRUE
==DISPLAY==
Same as above, but only display if the  DECISION Expr decision expression evaluates to TRUE
Label: Expr The keyword DECISION can be replaced by
Label: Expr The keyword DECISION can be replaced by
      …. a “?”
      …. a “?”
Line 776: Line 1,156:
      ….
      ….
ENDFN
ENDFN
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
Example 2: 
SAMPLE MODELS:
<links to sample models where this function is used>


==DISTANCE==
==DISTANCE==
Line 783: Line 1,180:
sqrt(sqr(loc1.x – loc2.x) + sqr(loc1.y – loc2.y))
sqrt(sqr(loc1.x – loc2.x) + sqr(loc1.y – loc2.y))
[[Model Builder's Guide Chapter 9#Continuous Functions (Miscellaneous)]]
[[Model Builder's Guide Chapter 9#Continuous Functions (Miscellaneous)]]
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1:
//Note this example is out of context. //See [[LSStats#centroid.lse|centroid.lse]] for the working example
d = DISTANCE(centroid1, centroid2)
Example 2: 
SAMPLE MODELS:
<links to sample models where this function is used>


==ELSE==
==ELSE==
        expression evaluates to TRUE and the set of
DESCRIPTION:
sub-expressions after the ELSE otherwise. Note
A control expression that evaluates to TRUE and the set of sub-expressions after the ELSE otherwise.
ENDFN that “ELSE IF expr” forms can be strung
together[[Model Builder's Guide Chapter 9#Control Expressions]]


==EQUAL TRUE==  
USAGE:
(1) if the sub-expressions all evaluate to
 
     
REQUIRED ARGUMENTS:
Expr is any expression that evaluates to single numeric value
 
VALUE:
Expression evaluates to TRUE and the set of sub-expressions after the ELSE otherwise. Note that "ELSE IF expr" forms can be strung together.
 
SEE ALSO:
[[Model Builder's Guide Chapter 9#Control Expressions]]
 
Example 1:
//Note this example is out of context. //See [[LSStats#identifyPatches.lse|identifyPatches.lse]] for the working examples. 
// For the core areas ...
ELSE
coreId = coreId + (CoreAreaId EQ 0)
NumCA[PatchLayer] = NumCA[PatchLayer] + (CoreAreaId EQ 0)
ENDFN
 
SAMPLE MODELS:
<links to sample models where this function is used>
 
==EQUAL==  
TRUE(1) if the sub-expressions all evaluate to
the same value and FALSE (0) otherwise
the same value and FALSE (0) otherwise
[[Model Builder's Guide Chapter 9#Composite Functions]]
[[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>


==EXP(Expr)==
==EXP(Expr)==
Line 800: Line 1,254:
(Expr) base of the natural logarithm (e) to the power of
(Expr) base of the natural logarithm (e) to the power of
the expression
the expression
USAGE:  
USAGE:  
   x=EXP(Expr)
   x=EXP(Expr)
Line 814: Line 1,269:
Example 1:  
Example 1:  
           x=EXP(3)
           x=EXP(3)
             =20.08553692
             (the result for x will be 20.08553692)


SAMPLE MODELS:  
SAMPLE MODELS:  
<links to sample models where this function is used>
<links to sample models where this function is used>
[[Model Builder's Guide Chapter 9#Expressions:]]
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]
 
==FIND==
 
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
//Note this example is out of context. //See [[LSStats#nn.lse|nn.lse]] for the working example
pos = FIND(patchList[currType], patchVar, patchVar[rId] EQ currPatchId)
 
Example 2: 
 
SAMPLE MODELS:
[[Model Builder's Guide Chapter 9#General Set, List and Graph Functions]]
 
==FIND LINK==
 
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
//Note this example is out of context. //See [[LSStats#nn.lse|nn.lse]] for the working example.
edgePos = FIND LINK(nnGraph[currType]
Example 2: 
 
SAMPLE MODELS:
[[Model Builder's Guide Chapter 9#Graph Functions]]
 
==FIND 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]]
 
==FIND NEXT LINK==
 
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
 
Example 2: 
 
SAMPLE MODELS:
[[Model Builder's Guide Chapter 9#Graph Functions]]
 
==FIRST==
 
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
//Note this example is out of context. //See [[LSStats#nn.lse|nn.lse]] for the working example
pos = FIRST(nnGraph[pType])
 
Example 2: 
 
SAMPLE MODELS:
[[Model Builder's Guide Chapter 9#General Set, List and Graph Functions]]
 
==FIRST LINK==
 
DESCRIPTION:
 
USAGE:       
 
REQUIRED ARGUMENTS:
 
VALUE:
 
SEE ALSO:
 
Example 1: 
//Note this example is out of context. //See [[LSStats#nn.lse|nn.lse]] for the working example.
pos = FIRST LINK(nnGraph[pType])
 
Example 2: 
 
SAMPLE MODELS:
[[Model Builder's Guide Chapter 9#Graph Functions]]


==FLOOR(Expr)==
==FLOOR(Expr)==
Line 834: Line 1,410:


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Expressions:]]
[[Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)]]  


Example 1:
Example 1:
   x=FLOOR(0.99)
   x=FLOOR(0.99)
     =0
     (the result for x will be 0)


SAMPLE MODELS:  
SAMPLE MODELS:  
<links to sample models where this function is used>
<links to sample models where this function is used>
==GEOMETRIC MEAN==
==GEOMETRIC MEAN==
geometric mean of the sub-expressions  (nth  
geometric mean of the sub-expressions  (nth  
Line 847: Line 1,424:


[[Model Builder's Guide Chapter 9#Composite Functions]]
[[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>
==GET==
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
//Note this example is out of context. //See [[LSStats#nn.lse|nn.lse]] for the working model.
Area1 = GET(nnGraph[currType], patchPos, rArea)
   
Example 2: 
//Note this example is out of context. //See [[LSStats#nn.lse|nn.lse]] for the working model.
Area2 = GET(nnGraph[currType], nPos2, rArea)
SAMPLE MODELS:
<links to sample models where this function is used>
==GET LINK==
DESCRIPTION:
USAGE:       
REQUIRED ARGUMENTS:
VALUE:
SEE ALSO:
Example 1: 
//Note this example is out of context. //See [[LSStats#nn.lse|nn.lse]] for the working example.
edgeVar [=] GET LINK(nnGraph[pType], pos)
Example 2: 
SAMPLE MODELS:
<links to sample models where this function is used>


==GREATER OR EQUAL==
==GREATER OR EQUAL==
Line 853: Line 1,490:
FALSE (0) otherwise
FALSE (0) otherwise
[[Model Builder's Guide Chapter 9#Composite Functions]]
[[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>


==GREATER THAN==
==GREATER THAN==
Line 861: Line 1,515:
[[Model Builder's Guide Chapter 9#Composite Functions]]
[[Model Builder's Guide Chapter 9#Composite Functions]]


==LOG(Expr)==
The '''logarithm''' is the [[mathematics|mathematical]] operation that is the [[inverse function|inverse]] of [[exponentiation]] (raising a constant, the ''base'', to a power). The logarithm of a number ''x'' in base ''b'' is the number ''n'' such that ''x''&nbsp;= ''b''<sup>''n''</sup>.  It is usually written as
DESCRIPTION:  
: <math> \log_b(x) = n . \,\! </math>
The logarithm operator
 
DESCRIPTION:
 
USAGE:       


USAGE:
  x=LOG(Expr)
     
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Expr is any expression that evaluates to single numeric value


VALUE:  
VALUE:  
Natural logarithm of the value of the expression


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Expressions:]]


Example 1:
Example 1:
  x=LOG(0.773)
 
    =-0.111820506
Example 2: 


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


==ROUND(Expr)==
==HEAD==
DESCRIPTION:  
 
The rounding operator
DESCRIPTION:
 
USAGE:       


USAGE:
  x=ROUND(Expr)
     
REQUIRED ARGUMENTS:
REQUIRED ARGUMENTS:
Expr is any expression that evaluates to single numeric value


VALUE:  
VALUE:  
Expression value rounded to the nearest integer


SEE ALSO:  
SEE ALSO:  
[[Model Builder's Guide Chapter 9#Expressions:]]


Example 1:
Example 1:
  x=ROUND(0.773)
//Note this example is out of context. //See [[LSStats#stats.lse|stats.lse]] for the working example.
    =1
pos = HEAD(coreAreaList[i])
 
Example 2: 


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

Latest revision as of 22:41, 15 November 2006

+

DESCRIPTION: The addition operator, "+"

USAGE:

x=Expr+Expr
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Value of the expression is the sum of two expressions

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

Example 1:

x=1+2
(the result for x will be 3)

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

-

DESCRIPTION: The subtraction operator

USAGE:

x=Expr-Expr
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Value of the first expression minus the value of the second expression

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

Example 1:

x=15-2
(the result for x will be 13)

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

*

DESCRIPTION: The multiplication operator

USAGE:

x=Expr*Expr
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Value is the product of two expressions

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

Example 1:

x=5*4
(the result for x will be 20)

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

/

DESCRIPTION: The division operator

USAGE:

  x=Expr/Expr
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Value of the first expression divided by value of the second expression

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

Example 1:

  x=60/6
   (the result for x will be 10)

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

^

DESCRIPTION: The power operator

USAGE:

  x=Expr^Expr
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: The first expression to the power of the value of the second expression

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

Example 1:

  x=7^3
   (the result for x will be 343)

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

%

DESCRIPTION: The percentage operator

USAGE:

x=Expr % Expr 
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Value of the first expression modulo the value of the second expression(assumes that the values of the expression are integers

SEE ALSO: <a link to the composite functions section of seles modellers guide>

Example 1:

x=19 % 12
(the result for x will be 7)

Example 2:

x=10 % 20
(the result for x will be 10)

Example 3:

x=10 % 10
(the result for x will be 0)

SAMPLE MODELS: <links to sample models where this function is used> Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

==

DESCRIPTION: The EQ operator or the alternate form of EQ comparison (Note: two equal signs distinguish this from an assignment). This is a Boolean function operator.

USAGE:

  x=(Expr)==(Expr)=(Expr)EQ(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Value on the left of the == or the EQ sign must equal to the value on the right of the == or the EQ sign.

SEE ALSO: Model Builder's Guide Chapter 9#Boolean Functions

Example 1:

  x=(|-9|)==(9) //(TRUE)
   (the result for x will be 1)

Example 2:

  x=(2*8)==(4*4) //(TRUE)
   (the result for x will be 1)

Example 3:

  x=(2*0)==(-1)  //(FALSE)
   (the result for x will be 0)   

Example 4:

x=(|-9|)EQ(9) //(TRUE)
 (the result for x will be 1)

Example 5:

  x=(2*6)EQ(4*4) //(FALSE)
   (the result for x will be 0)

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

!=

DESCRIPTION: The not equal operator or the alternate form of NOT EQUAL comparison. This is a Boolean function operator.

USAGE:

  x=(Expr)!=(Expr)=(Expr)NEQ(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Value on the left of the != or NEQ sign does not equal to the value on the right of the != or NEQ sign.

SEE ALSO: Model Builder's Guide Chapter 9#Boolean Functions

Example 1:

x=(|-9|)!=(-9) //(TRUE)
(the result for x will be 1)

Example 2:

x=(2*8)!=(4*3) //(TRUE)
(the result for x will be 1)   

Example 3:

x=(2*8)!=(2*8) //(FALSE)
(the result for x will be 0)

Example 4:

x=(1+7)NEQ(8) //(FALSE)
(the result for x will be 0)

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

<

DESCRIPTION: A Boolean function operator that returns TRUE(1) if the value of the first expression is less than the value of the second expression; otherwise FALSE(0).

USAGE:

x=(Expr)<(Expr)=(Expr)LESS THAN(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Value on the left of the < or the LESS THAN is less than the value on the right of the < or LESS THAN sign

SEE ALSO: Model Builder's Guide Chapter 9#Boolean Functions

Example 1:

x=(17)<(21) //(TRUE)
(the result for x will be 1)

Example 2:

x=(-17)LESS THAN(-17) //(FALSE)    
(the result for x will be 0)


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

<=

DESCRIPTION: A Boolean function operator that returns TRUE(1) if the value of the first expression is less than or equal to the value of the second expression; otherwise FALSE(0).

USAGE:

x=(Expr)<=(Expr)=(Expr)LESS OR EQUAL(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Value on the left of the <= or LESS OR EQUAL sign is less or equal to the value on the right of the <= or LESS OR EQUAL sign

SEE ALSO: Model Builder's Guide Chapter 9#Boolean Functions

Example 1:

x=17<=21 //(TRUE)
(the result for x will be 1)

Example 2:

x=(-17)LESS OR EQUAL(|-17|) //(TRUE)    
(the result for x will be 1)

Example 3:

x=-17<=-18 //(FALSE)
(the result for x will be 0)

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

>

DESCRIPTION: A Boolean function operator that returns TRUE(1) if the value of the first expression is greater than the value of the second expression; otherwise FALSE(0).

USAGE:

x=(Expr)>(Expr)=(Expr)GREATER THAN(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Value on the left of the > or GREATER THAN sign is greater than the value on the right of the > or GREATER THAN sign

SEE ALSO: Model Builder's Guide Chapter 9#Boolean Functions

Example 1:

x=5>2 //(TRUE)
(the result for x will be 1)

Example 2:

x=(5)GREATER THAN(5) //(FALSE)
(the result for x will be 0)

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

>=

DESCRIPTION: A Boolean function operator that returns TRUE(1) if the value of the first expression is greater than or equal to the value of the second expression; otherwise FALSE(0).

USAGE:

x=(Expr)>=(Expr)=(Expr)GREATER OR EQUAL(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Value on the left of the >= or GREATER OR EQUAL sign is greater or equal to the value on the right of the >= or GREATER OR EQUAL sign

SEE ALSO: Model Builder's Guide Chapter 9#Boolean Functions

Example 1:

x=5>=2 //(TRUE)
(the result for x will be 1)

Example 2:

x=(5)GREATER OR EQUAL(5) //(TRUE)
(the result for x will be 1)

Example 3:

x=5>=6 //(FALSE)
(the result for x will be 0)

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

!

DESCRIPTION: A Boolean function operator that negates the expression Boolean value.

USAGE:

x=!Expr
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Negates the expression Boolean value

SEE ALSO: Model Builder's Guide Chapter 9#Boolean Functions

Example 1:

y = TRUE x=IF !y THEN 3 ELSE 4
(the result for x will be 4)

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

ABS(Expr)

DESCRIPTION: The absolute value operator

USAGE:

x=ABS(Expr)=|Expr|=ABSOLUTE(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Absolute value of the expression

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

Example 1:

x=ABS(-12)
(the result for x will be 12)

Example 2:

x=|-12|
(the result for x will be 12)

Example 3:

x=ABSOLUTE(-12) 
(the result for x will be 12)

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

AND

DESCRIPTION: A boolean operator that returns TRUE if two expressions are both TRUE, and FALSE otherwise.

USAGE:

x= Expr AND Expr
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: TRUE (1) if all sub-expressions evaluate to TRUE and FALSE (0) otherwise

NOTES: The AND operation is equivalent to the multiplication operator. For example: if A is TRUE, which can also be represented by 1 and B is FALSE, which can be represented by 0, then A AND B means that A is multiplied by B, ie: 1*0, which gives FALSE (0).

SEE ALSO: Model Builder's Guide Chapter 9#Boolean Functions

Example 1:

x=(3>6) AND (14>9)
(the result for x will be FALSE(0))

Example 2:

x=(6>3) AND (14>9)
(the result for x will be TRUE(1))

Example 3:

x=10 AND (9<14)
(the result for x will be 10)
   

Example 4:

x=10 AND -5
(the result for x will be -50)

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


ARCCOS

DESCRIPTION: The arccos function operator

USAGE:

  x=ARCCOS(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Inverse cos of the value of the expression

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Trigonometric Functions)

Example 1:

  x=ARCCOS(0.5)
   (the result for x will be 59.9999999999998)

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

ARCSIN

DESCRIPTION: The arcsin function operator

USAGE:

  x=ARCSIN(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Inverse sine of the value of the expression

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Trigonometric Functions)

Example 1:

  x=ARCSIN(1)
   (the result for x will be 89.9999999999998)

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

ARCTAN(Expr)

DESCRIPTION: The arctan function operator

USAGE:

  x=ARCTAN(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Inverse tan of the value of the expression

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Trigonometric Functions)

Example 1:

  x=ARCTAN(1)
   (the result for x will be 44.9999999999999)

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

ARCTAN(Expr,Expr)

DESCRIPTION: The arcsin quadrant function operator

USAGE:

  x=ARCTAN(Expr,Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Inverse tan where first expression is x offset and second is y offset. Provideing two expressions gives more infomation about the quadrant

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Trigonometric Functions)

Example 1:

   x=ARCTAN(5,9)
    (the result for x will be 60.9453959009227)

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

BITWISE OR

(Expr, Expr) Bitwise OR of two valuesModel Builder's Guide Chapter 9#Bit-Vector Functions

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

BITWISE AND

(Expr, Expr) Bitwise AND of two valuesModel Builder's Guide Chapter 9#Bit-Vector Functions

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

BITWISE XOR

(Expr, Expr) Bitwise exclusive-OR of two valuesModel Builder's Guide Chapter 9#Bit-Vector Functions

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

BITWISE NOT

Expr	Bitwise NOT of a valueModel Builder's Guide Chapter 9#Bit-Vector Functions

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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


CEILING(Expr)

DESCRIPTION: The ceiling operator

USAGE:

x=CEILING(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Smallest integer larger than the expression value

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

Example 1:

x=CEILING(0.01)
(the result for x will be 1)

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

CLAMP

(Expr, MinExpr, MaxExpr)

DESCRIPTION: The clamp operator

USAGE:

  x=(Expr, MinExpr, MaxExpr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Clamp the value X of the expression to the range [Min, Max]: if X<Min then return Min; if X<Max return Max. Otherwise return X.

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

Example 1:


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

CLASSIFY

(X) if the value of the variable X is equal to one of CLASS Number: Expr the classes listed, then return the result of the.  : associated expression. Otherwise return 0. 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: //Note this example is out of context. It will not run in the value model. //See MarkovChain.lse for the working example.

CellState = CLASSIFY(currState)
               0: 0
               1: CLASSIFIED_DIST
                    1:1 - pChange
                    2:pChange
                  ENDFN
               2: CLASSIFIED_DIST
                    2:1 - pChange 
                    3:pChange
                  ENDFN
               3: CLASSIFIED_DIST
                    3:1 - pChange
                    4:pChange
                  ENDFN
               4: CLASSIFIED_DIST
                    0: pChange
                    4:1 - pChange
                  ENDFN
             ENDFN
ENDTR

Example 2:

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

(X) return the result of the kth expression in the list, Expr where k = X – minimum value of the variables

  :	(this may be non-0 only for layers)
  :

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+) return the kth number in the list, where k = X – minimum value of the variable (this may be non-0 only for layers)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. Rarely used. 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. Rarely used.

Classified functions use the variable as an index into the list of numbers or expressions that follow. The “CLASS” keyword is optional. This variable must be non-negative. If “CLASS # :” is used, then the number refers to the value of the indexing variable. If a class is not specified for a given value, its expression is implicitly ZERO. Interpolation tables are very similar except that the variable is assumed to be continuous instead of classified. An interpolated value between classes is returned. Lookup tables are also similar, except that both the variable and classes are assumed to be continuous values. An interpolated value between classes is also returned. Rarely used. 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>

CLASSIFIED_DIST

draw a value from a discrete distribution, where CLASS Number: Expr each expression determines the relative : probability of its associated class being drawn. ENDFN The CLASS keyword is optional.

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

( Number+) in this form, the classes are assumed to start at zero. Only constant probabilities can be given.

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

in this form, the classes are assumed to start at Expr zero  : ENDFN

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

[M] In this form, the classes in a one-dimensional array M, and so start at zero.

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

CONTAINS

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

COS

DESCRIPTION: The cos function operator

USAGE:

  x=COS(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Inverse cos of the value of the expression

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Trigonometric Functions)

Example 1:

  x=COS(0.5)
   (the result for x will be 0.99996192306417)

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

CRITICAL SECTION

(Flag) Enter (if Flag is TRUE) or exit (if Flag is FALSE) a critical section. A critical section gives priority to this application, and is used for synchronizing access to shared variables (i.e. shared with another application).Model Builder's Guide Chapter 9#Control Expressions


DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

DEBUG

Update the simulation probe, if it is loaded and The event is selected. Used to debug/verify event behaviour.Model Builder's Guide Chapter 9#Control Expressions

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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


DECISION

Expr known location indices. If there is a decision expression, then only those cells for which this expression returns TRUE will be included. Model Builder's Guide Chapter 9#Region Functions

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

DECISION

Expr location indices stored in one-dimensional X. Model Builder's Guide Chapter 9#Region Functions

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

DECISION

Expr location index. If there is a decision expression, then only those cells for which this expression returns TRUE will be included. Model Builder's Guide Chapter 9#Region Functions

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

DECISION

Expr defines a region centred on the current cell. If there is a decision expression, then only those cells for which this expression returns TRUE will be included.

DistanceType is either CARDINAL or EUCLIDEAN (the default). Cardinal distance between two cells is the minimum number of cardinal steps (up, down, left, right) to reach one cell from the other. Euclidean distance is the straight-line distance between two points. The WRAPPED flag, if present indicates that the region wraps around the sides (vertically and horizontally) of the landscape (e.g. a location x positions beyond the right-hand side of a raster will be mapped to x positions in from the left-hand side of the raster). If not present, the landscape does not wrap. Model Builder's Guide Chapter 9#Region Functions

DESCRIPTION: Defines a region centred on the current cell. If there is a decision expression, then only those cells for which this expression returns TRUE will be included.

USAGE:

  x= Expr AND Expr
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: TRUE (1) if all sub-expressions evaluate to TRUE and FALSE (0) otherwise

NOTES:

SEE ALSO: Model Builder's Guide Chapter 9#Expressions:

Example 1:

  x=(3>6) AND (14>9)
   (the result for x will be FALSE(0))

Example 2:

  x=(6>3) AND (14>9)
   (the result for x will be TRUE(1))

Example 3:

  x=10 AND (9<14)
   (the result for x will be 10)
   

Example 4:

  x=10 AND -5
   (the result for x will be -50)

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

DIRECTION

(Expr, Expr) angle in degrees between two location indices Model Builder's Guide Chapter 9#Continuous Functions (Miscellaneous)

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

DISPLAY

Display on the screen the labelled Label: Expr values computed with the expressions listed. …. If no label is given, the expression must ENDFN be a variable, and this is used for the label. Model Builder's Guide Chapter 9#Output Expressions DESCRIPTION: The clamp operator

DESCRIPTION: The clamp operator

USAGE:

  x=(Expr, MinExpr, MaxExpr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Clamp the value X of the expression to the range [Min, Max]: if X<Min then return Min; if X<Max return Max. Otherwise return X.

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

Example 1:


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

DISPLAY

Same as above, but only display if the DECISION Expr decision expression evaluates to TRUE Label: Expr The keyword DECISION can be replaced by …. a “?” ENDFN Model Builder's Guide Chapter 9#Output Expressions OUTPUT RECORD(OutputVar) Output to the record file of output variable the labelled values computed with the Label: Expr expressions listed. If no label is given, the …. Expression must be a variable and this is ENDFN used as label. Model Builder's Guide Chapter 9#Output Expressions OUTPUT RECORD(OutputVar) Same as above, but only output if the DECISION Expr decision expression evaluates to TRUE Label: Expr …. ENDFN

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

DISTANCE

(Expr, Expr) distance between two location indices (normally obtained using the Location variable). Thus, DISTANCE(loc1, loc2) is sqrt(sqr(loc1.x – loc2.x) + sqr(loc1.y – loc2.y)) Model Builder's Guide Chapter 9#Continuous Functions (Miscellaneous)

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

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

d = DISTANCE(centroid1, centroid2)

Example 2:

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

ELSE

DESCRIPTION: A control expression that evaluates to TRUE and the set of sub-expressions after the ELSE otherwise.

USAGE:


REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Expression evaluates to TRUE and the set of sub-expressions after the ELSE otherwise. Note that "ELSE IF expr" forms can be strung together.

SEE ALSO: Model Builder's Guide Chapter 9#Control Expressions

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

// For the core areas ...
ELSE
coreId = coreId + (CoreAreaId EQ 0)
NumCA[PatchLayer] = NumCA[PatchLayer] + (CoreAreaId EQ 0)
ENDFN

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

EQUAL

TRUE(1) if the sub-expressions all evaluate to the same value and FALSE (0) 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>

EXP(Expr)

DESCRIPTION: (Expr) base of the natural logarithm (e) to the power of the expression

USAGE:

  x=EXP(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Base of the natural logarithm (e) to the power of the expression

SEE ALSO: <a link to the composite functions section of seles modellers guide>

Example 1:

          x=EXP(3)
           (the result for x will be 20.08553692)

SAMPLE MODELS: <links to sample models where this function is used> Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

FIND

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

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

pos = FIND(patchList[currType], patchVar, patchVar[rId] EQ currPatchId)

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

edgePos = FIND LINK(nnGraph[currType]

Example 2:

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

FIND 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

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

FIRST

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

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

pos = FIRST(nnGraph[pType])

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

pos = FIRST LINK(nnGraph[pType])

Example 2:

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

FLOOR(Expr)

DESCRIPTION: The flooring operator

USAGE:

  x=FLOOR(Expr)
      

REQUIRED ARGUMENTS: Expr is any expression that evaluates to single numeric value

VALUE: Largest integer smaller than the expression value

SEE ALSO: Model Builder's Guide Chapter 9#Continuous Functions (Arithmetic Functions)

Example 1:

  x=FLOOR(0.99)
   (the result for x will be 0)

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

GEOMETRIC MEAN

geometric mean of the sub-expressions (nth root of the product for n 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>

GET

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

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

Area1 = GET(nnGraph[currType], patchPos, rArea)
   

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

Area2 = GET(nnGraph[currType], nPos2, rArea)

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

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

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

edgeVar [=] GET LINK(nnGraph[pType], pos)

Example 2:

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

GREATER OR EQUAL

TRUE (1) if the sub-expression evaluations are all ordered according to the relation >=, and FALSE (0) 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>

GREATER THAN

TRUE (1) if the sub-expression evaluations are all ordered according to the relation >, and FALSE (0) otherwise

Model Builder's Guide Chapter 9#Composite Functions

The logarithm is the mathematical operation that is the inverse of exponentiation (raising a constant, the base, to a power). The logarithm of a number x in base b is the number n such that x = bn. It is usually written as

logb(x)=n.

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

Example 1:

Example 2:

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

DESCRIPTION:

USAGE:

REQUIRED ARGUMENTS:

VALUE:

SEE ALSO:

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

pos = HEAD(coreAreaList[i])

Example 2:

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