Xholon - Stupid Model 11 - Optimal Movement
What is it
This is the 11th 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 shows how an agent (bug) can identify and rank neighboring cells. Each time step each bug prepares a list of all unoccupied cells within 4 units of itself. The bug then goes through the list to find the cell with the highest food availability. This is where it moves.
This behavior is implemented in the move() method of BugStupidModel11.java. HabitatCellStupidModel11.java implements an inRadius() method that returns all cells within a specified radius.