19.1.12

Repast Batch runs

Ok, so I have successfully got my model to work in batch mode ! :)

Am VERY happy!

The key things seems to be that you can only access parameters from the batch_params.xml file that have been explicitly set up within the model to be controlled by the user (i.e. included within the parameters.xml file in the 'projectName'.rs folder of the project.

Also, if there are any parameters set up in this way that are not included in the batch_params.xml file, the model will not run in batch mode. This only seems to apply to parameters included in the contextCreator file, not those set up within other classes of the model.

Some information seems to be misleading.... in the previous batch post I alluded to a webpage that might be useful from the repast.sourceforge website. This information relates to running a model in batch mode but goes through a quite complicated scenario of installing GridGain and using this to run the model.
This is NOT required to run a simple batch run within eclipse on the local computer. It appears to be most useful for distributing the model to other sources, and using grid computing to run batches...

I doubt I'll need anything quite this complicated as of yet....

Today is a good repast day!

17.1.12

Model Decision-Making

Ok, so following on from the 'model dilemma' post, I have decided, rather than choosing between the two separate movement decision options, to combine them together.

So, instead of having my agents move around looking for food and ignoring the type of habitat, they now make a decision based on 4 factors:

1. amount of food
2. habitat cost
3. pheromone cost
4. road cost

Decisions are now based on a weighting of these 4 parameters, with the need to move still driven by food requirements, but the decision inherently based on weighing up pros of food availability vs the cons of habitat/pheromone/road cost (which implicitly include a range of other factors that may be important to movement decision making by jaguars).

A total 'cell quality' value now exists for each neighbour and the jaguar choose the cell with the best cell quality, calculated as follows:

cellQuality = food - (0.1*habitatCost) - (0.1*pheromoneCost) - roadCost

Food is explicitly linked to habitat, with the food reaching a maximum of 10 in good quality preferential forest habitats.
habitatCost and pheromoneCost reach a maximum level of 100 and so are multiplied by 0.1 to standardise the relative values to that of food. 
roadCost is a tricky one, I haven't yet decided whether to go to a maximum cost of 10 here or to 100, to provide a better relative difference between road types..... The main tricky aspect here is that I want to encourage males to use the trails (classed as a type of road) but discourage the females from doing the same. In this way, males view the smaller forest trails as either of no cost or negative cost (TBC) whereas females see them of some low cost value.

This method of combining the food and cost decision making loops takes out around 3/4 of the steps required in the food loop, making only one additional step to the cost loop - a biased choice towards maximising food if the jaguar has low food reserves. 

Adding in different costs for the trails also provides some inherent decision making towards using trails or not, versus the hard-coding probabilistic choice to avoid or prefer trails that was used in both the food and cost loops.


12.1.12

Publication

My jaguar model has been published via the European Conference on Artificial Life, at which I also presented the work.

Details:
Watkins, A., Noble, J. and Doncaster, C. P. (2011) An agent-­based model of jaguar movement through conservation corridors. In:Advances in Artificial Life, ECAL 2011: Proceedings of the Eleventh European Conference on the Synthesis and Simulation of Living Systems, pp. 846-853, MIT Press. ISBN 978-0-262-29714-1
found here

ECAL took place 8th to 12th August 2011 in Paris, France.

11.1.12

Jaguars: the next step

So what I should have explained by now is that I've moved on from the initial 'lets get a model of jaguar movement in an abstract world working' to "lets validate how jaguars move around in a real-landscape using real data'.

But I should first add some results from the initial 'abstract' model. Not only are territories clearly defined (see post 'habitat preference and territory development' from september '11) and habitat preferences clearly working, but I made a first attempt to investigate some questions about landscape-level population effects of fragmentation and landscape structure. I outlined the model in brief in a previous post ('1st jaguar simulation model' from november '11) and chose to focus on two key questions:

1. What is the effect of landscape structure on the population?
2. How well do corridors connect discrete habitat patches?

So, to answer question 1. I looked at the 'happiness' of individuals in the population over the 9 different landscape designs. 'Happiness' here is defined as the inverse of the cost per time step per individual, where cost is defined as the combination of cost of the habitat (via the least-cost model) and cost of encountering another individuals territory (defined via 'pheromones' which are deposited when an individual moves into a cell and degrade over time). The lower the cost per time step, the happier the individual.


Figure 1. The mean cost per time step for populations within each of the 9 landscapes.

The primeval design is the clear winner here, but this tells us nothing interesting. This design is all forest and so tells us nothing about the effect of landscape structure on the population. By removing this from the figure, we see the results much more clearly:


Figure 2. The mean cost per time step for populations within each of the 8 landscapes that have some amount of matrix habitat.

Now we can see that there is a much clearer difference between those landscape with a corridor and those without. But what is really noticeable is that the happiness of the population relies on how much pure forest habitat there is rather than the structure of the landscape. The Random Islands design includes island of forest that are so small, they are effectively all edge and so this landscape contains less pure forest than all of the other landscape except for the No Corridor design.

To answer question 2. I looked at the proportion of individuals that were able to migrate from one side of the world to the other, in short, the proportion that started in one habitat patch and ended up in the other. This represents the ability of the corridor design to facilitate movement of individuals through the landscape.

Figure 3. The proportion of individuals that moved from one side to the other by the end of the simulation.

Again, clearly the primeval landscape wins, but that tells us nothing interesting. There are no barriers to movement in this design. But there is clearly some big differences between the other 8 landscapes. In fact there is a three-fold difference in the proportions vs a 10% difference found when looking at the happiness of individuals. Clearly, it is the ability to facilitate movement across the landscapes that really differentiates  landscapes in terms of their structure. Connected corridors (represented by One Corridor, Three Corridors and Five Corridors) all increase the proportion of individuals that successfully switches sides during the simulation. What is interesting is that there is such a big difference between these three corridor designs. This surprised me at first until I started to think more about the problem.

One big fat corridor limits the ability of an individual to randomly find it, given that individuals are spread through the entire forest block. Having more corridors increases the chances that any individual will find it. Not only this, but having a corridor that is large enough to support resident individuals means that others may be prevented from travelling through the corridor. It seems to me that the optimum corridor design differs depending on what you want to maximise. A single fat corridor may be fine if you simply want to increase the amount of habitat available, but multiple narrower corridors that reduce the potential for resident individuals to setup territories within the corridor itself may maximise the potential for individuals to travel and increase migration between habitat patches.

It appears there then becomes a trade-off between maximising habitat and population size potential and maximising flow of individuals between habitat patches.

Conclusion
In conclusion, my findings so far suggest that not all landscape structures/corridor designs are the same and that the critical feature for maximising happiness/fitness of a population is to increase the amount of preferred habitat, no matter where this habitat is (with certain constraints on size of patches to be expected here). However, the key difference between corridor designs and in fact landscape structure per se, is the ability to promote and facilitate migration of individuals from one habitat patch to another. This is enhanced with a design of physically connected corridors that are more numerous and narrower in design (again given certain limits due to edge effects/territory size of the species in question etc).