Jadex 0.96

jadex.examples.cleanerworld.multi
Class Environment

java.lang.Object
  extended by jadex.examples.cleanerworld.multi.Environment
All Implemented Interfaces:
IEnvironment

public class Environment
extends Object
implements IEnvironment

The environment object for non distributed applications.


Field Summary
 SimplePropertyChangeSupport pcs
          The helper object for bean events.
 
Constructor Summary
Environment()
          Create a new environment.
 
Method Summary
 void addChargingStation(Chargingstation station)
          Add a charging station.
 void addCleaner(Cleaner cleaner)
          Add a cleaner.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
 void addWaste(Waste waste)
          Add a piece of waste.
 void addWastebin(Wastebin wastebin)
          Add a wastebin.
 void clear()
          Clear the environment.
 boolean dropWasteInWastebin(Waste waste, Wastebin wastebin)
          Drop a piece of waste.
 int getAge(Cleaner cleaner)
          Get the age of a cleaner.
 Chargingstation[] getChargingstations()
          Get all charging stations.
 Cleaner[] getCleaners()
          Get all cleaners.
 Vision getCompleteVision()
          Get the complete vision.
 boolean getDaytime()
          Get the daytime.
static Environment getInstance()
          Get the singleton.
 Vision getVision(Cleaner cleaner)
          Get the current vision.
 Wastebin getWastebin(String name)
          Get a wastebin for a name.
 Wastebin[] getWastebins()
          Get all wastebins.
 Waste[] getWastes()
          Get all wastes.
 boolean pickUpWaste(Waste waste)
          Try to pick up some piece of waste.
 void removeCleaner(Cleaner cleaner)
          Remove a cleaner.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list.
 void removeWaste(Waste waste)
          Remove a piece of waste.
 void setDaytime(boolean daytime)
          Set the daytime.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pcs

public SimplePropertyChangeSupport pcs
The helper object for bean events.

Constructor Detail

Environment

public Environment()
Create a new environment.

Method Detail

getInstance

public static Environment getInstance()
Get the singleton.

Returns:
The environment.

getVision

public Vision getVision(Cleaner cleaner)
Get the current vision.

Specified by:
getVision in interface IEnvironment
Parameters:
cleaner - The cleaner.
Returns:
The current vision, null if failure.

pickUpWaste

public boolean pickUpWaste(Waste waste)
Try to pick up some piece of waste.

Specified by:
pickUpWaste in interface IEnvironment
Parameters:
waste - The waste.
Returns:
True if the waste could be picked up.

dropWasteInWastebin

public boolean dropWasteInWastebin(Waste waste,
                                   Wastebin wastebin)
Drop a piece of waste.

Specified by:
dropWasteInWastebin in interface IEnvironment
Parameters:
waste - The piece of waste.
wastebin - The waste bin.

getCompleteVision

public Vision getCompleteVision()
Get the complete vision.

Returns:
The current vision, null if failure.

getDaytime

public boolean getDaytime()
Get the daytime.

Returns:
The current vision.

setDaytime

public void setDaytime(boolean daytime)
Set the daytime.

Parameters:
daytime - The daytime.

addCleaner

public void addCleaner(Cleaner cleaner)
Add a cleaner.

Parameters:
cleaner - The cleaner.

removeCleaner

public void removeCleaner(Cleaner cleaner)
Remove a cleaner.

Parameters:
cleaner - The cleaner.

addWaste

public void addWaste(Waste waste)
Add a piece of waste.

Parameters:
waste - The new piece of waste.

removeWaste

public void removeWaste(Waste waste)
Remove a piece of waste.

Parameters:
waste - The piece of waste.

addWastebin

public void addWastebin(Wastebin wastebin)
Add a wastebin.

Parameters:
wastebin - The new waste bin.

addChargingStation

public void addChargingStation(Chargingstation station)
Add a charging station.

Parameters:
station - The new charging station.

getWastes

public Waste[] getWastes()
Get all wastes.

Returns:
All wastes.

getWastebins

public Wastebin[] getWastebins()
Get all wastebins.

Returns:
All wastebins.

getChargingstations

public Chargingstation[] getChargingstations()
Get all charging stations.

Returns:
All stations.

getCleaners

public Cleaner[] getCleaners()
Get all cleaners.

Returns:
All cleaners.

getWastebin

public Wastebin getWastebin(String name)
Get a wastebin for a name.

Returns:
The wastebin.

clear

public void clear()
Clear the environment.


getAge

public int getAge(Cleaner cleaner)
Get the age of a cleaner.

Returns:
The age.

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.

Parameters:
listener - The PropertyChangeListener to be added.

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Parameters:
listener - The PropertyChangeListener to be removed.

Jadex 0.96

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.