Go to the first, previous, next, last section, table of contents.


Brief example

Here is a brief example of one simple minded specie operating in three linearly linked cells. The squeaky duck is a duck, which typical of all bird species, is a sensitive and private creature. When the number of birdwatchers increases, the squeaky duck goes else where.

A simple rule set.

cells this_cell, that_cell, the_other_cell;
link this_cell, that_cell;
link that_cell, the_other_cell;

input from "small.in";
output to "small.out";

step_size := 365.25 * 86400. / 24.;

specie squeaky_duck;
  squeaky_duck := 2;
running rules;
  if birdwatchers in [30,infinity] then
    squeaky_duck -= 0.9;
  else
    if birdwatchers in [0, 30] then
      squeaky_duck += 0.6;
    endif;
  endif;
end specie;

A simple input file.

"modelTime", "this_cell.birdwatchers", "that_cell.birdwatchers", "the_other_cell.birdwatchers"
"1-1-1995", 1, 1, 1
"3-1-1995", 1, 1, 1
"5-1-1995", 200, 1, 1
"7-1-1995", 400, 1, 100
"9-1-1995", 20, 300, 10
"11-1-1995", 1, 1, 1
"1-1-1996", 1, 1, 1

A simple output file.

"modelTime", "birdwatchers@this_cell.lowerBound", "birdwatchers@this_cell.upperBound", "birdwatchers@that_cell.lowerBound", "birdwatchers@that_cell.upperBound", "birdwatchers@the_other_cell.lowerBound", "birdwatchers@the_other_cell.upperBound", "squeaky_duck@this_cell", "squeaky_duck@that_cell", "squeaky_duck@the_other_cell"
"1995-01-01 05:03:46.08", 1, 1, 1, 1, 1, 1, 2, 2, 2
"1995-01-16 10:18:46.08", 1, 1, 1, 1, 1, 1, 2.6, 2.6, 2.6
"1995-01-31 15:33:46.08", 1, 1, 1, 1, 1, 1, 3.2, 3.2, 3.2
"1995-02-15 20:48:46.08", 1, 1, 1, 1, 1, 1, 3.8, 3.8, 3.8
"1995-03-03 02:03:46.08", 1, 7.80498, 1, 1, 1, 1, 4.4, 4.4, 4.4
"1995-03-18 07:18:46.08", 7.80498, 57.453, 1, 1, 1, 1, 4.4, 5, 5
"1995-04-02 12:33:46.08", 57.453, 107.101, 1, 1, 1, 1, 3.5, 5, 5
"1995-04-17 17:48:46.08", 107.101, 156.749, 1, 1, 1, 1, 2.6, 5, 5
"1995-05-02 23:03:46.08", 156.749, 206.429, 1, 1, 1, 4.18253, 1.7, 5, 5
"1995-05-18 04:18:46.08", 206.429, 256.327, 1, 1, 4.18253, 28.8818, 1, 5, 5
"1995-06-02 09:33:46.08", 256.327, 306.224, 1, 1, 28.8818, 53.5811, 1, 5, 4.1
"1995-06-17 14:48:46.08", 306.224, 356.122, 1, 1, 53.5811, 78.2804, 1, 5, 3.2
"1995-07-02 20:03:46.08", 356.122, 400, 1, 9.85402, 78.2804, 100, 1, 5, 2.3
"1995-07-18 01:18:46.08", 295.471, 388.747, 9.85402, 83.2477, 75.2432, 97.3349, 1, 5, 1.4
"1995-08-02 06:33:46.08", 202.195, 295.471, 83.2477, 156.641, 53.1514, 75.2432, 1, 4.1, 1
"1995-08-17 11:48:46.08", 108.919, 202.195, 156.641, 230.035, 31.0597, 53.1514, 1, 3.2, 1
"1995-09-01 17:03:46.08", 19.7786, 108.919, 230.035, 300, 9.89511, 31.0597, 1, 2.3, 1.6
"1995-09-16 22:18:46.08", 15.0383, 19.7786, 221.918, 296.515, 7.64972, 9.89511, 1.6, 1.4, 2.2
"1995-10-02 03:33:46.08", 10.298, 15.0383, 147.322, 221.918, 5.40433, 7.64972, 2.2, 1, 2.8
"1995-10-17 08:48:46.08", 5.55776, 10.298, 72.7247, 147.322, 3.15894, 5.40433, 2.8, 1, 3.4
"1995-11-01 14:03:46.08", 1, 5.55776, 1, 72.7247, 1, 3.15894, 3.4, 1, 4
"1995-11-16 19:18:46.08", 1, 1, 1, 1, 1, 1, 4, 1.6, 4.6
"1995-12-02 00:33:46.08", 1, 1, 1, 1, 1, 1, 4.6, 2.2, 5
"1995-12-17 05:48:46.08", 1, 1, 1, 1, 1, 1, 5, 2.8, 5

A run of a simple model.


Ecological response rule interpreter for LINUX. Version $Revision: 1.6 $
- written by JA Carter 1995 EMail iwqs@dwaf.gov.za

Compilation options were :-
  Compile time Program optimization features OPTLEVEL=5
  Compiler optimization level COMOPTLEVEL  =0
  Compile time paranoia level PARANOIALEVEL=8
  Compile time DEBUGLEVEL   =6
  Compiler verbosity  level =0
  Compiler strictness level =2
  Run time verbosity  level =7
  Run time paranoia   level =8

Creating link from this_cell to that_cell
Creating link from that_cell to the_other_cell
Reading input data from small.in
Declaring birdwatchers@this_cell at stream 1
Declaring birdwatchers@that_cell at stream 2
Declaring birdwatchers@the_other_cell at stream 3
Hunting cell based data streams...
Data stream birdwatchers is a cell based data stream.
Writing output data to small.out
Declaring cell based specie squeaky_duck
End specie
small.rul parsed OK.
Parsing found the following Identifiers...
0 : Identifier of class IdentDouble with name trickIdentifierForDebuggingPurposesThatShouldNeverBeReferenced
1 : Identifier of class IdentDouble with name false
2 : Identifier of class IdentDouble with name true
3 : Identifier of class IdentDouble with name infinity
4 : Identifier of class IdentDouble with name quarter
5 : Identifier of class IdentDouble with name step_size
6 : Identifier of class IdentDouble with name most_times
7 : Identifier of class IdentDouble with name step
8 : Identifier of class IdentDouble with name time
9 : Identifier of class IdentDouble with name lower_limit
10 : Identifier of class IdentDouble with name upper_limit
11 : Identifier of class IdentDouble with name trace
12 : Identifier of class IdentDouble with name current_cell
13 : Identifier of class IdentDouble with name current_specie
14 : Identifier of class IdentCell with name this_cell
15 : Identifier of class IdentCell with name that_cell
16 : Identifier of class IdentCell with name the_other_cell
17 : Identifier of class IdentDataStream with name birdwatchers@this_cell
18 : Identifier of class IdentDataStream with name birdwatchers@that_cell
19 : Identifier of class IdentDataStream with name birdwatchers@the_other_cell
20 : Identifier of class IdentCellBasedDataStream with name birdwatchers
21 : Identifier of class IdentSpecieCell with name squeaky_duck@this_cell
22 : Identifier of class IdentSpecieCell with name squeaky_duck@that_cell
23 : Identifier of class IdentSpecieCell with name squeaky_duck@the_other_cell
24 : Identifier of class IdentSpecie with name squeaky_duck

The following species have been created...
squeaky_duck of type IdentSpecie
Counting records in input files
Reading in 7 records from input file
Running global startup rules.
Running starting rules for each specie/cell...
Interpreting running rules for each time step/specie/cell...
Completed model run OK.

Go to the first, previous, next, last section, table of contents.