Xholon - Stupid Model 16 - Predators
What is it
This is the last in a series of 16 "Stupid Models". It's intended as a starting point for learning how to develop grid and agent-based models using Xholon. It can also be used to compare Xholon with other agent-based modeling tools that have also implemented the Stupid Model series.
This model introduces 200 predators that implement a hunt() method. Each time step each predator looks through a shuffled list of its immediate cell neighbors. It eats the first bug it finds in that list, and then moves into that habitat cell.
Xholon features
New xholon classes Predators and Predator are added to StupidModel16_InheritanceHierarchy.xml and CeStupidModel16.java. New instances of these xholon classes are added to StupidModel16_CompositeStructureHierarchy.xml. StupidModel16_ClassDetails.xml specifies that Predators is implemented by QueueStupidModel16.java. So in this model, there will be one queue to hold bugs and a second queue to hold predators.
BugStupidModel16.java implements both the Predator and the Bug behaviors, including hunt().
Credits and references
Railsback, S., Lytinen, S., Grimm, V. (2005). StupidModel and Extensions: A Template and Teaching Tool for Agent-based Modeling Platforms.