|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.repastdemos.mousetrap.MouseTrap
public class MouseTrap
The "mousetrap" agent object. A mousetrap contains some n number of balls when triggered, it will throw these balls into the air to land on other mousetraps. This is implemented in the trigger method. There are no actual ball objects but their effect is simulated by finding some n number of neighbors where n is the number of "balls" and scheduling their trigger methods for some time in the "near" future.
MouseTrapModel| Constructor Summary | |
|---|---|
MouseTrap(int x,
int y,
MouseTrapModel model,
Object2DTorus space)
|
|
| Method Summary | |
|---|---|
void |
draw(SimGraphics g)
Invoked when the object should draw itself |
java.util.Hashtable |
getParameterDescriptors()
Returns a java.util.Hashtable whose keys are parameters names, and whose values are uchicago.src.reflector.PropertyDescriptors. |
int |
getX()
Gets the x coordinate of this drawable. |
int |
getY()
Gets the y coordinate of the this drawable. |
boolean |
isTriggered()
|
void |
setTriggered(boolean val)
|
void |
trigger()
Triggers this MouseTrap. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MouseTrap(int x,
int y,
MouseTrapModel model,
Object2DTorus space)
| Method Detail |
|---|
public boolean isTriggered()
public void setTriggered(boolean val)
public void trigger()
public int getX()
Drawable
getX in interface Drawablepublic int getY()
Drawable
getY in interface Drawablepublic void draw(SimGraphics g)
Drawable
draw in interface Drawablepublic java.util.Hashtable getParameterDescriptors()
DescriptorContainer
getParameterDescriptors in interface DescriptorContainer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||