The sheepfold example

In this example, we make two models interact. The first one describe sheep moving randomly and shepherds trying to herd them. The second one describe sheep eating grass and gaining energy from it. Both models interact by exchanging data. The sheep model provides the sheep positions and the grass model the sheep energy.

The Netlogo models specifications available here and here.  The output port of one model is linked to the input of the other.

sheepfold example

    Implementation

    THe implementation process is really close to the second example (with two random walk models). The main difference lies in the the type of the data exchanged and in the method to set input and get output data from and to the models. The best way to understand this example is to look at the previous examples and to try the code ;)