|
Jadex 0.96 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjadex.examples.garbagecollector.Environment
public class Environment
The environment.
Field Summary | |
---|---|
static String |
BURNER
The world object/agent types. |
static String |
COLLECTOR
|
static String |
DOWN
|
static String |
GARBAGE
|
static String |
LEFT
|
SimplePropertyChangeSupport |
pcs
The helper object for bean events. |
static String |
RIGHT
|
static String |
UP
The directions. |
Constructor Summary | |
---|---|
Environment(int size)
Create an environment. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
void |
addWorldObject(String type,
String name,
Position pos)
Add an object to the environment. |
void |
burn(String name)
Burn a piece of garbage. |
static void |
clearInstance()
Clear the singleton instance. |
void |
drop(String name)
Drop a piece of garbage. |
Position |
getBurnerPosition()
Get the position of a burner. |
String[] |
getGarbages(Position pos)
Get all world objects of a position. |
int |
getGridSize()
Get the grid size. |
static Environment |
getInstance(String type,
String name)
Get a singleton instance. |
Position |
getPosition(String name)
Get the position of an object. |
void |
go(String name,
String dir)
Go in a specific direction. |
boolean |
hasGarbage(String name)
Test if an agent has garbage. |
boolean |
isBurnerPresent(Position pos)
Is a burner on the map. |
boolean |
isDirty(Position pos)
Test if a position is dirty. |
boolean |
pickup(String name)
Pickup a piece of garbage. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String UP
public static final String DOWN
public static final String LEFT
public static final String RIGHT
public static final String BURNER
public static final String COLLECTOR
public static final String GARBAGE
public SimplePropertyChangeSupport pcs
Constructor Detail |
---|
public Environment(int size)
Method Detail |
---|
public static Environment getInstance(String type, String name)
public static void clearInstance()
public void addWorldObject(String type, String name, Position pos)
public void go(String name, String dir)
public void drop(String name)
name
- The name of the agent that want to drop.public boolean pickup(String name)
name
- The name of the agent that want to pick up.public void burn(String name)
name
- The name of the agent that want to drop.public boolean isDirty(Position pos)
pos
- The position.
public boolean hasGarbage(String name)
name
- The agent name.
public Position getPosition(String name)
name
- The name of the agent.
public int getGridSize()
public Position getBurnerPosition()
public boolean isBurnerPresent(Position pos)
pos
- The position to test.
public String[] getGarbages(Position pos)
pos
- The position.
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener to be added.public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removed.
|
Jadex 0.96 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.