uchicago.src.repastdemos.hexabugs
Class HexaBugsModel

java.lang.Object
  extended by uchicago.src.sim.engine.SimModelImpl
      extended by uchicago.src.repastdemos.hexabugs.HexaBugsModel
All Implemented Interfaces:
DescriptorContainer, SimEventProducer, SimModel

public class HexaBugsModel
extends SimModelImpl

A translation of the Swarm example simulation Heat Bugs. The heat bugs simulation consists of heat bugs - simple agents that absorb and expel heat and a heatspace which diffuses this heat into the area surrounding the bug. Heat bugs have an ideal temperature and will move about the space in attempt to achieve this idea temperature. Unlike the traditional heat bugs this takes place on a hexagonal space.

Version:
$Revision: 1.1 $ $Date: 2005/08/12 20:04:58 $

Field Summary
 
Fields inherited from class uchicago.src.sim.engine.SimModelImpl
descriptors, modelManipulator
 
Constructor Summary
HexaBugsModel()
           
 
Method Summary
 void begin()
          Begins a simulation run.
 double getDiffusionConstant()
           
 double getEvapRate()
           
 java.lang.String[] getInitParam()
          Gets the names of the initial model parameters to set.
 int getMaxIdealTemp()
           
 int getMaxOutputHeat()
           
 int getMinIdealTemp()
           
 int getMinOutputHeat()
           
 java.lang.String getName()
          Gets the name of the model/simulation.
 int getNumBugs()
           
 float getRandomMoveProbability()
           
 Schedule getSchedule()
          Gets the Schedule created by the model.
 int getWorldXSize()
           
 int getWorldYSize()
           
static void main(java.lang.String[] args)
           
 void setDiffusionConstant(double constant)
           
 void setEvapRate(double rate)
           
 void setMaxIdealTemp(int temp)
           
 void setMaxOutputHeat(int heat)
           
 void setMinIdealTemp(int temp)
           
 void setMinOutputHeat(int heat)
           
 void setNumBugs(int numBugs)
           
 void setRandomMoveProbability(float prob)
           
 void setup()
          Prepares a model for a new run, typically by deallocating objects or setting them to some reasonable default.
 void setWorldXSize(int size)
           
 void setWorldYSize(int size)
           
 void step()
           
 
Methods inherited from class uchicago.src.sim.engine.SimModelImpl
addPropertyListener, addSimEventListener, clearMediaProducers, clearPropertyListeners, fireBooleanPropertyEvent, fireEndSim, fireNumericPropertyEvent, fireObjectPropertyEvent, firePauseSim, fireSimEvent, fireStopSim, fireStringPropertyEvent, generateNewSeed, getController, getMediaProducers, getModelManipulator, getParameterDescriptors, getPropertiesValues, getRngSeed, getTickCount, pause, registerDisplaySurface, registerMediaProducer, removePropertyListener, removeSimEventListener, setController, setRngSeed, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HexaBugsModel

public HexaBugsModel()
Method Detail

step

public void step()

begin

public void begin()
Description copied from interface: SimModel
Begins a simulation run. All initialization, building the model, diplay, etc. should take place here. This method is called whenever the start button (or the step button if the run has not yet begun) is clicked. If running in batch mode this is called to kick off a new simulation run.


setup

public void setup()
Description copied from interface: SimModel
Prepares a model for a new run, typically by deallocating objects or setting them to some reasonable default. Called whenever the setup button is clicked or if operating in batch mode whenever a single run has ended in preparation for the next. Also called when the model is first loaded.


getInitParam

public java.lang.String[] getInitParam()
Description copied from interface: SimModel
Gets the names of the initial model parameters to set. These names must have get and set methods supplied by the model. For example, for the parameter maxAge, the model must have getMaxAge and setMaxAge methods.

Returns:
a String[] of the initial parameter names

getSchedule

public Schedule getSchedule()
Description copied from interface: SimModel
Gets the Schedule created by the model.

Returns:
the schedule created by the model

getName

public java.lang.String getName()
Description copied from interface: SimModel
Gets the name of the model/simulation.

Returns:
the name of the model/simulation

getNumBugs

public int getNumBugs()

setNumBugs

public void setNumBugs(int numBugs)

getEvapRate

public double getEvapRate()

setEvapRate

public void setEvapRate(double rate)

getDiffusionConstant

public double getDiffusionConstant()

setDiffusionConstant

public void setDiffusionConstant(double constant)

getWorldXSize

public int getWorldXSize()

setWorldXSize

public void setWorldXSize(int size)

getWorldYSize

public int getWorldYSize()

setWorldYSize

public void setWorldYSize(int size)

getMinIdealTemp

public int getMinIdealTemp()

setMinIdealTemp

public void setMinIdealTemp(int temp)

getMaxIdealTemp

public int getMaxIdealTemp()

setMaxIdealTemp

public void setMaxIdealTemp(int temp)

getMinOutputHeat

public int getMinOutputHeat()

setMinOutputHeat

public void setMinOutputHeat(int heat)

getMaxOutputHeat

public int getMaxOutputHeat()

setMaxOutputHeat

public void setMaxOutputHeat(int heat)

getRandomMoveProbability

public float getRandomMoveProbability()

setRandomMoveProbability

public void setRandomMoveProbability(float prob)

main

public static void main(java.lang.String[] args)