Skip to main content

7.8) Insolation


Besides the artificial landscape we need to calculate insolation from the elevation, initialise patch quality and set PV to false. The latter two are fairly simple procedures which we will do straight in the setup procedure.

Add the following code to the ask patches command in the setup procedure:

set patch-quality 0.3 + random-float 0.7
set PV false

Check the random-float primitive in the dictionary and think about the distribution set statements implemented above will give (i.e. normal or uniform distribution?). To check if the statement works, click on the setup button in the interface then right-click on any patch in the view and click inspect patch. This will open the agent monitor with all the patch variables, with a value for elevation and patch quality. The variable insolation will have the default value 0 as we haven’t initiated it yet. As calculating the insolation from the elevation is a bit more complex we will do that in a submodel similar to the set-artificial-landscape procedure.

First add the following new ask patches command in the setup procedure (after the previous ask patches statement), because we need the elevation of all patches defined for this:

ask patches [calculate-insolation]

Similar to before you will get an error message when you hit the Check button now as we will have to define the method first.