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
Next revision Both sides next revision
lesson_13 [2019/08/20 16:15]
argemiro
lesson_13 [2020/02/11 16:48]
argemiro
Line 1: Line 1:
-{{ :logo_guidebook1.jpg?400 |}}+{{ :logo_logo.png?400 |}}
 \\ \\
 =====LESSON 13: Loop structures on Dinamica EGO=====  ​ =====LESSON 13: Loop structures on Dinamica EGO=====  ​
 \\ \\
 \\ \\
- 
 ==== What will you learn? ==== ==== What will you learn? ====
  
-  ​We will learn an important function ​for working ​with large databases ​and operations that require successive calculations:​ How to work with Repetition ​structures, or loops.+What are the main repetition structures present in Dinamica EGO \\ 
 +* What are the main auxiliary operators to control iterations in Dinamica EGO \\ 
 +\\   
 +Dinamica EGO has several looping structures that can be used for various applications. Loops come in handy when you want to run the same code over and over again, each time with a different value. Loops can execute a block of code a number of times. In this lesson we will talk about different kinds of loops on Dinamica EGO and how to work with repetition ​structures.
 \\ \\
 \\ \\
-For this, we learn how user a container to makes a set of functors, linked in a dataflow chain, iterate a number of times.+===Container operators that repeat the functions within them===
 \\ \\
 \\ \\
-**Let'​s go!** +{{ :b.png?800 |}}
-The intent of this exercise is to calculate the CO2 content from biomass forest year from year (2000 to 2006) within expanded protected areas in Amazonia, i.e., How much CO2 exists in protected areas that have expanded from 2000 to 2006?+
 \\ \\
 \\ \\
-We will use:+**Repeat:** This container makes a set of functors, linked in a dataflow chain, iterate a predetermined number of times.
 \\ \\
-- The protected areas map in the year 2000 (Guidebook Dinamica_4/​Database/​Protected_areas/​protected_areas_2000.tif) 
 \\ \\
-- The Legal Amazon Biomass map (Guidebook Dinamica_4/​Database/​biomass/​biomass.tif)+**For:** This container makes a set of functors, linked in a dataflow chain, iterate while a given condition is not met.
 \\ \\
 \\ \\
-The creation of the model that will be inserted inside the repeat structure is very similar to the model explained in the previous exercise. The principally difference is that, now, the input map is produced for each iteration, calculate Map produces ​map containing the remaining forest for each category.\\+**For each:** This container executes ​the contained functors once per each element of given lookup table.
 \\ \\
-Grab the container For from the Control tab and place it on the sketchDrag the previously ​model into it. It will automatically resize to envelop Calculate Map.  +\\ 
- +**For each category:** This container ​executes the contained functors once per each class or category of a categorical map specified as input. 
 +\\ 
 +\\ 
 +**For each region:** This container creates and manages regions identified by a categorical map, whose classes represent regions. It manages both the processes of splitting a map into several maps, each one comprising a region, ​and the subsequent merging of all regional maps in a mosaic, that is a new map. The container also calls the functors inside ​it to each region. 
 +\\ 
 +\\ 
 +**While:** Checks the condition at the starting of the loop and if the condition is satisfied the statement inside the loop is executed.  
 +\\ 
 +\\ 
 +**Do while:** The condition is checked after the execution of all statements in the body of the loop. 
 +\\ 
 +\\ 
 +===Auxiliary operators to control iterations:​=== 
 +\\ 
 +\\ 
 +{{ :a.png?600 |}} 
 +\\ 
 +\\ 
 +**Step:** This functor receives and passes ​on to the current model the step or iteration. 
 +\\ 
 +\\ 
 +**Mux Map:** This functor makes a map dynamic, feeding it back with a map output from a model stepIn the beginning of the first iteration, it reads a map input from the initial port. 
 +\\ 
 +\\ 
 +**Mux Table:** This functor makes a table dynamic, feeding it back with a table output from a model step. In the beginning of the first iteration, ​it reads the table input from the initial port. 
 +\\ 
 +\\ 
 +**Mux Value:** This functor initiates and feeds back a loop variable containing a value. In the beginning of the first iteration, it reads the input value from the initial port
 +\\ 
 +\\ 
 +\\ 
 +\\ 
 +===Congratulations,​ you have successfully completed this lesson!=== 
 +\\ 
 +\\ 
 +☞[[:​lesson_14 | Next Lesson]] 
 +\\ 
 +☞[[:​guidebook_start| Back to Guidebook Start]]