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
Last revision Both sides next revision
tutorial:incorporating_iterations_into_a_model [2016/11/23 16:49]
isabella
tutorial:incorporating_iterations_into_a_model [2017/01/17 18:29]
isabella
Line 31: Line 31:
 Now assign a number to each //[[:Number Map]]// and then connect //[[:Load Map]]// and //[[:Load Categorical Map]]// to them.{{ :​tutorial:​inc._it._model_2.jpg |}} Now assign a number to each //[[:Number Map]]// and then connect //[[:Load Map]]// and //[[:Load Categorical Map]]// to them.{{ :​tutorial:​inc._it._model_2.jpg |}}
  
-Load ''​amazon_states.tif''​ using the //[[:Load Categorical Map]]// and "​Brazilian_amazon_landscape.tif"​ with //[[:Load Map]]//. Add a //[[:Number Value]]// from Map Algebra Supplementary tab inside ​the //​[[:​Calculate Map]]//, assign "​1"​ to it and write the following equation: \\+Load ''​amazon_states.tif''​ using the //[[:Load Categorical Map]]// and "​Brazilian_amazon_landscape.tif"​ with //[[:Load Map]]//. Add a //[[:Number Value]]// from hook tool in the //​[[:​Calculate Map]]//, assign "​1"​ to it and write the following equation: \\
 \\ **if i1 = v1 and i2 = 2 then 1 else null** \\ **if i1 = v1 and i2 = 2 then 1 else null**
  
Line 40: Line 40:
 {{ :​tutorial:​inc._it._model_4.jpg|}}Grab the container //​[[:​Repeat]]//​ from the Control tab and place it on the sketch. Drag //​[[:​Calculate Map]]// into it. It will automatically resize to envelop //​[[:​Calculate Map]]//. Then add the functor //​[[:​Step]]//​ into //​[[:​Repeat]]//​. Open //​[[:​Calculate Map]]// by clicking on its top left icon and connect //​[[:​Step]]//​ to **Value** port of //[[:Number Value]]//. {{ :​tutorial:​inc._it._model_4.jpg|}}Grab the container //​[[:​Repeat]]//​ from the Control tab and place it on the sketch. Drag //​[[:​Calculate Map]]// into it. It will automatically resize to envelop //​[[:​Calculate Map]]//. Then add the functor //​[[:​Step]]//​ into //​[[:​Repeat]]//​. Open //​[[:​Calculate Map]]// by clicking on its top left icon and connect //​[[:​Step]]//​ to **Value** port of //[[:Number Value]]//.
  
-Open //​[[:​Repeat]]//​ with the Edit Functor tool and insert "​9"​.{{:​tutorial:​inc._it._model_5.jpg?​300 |}}+Open //​[[:​Repeat]]//​ with the Edit Functor tool and insert "​9"​. 
 + 
 +{{:​tutorial:​inc._it._model_5.jpg?​300 |}}
 \\ \\
 \\ \\
Line 71: Line 73:
 Now you need to fill in a table in order to store the area calculated for each state. The functor [[:​set_lookup_table_value|Set Lookup Table Value]] updates a lookup table placing a value to a position defined by a key. To fill in the entire lookup table, you need to develop a loop that enables this functor to browse through the lookup table. To close this loop, you will need a functor that is key to the development of dynamic models. Here we introduce the concept of Mux functor. Now you need to fill in a table in order to store the area calculated for each state. The functor [[:​set_lookup_table_value|Set Lookup Table Value]] updates a lookup table placing a value to a position defined by a key. To fill in the entire lookup table, you need to develop a loop that enables this functor to browse through the lookup table. To close this loop, you will need a functor that is key to the development of dynamic models. Here we introduce the concept of Mux functor.
  
-A //Mux// functor can be a map, a categorical map, a lookup table, a table or a value. Look at the Control tab to find //[[:Mux Lookup Table]]// and drag it into //​[[:​Repeat]]//​. Also drag //[[:Set Lookup Table Value]]// from the Table tab.+A //Mux// functor can be a map, a categorical map, a lookup table, a table or a value. Look at the Control tab to find //[[:Mux Lookup Table]]// and drag it into //​[[:​Repeat]]//​. Also drag //[[:Set Lookup Table Value]]// from the Lookup ​Table tab.
  
 {{ :​tutorial:​inc._it._model_9.jpg |}} {{ :​tutorial:​inc._it._model_9.jpg |}}
Line 89: Line 91:
 \\ \\
 \\ \\
-Still, you need to connect the output from //​[[:​Calculate Value]]// to the **input** port of //[[:Set Lookup Table Value]]//​. ​ The Edit Functor Ports window pops up because there are two options. Connect the arrow to the port **Value**; the **key** comes from the current model step via the connection of //​[[:​Step]]//​ to //[[:Set Lookup Table Value]]//.{{:​tutorial:​inc._it._model_13.jpg|}} +Still, you need to connect the output from //​[[:​Calculate Value]]// to the **input** port of //[[:Set Lookup Table Value]]//​. ​\\ 
-{{ :​tutorial:​inc._it._model_14.jpg|}}\\+{{:​tutorial:​inc._it._model_13.jpg|}}\\ 
 +The Edit Functor Ports window pops up because there are two options. Connect the arrow to the port **Value**; the **key** comes from the current model step via the connection of //​[[:​Step]]//​ to //[[:Set Lookup Table Value]]//​. 
 +{{ :​tutorial:​inc._it._model_14.jpg|}} 
 \\ \\
 \\ \\
Line 101: Line 106:
 \\ \\
 \\ \\
 +\\
 +\\
 +\\
 +\\
 +
 Click on the layout tool Left to Right and your model will look like the one below.\\ Click on the layout tool Left to Right and your model will look like the one below.\\
 \\ \\
 +
 {{ :​tutorial:​inc._it._model_15.jpg |}} {{ :​tutorial:​inc._it._model_15.jpg |}}
  
Line 117: Line 128:
 Go to //[[:Set Lookup Table Value]]//, open it with Edit Functor Ports and click with the right button on **Updated Table** to view the result. Also make a chart clicking on the chart button (bottom left). Go to //[[:Set Lookup Table Value]]//, open it with Edit Functor Ports and click with the right button on **Updated Table** to view the result. Also make a chart clicking on the chart button (bottom left).
  
-{{:​tutorial:​inc._it._model_19.jpg|}} {{:​tutorial:​inc._it._model_19_2.jpg|}}+{{:​tutorial:​inc._it._model_19.jpg|}}{{:​tutorial:​inc._it._model_19_2.jpg|}} ​
  
 These are the areal extents of the remaining Amazon forest in hectares per state. These are the areal extents of the remaining Amazon forest in hectares per state.
Line 125: Line 136:
 __You have successfully completed the two introductory lessons__. Another way to solve the query of this lesson is through the use of a subset of Region functors. This will be the topic of the next lesson. __You have successfully completed the two introductory lessons__. Another way to solve the query of this lesson is through the use of a subset of Region functors. This will be the topic of the next lesson.
  
-[[tutorial:​using_the_concept_of_region| Next Lesson]]+[[tutorial:​using_the_concept_of_region|Next ​lesson]]