Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ego_script [2013/01/07 16:48]
admin
ego_script [2015/09/14 02:31] (current)
admin [Overview]
Line 35: Line 35:
 Script {{ Script {{
   landscape := LoadCategoricalMap "​c:/​landscape.tif";​   landscape := LoadCategoricalMap "​c:/​landscape.tif";​
-  ​cells hects m2s := CalcAreas landscape;​ +  ​areas := CalcAreas landscape;​ 
-  ​SaveLookupTable hects "c:/area_in_hectares.csv";+  ​SaveTable areas "c:/areas.csv";
 }}; }};
 </​file>​ </​file>​
  
-Note that functor [[Calc Areas]] produces ​three lookup tables, representing the calculated area in cells, hectares and square meters.+Note that functor [[Calc Areas]] produces ​a table, representing the calculated area in cells, hectares and square meters.
  
 It is possible to omit variables representing outputs or ignore them using the variable ''​_''​ (underline). So the previous example can be re-written as shown below: It is possible to omit variables representing outputs or ignore them using the variable ''​_''​ (underline). So the previous example can be re-written as shown below:
Line 265: Line 265:
  
 The use of sigils has some advantages including making easy to determine the data type represented by the variables. They also prevent clashes between special names like "​rand",​ "​line"​ and "​column"​ and the user defined ones. ((Using sigils the expression "rand + #rand" is the sum of a random value with a the value of map named "​rand"​)) The use of sigils has some advantages including making easy to determine the data type represented by the variables. They also prevent clashes between special names like "​rand",​ "​line"​ and "​column"​ and the user defined ones. ((Using sigils the expression "rand + #rand" is the sum of a random value with a the value of map named "​rand"​))
- 
-//However, keep in mind that this syntax is not fully compatible with the graphical interface and you may end up having an invalid model if you edit a model created using this syntax in the graphical interface.//​ 
  
 === Examples === === Examples ===
Line 303: Line 301:
 ===== Complex Example ===== ===== Complex Example =====
  
-<​code ​csharp>+<​code ​java>
 @title = Calc Patch Sizes, Mean Patch Sizes and Patch Size Standard Deviations @title = Calc Patch Sizes, Mean Patch Sizes and Patch Size Standard Deviations
 @author = Dinamica Team @author = Dinamica Team