10.7.12

Outline of Thesis (July 2012)

A recent meeting with my supervisors generated some good discussion about where my PhD is going and what I should be thinking about in terms of my final PhD thesis.
Having already been mandated to complete both a 6-month and a 10-month report, I feel like I have the bare bones of my thesis laid out already, with some chapters and details requiring further definition.

As of this week, my thesis already comprises a introductory chapter (literature review) and two data chapters. Im currently working on the third data chapter which I expect to finish in time for the upcoming transfer report and viva. With this in mind, and following clarification of what I hope to achieve by the end of my PhD, my thesis will be as follows:

1. Introductory chapter - to be completed. A short 5-8 page introduction to project and motivation/methods.
2. Literature Review - completed, but needs refining.
3. Exploring and Integrating Least-Cost Models and Agent-Based Simulations in Fragmented Landscapes - completed, but needs some refining to aid potential publication
4. An Agent-Based Model of Jaguar Movement Through Conservation Corridors - completed and published.
5. Integrating and Validating an Agent-Based Model of Jaguar Movements with real-life GIS and Camera-Trap Data Collected in Cockscomb Basin Wildlife Sanctuary, Belize - currently in progress
6. Analysis of real-world corridor designs based on an agent-based model of jaguar movements in Belize - next step, transferring validated jaguar model to corridor area in central belize.
7. An analysis of the potential future impacts of increased human activities and major environmental events on jaguar movements in Belize - last step given enough time (!), Potential impacts and factors are wide-ranging and will depend on discussions with Bart and Beccie and findings from previous work.
8. General Discussion - final section, generally quite short - 6-8 pages, covering limitations and implications of current work and section of future work (although this needs to be specific and achievable).

Chapters 3, 4, 5, 6 and 7 are data chapters. Chapter 7 is best-case scenario and I would like to get this far, but some of this may be combined into chapter 6 if there is not enough time for a stand-alone chapter.

Some sample pages from my thesis to date.....









26.6.12

Distance to urban areas in GIS

I've just finished the last updates to my GIS data for using in my ABM and I generated such a cool picture that I thought I would share:


This is a combination of the distance to the main urban areas and distance to tarmac roads. I removed all of the tracks and trails from my road file as this layer is supposed to represent a general cost layer where proximity to humans is detrimental to jaguars and they would rather be in the low cost areas to the far left and upper regions of the map.

Some things to remember where trying to generate these types of maps:
1. the euclidean distance method seems to be the most appropriate:

                 Spatial Analyst - Distance - Euclidean Distance

2. this method can be used on shape file data or on raster data making it a pretty flexible function
3. the output will only be generate for the exact extent of the data you are performing the function on. For instance, if you have polyline data, then the distance will extend only until the smallest rectangle that includes all the lines, and NOT the surrounding NoData areas. Therefore you need to do the distance function on a larger dataset and then clip it to the area you want if this is a problem.
4. In my case, this was not possible so I converted my polyline shape file (roads) to a raster first, then extended the extent to the area required by my model and then performed the distance function.
5. To get the map above, I combined distance maps for urban areas and roads.
6. My urban areas were actually polygons and the distance function worked just fine with this.
7. As I said earlier, I decided to remove the small roads and tracks from my roads dataset before calculating the distances as these do not impact negatively on the movement of my agents (jaguars).
8. Once I had the two datasets that were each of the correct size and extent, I simply added the layers together:
                  Spatial Analyst - Math - Plus

9. Adding the two layers together creates a new layer that matches the size of the smallest input raster, so I actually added together the roadProximity file (purely for the model area) together with the urbanProximity file for the whole of Belize. 



25.6.12

changing extent of GIS file


Another update to my GIS information:

For some reason some of the methods I've outlined in my earlier post (1/12/2011) don't necessarily work !

So, an update to extending the extent of a file is as follows:

This seems pretty impossible to do with shape file, be it a feature, polygon, polyline or point. This makes life more difficult than it needs to be (typical), so the only alternative at the moment is to

1. convert the shape file to a raster
2. Via spatial analyst toolbar (View - Toolbars - Spatial Analyst)

Options - Analysis Extent - same as Layer "TotalClip" (or whatever the file of the right size is, and this needs to be a shape file) - snap extent to 'total area' (this needs to be a raster file).

3. The above method seems to work most effectively at getting the extent of the file to the required area, so its good to ensure you have both a shape file and a raster of the required area.
4. Now all that needs to be done is to add the raster you want to extend to the raster of the required area. In my case this is adding 'finalRoads' to 'totalarea'.
         totalarea has a value of 1 for every cell within the layer as its only purpose is to show the extent of the area I want to use in my simulations.

        Spatial Analyst toolbar - Raster Calculator - [finalRoads] + [totalarea] - evaluate

5. A new temporary file is now created called Calculation and this needs to be made permanent:

       right click on Calculation - Data - Make Permanent - then go to appropriate folder and name the file (allRoads in my case) - save

6. This new permanent file does not get automatically added, so this needs to be manually added if required.
7. For some reason, some of the classes change slightly (all mine increased by 1). The raster can be reclassified from either the temporary Calculation file or the permanent new allRoads file. Reclassifying the Calculation file means that a permanent reclassified file gets created so you no longer need to make the Calculation file permanent.

21.6.12

model decision-making part 2

Movement Decisions

As an update to my post entitled model decision-making (17/01/2012, here), i've changed my mind yet again (!) on the best way for my agents to move around.

Food is by far the most logical incentive, but then 'cost' became an arbitrary factor that counted for nothing real and only worked in making the model use more factors for no apparent reason. The only way I could see around this was to incorporate food and mortality into the cost factor - as was originally intended when I chose to centre my ABM around ideas of least-cost modelling.

so now, my agents make movement choices based on:

  1. road cost
  2. habitat cost
  3. pheromone cost
Food is still available in the cell, depending on the habitat at that location, but a propensity to avoid cells recently inhabited (via the amount of pheromone available) means that agents are directed at cells that are likely to have greater food availability.
Basing movement decisions on habitat and pheromone implicitly include aspects of food, cover, mortality, mating opportunities etc rather than having to specifically include each separate detail in the model.

This makes more sense to me, and reduces the complicatedness of the model. This has become a real issue to me as improving the model tend to naturally lead to an ever-increasing array of parameters and choices and extra code.

Where a road exists, this overwrites the habitat cost.

Feedback and Improvements

I've also had a lot of good feedback from Bart and Beccie, out in Belize, and I hope to incorporate their ideas and suggestions for improvements in subsequent drafts of the model. At the moment, I have simplified some of the habitats (by combining some types of forest together) and simplified the roads to 3 types:
  1. large, regularly used tarmac roads
  2. small, infrequently used non-tarmac roads that allow cars to pass
  3. small trails and tracks inside and outside cockscomb including some pedestrian tracks that have no car use


Interactions Between Agents

At the moment of writing (june 2012) I'm having trouble deciding how best males and females should interact and how best to attract females and males together for appropriate mating opportunities. I seem to have 4 distinct types of interactions that update how the agents view pheromones from other individuals:
  1. own strength - so how strongly individuals interact with their own pheromones
  2. avoidance of males - how strongly females interact with male pheromones (generally they should try to avoid males so as not to be harassed, although this changes when they are in heat and ready to mate, but could potentially be more severe an avoidance if she is pregnant or has cubs?)
  3. mating attraction - how strongly females should be attracted to male pheromones when they are in heat and ready to mate
  4. male mating attraction - how strongly males should be attracted to females when they are in heat and ready to mate
Additional issues arise when males sense a female is ready to mate, as they are likely to stop actively hunting and looking for food and may become quite thin in their pursuit of a mating opportunity. Males also cover more distance per day when searching for a female in heat.

I'm currently running some trial simulations looking for the effects of these pheromone parameters on the territory sizes of males and females, and in the number of individuals that die and are given birth to. It seems the interaction between these various parameters may be causing some unexpected results in my data.

Territory Sizes

Lastly, territory sizes are become a real concern to me. Territories are based on the number of cells that have an individuals pheromone located in them. Two separate parameters dictate how pheromone survive and propagate - pMax (the maximum amount of pheromone deposited in a cell when visited by an agent) and pDegrade (the rate at which the pheromone degrades and eventually disappears). 

My initial trials used pMax of 100 and pDegrade of 0.98, which gave stable territory sizes of around 70-100 cells per individual. Of course, it wasn't until I realised that this was a tenth of the size that territories needed to be that I ran into a problem!

This needs some more work and investigation, and at the moment any combination of settings seems to either generate territory sizes that are still too small, or that steadily increase throughout the simulation (presumably territories would stabilise at some point but too much time is required for them to stabilise for the parameters settings to be effective).

Running the model for 5000 ticks (or around 4 years) currently takes around 15-20 minutes in batch mode and I would rather not wait any longer before proceeding with the intricacies of the model and starting to collect some data.... although its looking increasingly likely that this may be the case.

Some simple statistics in R

so, I'm currently running a series of simulations of my ABM to try and identify why my agents are not doing what I expect them to do (hardly surprising really, seeing as my model seems to be getting more and more complicated each time I try to improve things).

Anyway, this has led me down the statistics route for the first time in a long time actually as without it I'm struggling to tell if any of my results are *actually* different from each other. I've done an initial 30 runs of each set of parameter settings, taking 30 to be enough of a sample size to allow me to perform robust statistical analyses. *this is tedious by the way*

So I've had to re-learn R, as I tend to do each time I have some stats to do. It does get easier each time, but I tend to avoid using scripts so I struggle to remember how to do even the most simple of stats. Hence, the incentive to write this post as a reminder to me of how to do some simple functions in R.


data <- read.table("testSimulations.txt", header = T)
attach(data)
plot(data)
summary(data)

*this creates a single plot, over-writing one plot on top of the other onto the same axes*
par(mfrow=c(1,1))
plot(meanTerritory~pherValue, col = "green")
par(new = T)
plot(femaleTerritory~pherValue, axes = F, col = "red")

*this creates a side-by-side plot of individual graphs*
par(mfrow=c(1,2))
plot(meanTerritory~pherValuecol = "green")
plot(femaleTerritory~pherValuecol = "red")


*a simple linear model, the anova command gives a single p-value for the treatment, the summary command compares all separate groups to the first group*
territories <- lm(meanTerritory~pherValue)
anova(territories)
summary(territories)
plot(territories)

*a pairwise t-test analysis compares all groups to each other
tmales <- pairwise.t.test(maleTerritory, pherValue, p.adj="none")

some simple advice:
  • use .txt. files, rather than .csv files
  • use a script - in Mac, cmd-Enter runs a single line of the script
  • any statistical book should help with interpretation of the anova output

15.6.12

GIS update - transforming coordinate systems

Following on from a previous post about getting my data files ready to use in my model, I need to update the transform coordinates instructions.

I previously stated that this could be done effectively from within ArcMap. However I have been having problems getting this to work correctly through the transform command within ArcMap (View - Data Frame Properties - Coordinate System - Transformations).

Some of the data I have been provided with has an underlying coordinate system of WGS_1984_UTM_Zone_16N, but camera data I have has been supplied in NAD_1927_UTM_Zone_16N and so my data files need converting to the later coordinate system.

There is a difference between the Geographic Coordinate System and the Projected Coordinate System. The supplied WGS_1984 is from the Geographic Coordinate System and transforming this only allows you access to other Geographic Coordinate Systems. The correct NAD1927 coordinate system is not geographic but projected and so the transformation function within ArcMap does not adequately transform the data....

so... this can be done more effectively from within ArcCatalog...

Navigate to the appropriate file in ArcCatalog, i'll run through this for my data layer of rivers

1. Select modelRivers.shp
2. Click on File - Properties
3. Select XY Coordinate
4. Choose Select
5. Chose Projected Coordinate Systems - UTM - NAD 1927 - NAD 1927 UTM Zone 16N.prj
6. Click Add
7. Click Apply - OK

Note, you cannot change the coordinate system if the file is already open in ArcMap, so you need to remove the layer from ArcMap before attempting to change the coordinate system.


12.6.12

batch update

Ok, so i did say i was going to post the relevant files that enabled my model to run in batch mode.
I've just come back to this after a few months and have had to re-learn how to do batch runs, so... heres the relevant information:

Batch mode depends mainly on 2 files
1. batch_params.xml - located within the batch folder
2. parameters.xml - located within the JaguarMovementValidation.rs folder

The parameters file must include those parameters that have been set as requiring user input in the ContextCreator file
Batch_params.xml must then include reference to any parameters that are included within the parameters.xml file

Batch mode does not seem to work properly if you try to by-pass these parameters. For instance, I just want to do multiple runs with the same parameters and tried to by-pass the numberOfJaguars parameter by keeping it the same and removing the end and step variables. Batch mode then reports an error and won't run.

For a simple test of running a single simulation, but increasing the jaguar numbers from 50 to 300 in steps of 50, the batch_params.xml file looks like this:


<?xml version="1.0"?>
<sweep runs="10">
<parameter name = "NumberOfJaguars" type="number" start="50" end="300" step="50">
</parameter>
</sweep>

when viewed from the Repast GUI it looks like this:



The parameters.xml file, when viewed within the Repast GUI looks like this:




What I now want is to simply run my simulation 30 times using the same parameters.. I do this by removing the parameters from the ContextCreator file and removing all links to this parameter from both the parameters.xml file and the batch.xml file.

This works, but I'm now having the problem that the output is being generated once per tick for the first 50 ticks only, whereas I want the output once at the final tick count of 5000 (or 2000, depending on my criteria).... shall update once I have this issue resolved.

6.6.12

Conference Poster

I have just finished preparing a poster for the University of Southampton Biology Postgraduate conference due to take place on June 14th 2012.
I haven't quite got far enough with my current work to do a poster on validating my agent-based model so I've had to do a poster based on my ECAL poster... not too bad considering it only took me a few hours


22.5.12

Other people using ABMS for spatially explicit ecological modelling

I recently went to a talk by Lael Parrot who was visiting Southampton University for the week. Not a name I had heard of before but I'm quite surprised at this now considering she is involved in very similar work to me!

The most relevant paper I found from her was the one she talked about at the seminar she gave:

Anwar, S.M., Jeanneret, C.A., Parrot, L. & Marceau, D.J. (2007) Conceptualization and implementation of a multi agent model to simulate whale-wathcing tours in the St. Lawrence Estuary in Quebec, Canada. Environmental Modelling and Software 22 1775-1787.

Not only was this paper spatially explicit and employed agent-based modelling, but it was done using the Repast Simphony toolkit!! Finally, an ecological example of someone doing a peer-reviewed and published piece of research using Repast.

I've not yet management to dive into the paper in depth but some of the simulations Lael showed during her talk have me very impressed - linking the repast output with GIS data and creating some pretty good looking 3D models of the system. They also re-integrated the model output with the original GIS data to do some spatial analysis and statistics, so I wonder whether this might also be my best option... definitely something to look into in more detail.

Its a much bigger model than mine will be so I have no doubt that I'll be able to pick up some interesting tips from Lael and the paper. I'll report back with any useful bits of information.

Policy placement with the National Assembly for Wales

So i've been quiet for a while now due to me doing a PhD placement for 3 months with the Research Service of the National Assembly for Wales. I'd definitely recommend doing something similar if given the opportunity and you are thinking about a career outside of academia. This particular placement was quite politics heavy which isn't necessarily what I want to get involved with, but it did give me a tremendous insight into how policy is formed and amended and what goes into devising and publishing national strategy documents.

I was based in the Environment and Sustainability research team meaning I got to be involved with a lot for work currently being undertaken within the Assembly - namely a review of all things Energy in Wales, the publication of the 'Sustaining a Living Wales' Green Paper and the review of merging the three statutory environmental bodies (Countryside Council for Wales, Environment Agency Wales and Forestry Commission Wales) in Wales into a Single Environment Body. Some really interesting topics which meant I got to develop, prepare and publish useful documents on these subjects to the Assembly Members and the general public.

A list of my contributions during the placement:

1. An introduction to natural environment policy in Wales and a comparison with natural environment policies for other parts of the UK (Research paper)
2. Ecosystems and the Ecosystem Approach (Quick Guide)
3. Nature Conservation Designations (Quick Guide)
4. Briefing on Legal Enforcement of European Statutory Legislation (internal briefing to the Environment and Sustainability Committee)
5. Briefing on Tidal Flooding and Coastal Erosion (internal briefing to the Environment and Sustainability Committee)
6. Briefing on Technical Report to Environment Agency Wales on an Investigation into Cockle Mortalities at Burry Inlet (internal briefing to Petitions Committee).


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).

Model Dilemma

So now my model is nearing completion (sort of), I have one main dilemma.

Following a presentation of my work to fellow biologist/ecologists, it seemed that what people wanted to see what a motivation for why individuals move around, rather than simply hard-coding them to move around x% of the time. This meant a shift away from the least-cost model to something more intuitive - food.

At first glance, this seems a relatively straight-forward shift to make. Now, instead of individuals choosing a location based on some negative cost value (and opting for the least-cost move) now they would move around according to their food requirements. In principle, the landscape-effect is similar. Forest is still good whilst agricultural areas/urban areas etc are not so good. However, the shift to 'emergent' behaviour, i.e. individuals moving around to meet some food requirement involves quite a lot of behind the scenes work within the code itself. To put in brief, the two flowcharts outline the decisions made by individuals within each given scenario, 1. moving to find enough food and 2. moving according to least-cost principles. Circles in red are decisions, those in thick red are standard default decisions.




Pros and Cons

1. Food
Now it becomes clear, whilst moving for food may be more intuitive and more 'realistic', it is a lot more complicated, involving a large number of additional parameters, is more likely to cause some un-conceieved bias in the results, and hence is far more sensitive to initial conditions and far less robust that a simpler movement process. There is also no explicit recognition of mortality risk, protection, mating opportunities, physiological costs etc that are encompassed with the single cost value used in the least-cost model. In short, the only factor affecting where a jaguar moves is the availability of food.

In addition, mortality risk is modelled separate to movement choice. Individuals are not 'aware' of the mortality risk of any particular location and are unable to choose a location according to this risk. Of course, this could be added as another factor, but this would increase the complexness of the model, add further parameters and make it even more sensitive.

Some additional parameters include:
1. Amount of food required by an individual (per step or as an average per day still to be decided)
2. Reduction in food per time step - should this be different depending on if the individual physically moves compared to staying in the same cell? should there be a reduction per time step and another depending on how the individual moves? Should this be a set amount or a proportion of the total food resource/food required per step/day?
3. Increase in food availability in cells that have been visited by a jaguar - should this be proportional, an incremental increase or a logistic increase? - i.e. type I, type II or type III response to predation?
4. Should the food be homogenous or clumped/variable in distribution?
5. Should the food change in spatial representation over time?




2. Cost
But then again, cost doesn't necessarily make the best option either. Here, whilst the model decision making is simple and straight-forward there is now no motivation for individuals to move. Movement is not 'emergent' but hard-coded. Males move x% of the time, females y% of the time. However, there is much less risk of the model being sensitive to initial conditions as there are only two parameters to be concerned about: relative differences in cost between habitats and movement rates for males and females.

In addition to this, movement decisions are now based on a range of factors, implicitly outlined by the cost of any particular habitat. Not only does food get represented in the cost, but also mortality risk, cover, mating opportunities, physiological costs of moving through the terrain.

Repast Development and Batch Runs

So its back to the grindstone following a not-long-enough christmas and new year break. This month its all about finalising my model and getting it to a state where I can send off a batch run of the model to Southampton University's super computer. Not only will this mean I get my model to work much more efficiently but that I also won't have to sit around for ages watching the GUI display and waiting... and waiting.... and waiting... whilst tediously repeating... repeating... and repeating runs whilst manually changing parameters.
Excellent.

Only problem is, Repast, once again, seems to be letting me down on documentation! This has to be THE major disadvantage of using this software over others such as MASON (whom several people have suggested I use, but I'm loathe to, considering the time and effort I've spent in learning Repast and the fact that MASON seems to be heavily social simulation focused).

However, there are some other kind people out there who, also noticing the severe lack of Repast documentation, have been amazingly generous by recording and allowing public access to their findings. Pamela Toman, I am very grateful to you for this post about doing batch runs in Repast. Some other useful pages exist including one of Repast Simphony's own online pages found here that outlines the format of how to amend the batch_params.xml file, even if it doesn't go into detail about how to get this to work, or what the file should look like once its been constructed.

Basically, its all a bit more complicated that it needs to be. Repast has an option of a Batch run from the run menu in Eclipse. This requires you to show it where it can find the batch parameters run file (batch_params.xml located in the batch folder within the model architecture in eclipse). I've yet to get to the point of trying this out but it seems that if you just want to run a batch run within eclipse, this MAY be all you need to do.

Exporting the model to run in batch via an external source (i.e. a super-computer) seems much more complicated and there are several files that need amending in order for this to work. So far, I've done the amending, but not been able to test if the export works. Thats next on my list of jobs to do.

Pamela Tomans post outlines all of this, but in brief:

1. The main amendments involved the start_model.bat or start_model.command files (.bat in Windows, .command in Mac/Linux). The model needs to know explicitly where to look for all necessary files, which need to be manually added (running in GUI doesn't require this step). The repast.simphony.repast.RepastMain command also needs to be changed to repast.simphony.batch.BatchMain so it knows to run in batch mode (see Pamela Tomans post for more details on how to amend this file).

2. Actually, what you need to do is create a new start_model.command/bat file. You can call it whatever you want, but if you want the model to be able to run in both GUI and batch, you can't amend the original start_model.command file. If you do, it will no longer run in GUI mode.

3. Now you have added a new file for batch, you need to add this to two other files, so the model knows to look at this file. Here you need the find the installation_coordinator.xml and installation_components.xml files (both within the installer folder of the model architecture in eclipse). Again, more info on Pamela Tomans post.
I have a slight issue with this step however. My installation_coordinator.xml file has a slightly different format to that suggested by Pamela (and others when I googled online). Im still trying to work out where to add the necessary information..... The install_components.xml file was straightforward to amend.

4. Ok, now you should be ready to update the batch_params.xml file. Again, Pamela has a good example on her page. Im currently working through this to get ready to test with a simple one-parameter change and only 5 runs. I'll update once I know more and post my final .xml file.

5. Now comes the tricky bit as far as I can tell. If the batch is to run within repast then you should just be able to choose the batch model run and show it the batch_params.xml file. Again I should be testing this soon.... if the batch is to export and go to a super-computer, then the batch file itself needs to be amended. Not sure where to find this or how to run the batch file outside of repast. Should have some answers here within the month. Fingers crossed.

Useful webpages
Pamela Toman - http://www.pamelatoman.net/blog/tag/batch-runs/
Repast Simphony batch runshttp://repast.sourceforge.net/docs/reference/SIM/Batch%20Runs.html
Repast Simphony batch parametershttp://repast.sourceforge.net/docs/reference/SIM/Batch%20Parameters.html
Repast Parameter Sweeps Getting Startedhttp://repast.sourceforge.net/docs/RepastParameterSweepsGettingStarted.pdf