7-Day SELES Course Day 5

From SELESwiki

Jump to: navigation, search

Back to Course Index

Landscape Event Language(.lse files)

General

  • Declarative: state behaviour without step-by-step details
  • Case sensitive

Landscape Event Specification

  • Consists of:
    • Event name
    • Declarations
    • Properties

(Example Event Name: LSEVENT: Fire)

Landscape Event Declarations

  • External State
    • Spatial Layers
    • Global Variables
  • Internal State
    • Event Variables
    • Cluster Variables
    • Cell Variables
  • Output Variables

Landscape Event Declarations

Image:5-5.gif

Image:6-5.gif

Image:7-5.gif

System Constants and Variables

Image:8-5.gif

Landscape Event Properties

  • Main Expression: value drives property behaviour
  • Assignments specify state changes:
    • variable = expression
  • context defines spatial domain and available dynamic variables

Image:9-5.gif

Image:10-5.gif

Expressions

  • Arithmetic
  • Continuous
  • Classified
  • Relation and Boolean
  • Combinational
  • Probability Distributions and Density Functions
  • Region and Spatial
  • Control
  • Output
  • Bit-Vector
  • Matrix
  • Set
  • List
  • Graph
  • Sorting
  • Tree

Arithmetic Expressions

Image:13-5.gif

Continuous Expressions

Image:14-5.gif

Bounding Expressions

Image:15-5.gif

TRIGONOMETRY

Image:16-5.gif

Classified Expressions

Image:17-5.gif

Relation Expressions

Image:18-5.gif

Boolean Expressions

Image:19-5.gif

Combinational Expressions

Image:20-5.gif

Image:21-5.gif

Image:22-5.gif

Image:23-5.gif

Image:25-5.gif

Image:26-5.gif

Image:27-5.gif

Image:28-5.gif

Image:29-5.gif

Image:30-5.gif

Image:31-5.gif

Image:32-5.gif

Image:33-5.gif

Image:34-5.gif

Image:35-5.gif

Image:36-5.gif

Image:37-5.gif

Image:38-5.gif

Image:39-5.gif

Image:40-5.gif

Image:41-5.gif

Image:42-5.gif

Image:43-5.gif

Image:44-5.gif

Image:45-5.gif

Image:46-5.gif

Set, List, Tree and Graph Functions

  • REMOVE ALL(S)
  • n=SIZE(S)
  • b=IS EMPTY(S)
  • Pos=FIRST(S)
  • Pos=NEXT(S,Pos)
  • Pos=PREV(S,Pos)
  • REMOVE(S,Pos)
  • X [=] GET(S, Pos)
  • X [=] GET(S, Pos, Index)
  • SET(S, Pos, X)
  • SET(S, Pos, entryIndex, x)
  • Pos = FIND(S, , Xtmp, Condition)
  • Pos = FIND NEXT(S, Pos, Xtmp, Condition)
  • SORT(S, Xtmpr1, Xtmp2, Condition)

Set Variables

  • GLOBAL SET {10} VARIABLE: S
  • CONTAINS(S, X)
  • INSERT(S, X)
  • S = UNION(S1, S2)
  • S = INTERSECTION(S1, S2)
  • S = SUBTRACT(S1, S2)

List Variables

  • GLOBAL SET {10} VARIABLE: L
  • Pos = HEAD(L)
Pos = TAIL(L)
  • INSERT HEAD(L, X)
INSERT TAIL(L, X)
INSERT BEFORE(L, Index, X)
INSERT AFTER(L, Index, X)
INSERT AT(L, Index, X)
  • GLOBAL SET {10} VARIABLE: L
  • REMOVE HEAD(L)
REMOVE TAIL (L)
REMOVE AT INDEX(L, Index)
  • X [=] GET HEAD(L)
X[=] GET TAIL(L)
X [=] GET AT INDEX(L, Index)
Pos = POS AT INDEX(L, Index)

Tree Variables

  • GLOBAL SET {10} VARIABLE: T
  • ADD ROOT(T, X)
INSERT LEFT CHILD(T, Pos, X)
INSERT RIGHT CHILD(T, Pos, X)
INSERT CHILD(T, Pos, X, Index)
n = CHILDREN(T, Pos)
  • GLOBAL SET {10} VARIABLE: T
  • Pos = PARENT(T, Pos)
Pos = LEFT CHILD(T, Pos)
Pos = RIGHT CHILD(T, Pos)
Pos = CHILD(T, Pos, Index)
Pos = NEXT SIBLING(T, Pos)
Pos = PREV SIBLING(T, Pos)
  • GLOBAL SET {10} VARIABLE: T
  • X [=] GET LEFT CHILD(T, Pos)
X [=] GET RIGHT CHILD(T, Pos)
X [=] GET CHILD(T, Pos, Index)
  • GLOBAL SET {10} VARIABLE: T
Pos = NEXT DFS(T, Pos)
position of next node in depth-first pre-order traversal of a tree. Set Pos to NULL to start
Pos = NEXT POSTORDER DFS(T, Pos)
position of next node in depth-first post-order traversal of a tree. Set Pos to NULL to start

Graph Variables

  • GLOBAL GRAPH {10,5} VARIABLE: G
nodes and links
Use list and general functions for nodes
  • REMOVE ALL LINKS(G)
n = SIZE LINKS(G)
-number of links in graph
b = IS EMPTY LINKS(G)
Pos = FIRST LINK(G)
Pos = NEXT LINK (G, Pos)
Pos = PREV LINK (G, Pos)
  • GLOBAL GRAPH {10,5} VARIABLE: G
  • X [=] GET LINK(G, Pos)
b = CONTAINS LINK(G, Xlink)
REMOVE LINK(G, Pos)
  • SET LINK(G, Pos, Xlink)
SET LINK(G, Pos, entryIndex, x)
  • GLOBAL GRAPH {10,5} VARIABLE: G
  • Pos = FIND LINK(G, XtmpLink, Condition)
Pos = FIND NEXT LINK(G, Pos, XtmpLink, Condition)
  • SORT LINKS(G, XtmpLink1, XtmpLink1, Condition)
  • b = LINKED(G, Xnode1, Xnode2, LinkType)
-Set LinkType to 0 for direct links and 1 for indirect
Personal tools