uchicago.src.repastdemos.heatBugs
Class HeatBug

java.lang.Object
  extended by uchicago.src.repastdemos.heatBugs.HeatBug
All Implemented Interfaces:
DescriptorContainer, Drawable

public class HeatBug
extends java.lang.Object
implements Drawable, DescriptorContainer

The agent for the Heat Bugs simulation. This pretty much follows the Swarm code.

Version:
$Revision: 1.1 $ $Date: 2005/08/12 20:04:54 $
Author:
Swarm Project and Nick Collier
See Also:
HeatBugsModel

Constructor Summary
HeatBug(HeatSpace space, Object2DTorus world, int x, int y, int idealTemp, int outputHeat, float randomMoveProb)
           
 
Method Summary
 void draw(SimGraphics g)
          Invoked when the object should draw itself
 boolean getBDExample()
           
 int getIdealTemp()
           
 int getOutputHeat()
           
 java.util.Hashtable getParameterDescriptors()
          Returns a java.util.Hashtable whose keys are parameters names, and whose values are uchicago.src.reflector.PropertyDescriptors.
 float getRandomMoveProb()
           
 double getUnhappiness()
           
 int getX()
          Gets the x coordinate of this drawable.
 int getY()
          Gets the y coordinate of the this drawable.
 void incrementOutputHeat(int increment)
           
 void setBDExample(boolean val)
           
 void setIdealTemp(int idealTemp)
           
 void setOutputHeat(int outputHeat)
           
 void setRandomMoveProb(float f)
           
 void setUnhappiness(double value)
           
 void setX(int x)
           
 void setXY(int x, int y)
           
 void setY(int y)
           
 void step()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeatBug

public HeatBug(HeatSpace space,
               Object2DTorus world,
               int x,
               int y,
               int idealTemp,
               int outputHeat,
               float randomMoveProb)
Method Detail

setXY

public void setXY(int x,
                  int y)

step

public void step()

getUnhappiness

public double getUnhappiness()

setUnhappiness

public void setUnhappiness(double value)

getX

public int getX()
Description copied from interface: Drawable
Gets the x coordinate of this drawable. Note that this should return the x coordinate in some space, not necessarily a screen coordinate.

Specified by:
getX in interface Drawable

setX

public void setX(int x)

getY

public int getY()
Description copied from interface: Drawable
Gets the y coordinate of the this drawable. Note that this should return the y coordinate in some space, not necessarily a screen coordinate.

Specified by:
getY in interface Drawable

setY

public void setY(int y)

getIdealTemp

public int getIdealTemp()

setIdealTemp

public void setIdealTemp(int idealTemp)

getOutputHeat

public int getOutputHeat()

setOutputHeat

public void setOutputHeat(int outputHeat)

incrementOutputHeat

public void incrementOutputHeat(int increment)

getRandomMoveProb

public float getRandomMoveProb()

setRandomMoveProb

public void setRandomMoveProb(float f)

setBDExample

public void setBDExample(boolean val)

getBDExample

public boolean getBDExample()

getParameterDescriptors

public java.util.Hashtable getParameterDescriptors()
Description copied from interface: DescriptorContainer
Returns a java.util.Hashtable whose keys are parameters names, and whose values are uchicago.src.reflector.PropertyDescriptors.

Specified by:
getParameterDescriptors in interface DescriptorContainer

draw

public void draw(SimGraphics g)
Description copied from interface: Drawable
Invoked when the object should draw itself

Specified by:
draw in interface Drawable