21  The MesaraTrade model

Finally, after much of the modelling equivalent of blood and sweat, we reach the point where we can combine the contribution of all our modules with the full implementation of the Pond Trade model (step 13).

21.1 Integrating module 4 (ARID) and 5 (routes)

We use module 4 - ARID as the starting template and add import-routes-from-file and all route related procedures. We should be able to import the routes data saved before and load it during set up, as the last step before setup-patches:

21.2 Integrating Pond Trade (step 13)

Next, we bring all the extra code and interface objects present in Pond Trade (step 13). Most procedures require no modifications. The exceptions are:

  • There is no isLand variable here and, given that there is no water patches, we should simply erase the code that distinguishes it.
  • Since there is only land patches and we are using the standard deviation of elevations to assign pathCost, there are no relativePathCostInLand or relativePathCostInPort. We can erase all reference to these two parameters, which will leave the corresponding cultural traits of transport technology as the sole modifiers of pathCost.

We carefully organise the scheduling of calls in setup and go:

21.3 Extension: ARID as a factor of settlement productivity

Last, we need to connect ARID to settlement productivity.

We first calculate the value of two new settlement variables, catchmentArea and ARIDinCatchmentArea. The latter is the average ARID within the settlement catchment area. In turn, the catchment area is calculated using a gradient decay function, dependent on sizeLevel and two parameters, catchmentSlope and catchmentRadiusMaximum. This is a very preliminary solution, but will suffice for us to observe the dynamics of Pond Trade playing out over the Mesara Valley.

And voilà! We can now run our boosted Pond Trade model within the context of our case study.

View of MesaraTrade after set up
View of MesaraTrade after set up

View of MesaraTrade interface
View of MesaraTrade interface

21.4 Margins to improve and explore

There are many other points to refactor, explore alternatives and expand. Just remember to first give it a think and then start writing code.

For example:
- Can we visualise catchmentArea of settlements in the NetLogo View, instead of sizeLevel? - Could we find a way to calibrate the speed of traders to the same daily rhythm of the weather variables?
- Could rivers also affect patchCost?