Class Environment
java.lang.Object
jadex.quickstart.cleanerworld.environment.impl.Environment
The environment object for non distributed applications.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChargingStation
(Chargingstation station) Add a charging station.void
addPheromone
(Pheromone pheromone) Add a pheromone.void
Add a piece of waste.void
addWastebin
(Wastebin wastebin) Add a wastebin.static <T extends ILocationObject>
T[]cloneList
(Collection<T> list, Class<T> type) Deep clone a list of objects.createCleaner
(jadex.core.IComponent agent) Get a cleaner object for an agent.void
dropWasteInWastebin
(Cleaner cleaner, Waste waste, Wastebin wastebin) Drop a piece of waste.Get all charging stations.Cleaner[]
Get all cleaners.boolean
Get the daytime.static Environment
Get the singleton.Get all pheromones.getWastebin
(String name) Get a wastebin for a name.Wastebin[]
Get all wastebins.Waste[]
Get all wastes.void
pickupWaste
(Cleaner cleaner, Waste waste) Let a cleaner pick up waste.boolean
removeWaste
(Waste waste) Remove a piece of waste.void
setDaytime
(boolean daytime) Set the daytime.void
updateCleaner
(Cleaner cleaner) Update a cleaner.
-
Method Details
-
getInstance
Get the singleton.- Returns:
- The environment.
-
createCleaner
Get a cleaner object for an agent. Creates a new cleaner object if none exists. -
getDaytime
public boolean getDaytime()Get the daytime.- Returns:
- The current vision.
-
setDaytime
public void setDaytime(boolean daytime) Set the daytime.- Parameters:
daytime
- The daytime.
-
addWaste
Add a piece of waste.- Parameters:
waste
- The new piece of waste.
-
removeWaste
Remove a piece of waste.- Parameters:
waste
- The piece of waste.
-
addWastebin
Add a wastebin.- Parameters:
wastebin
- The new waste bin.
-
addChargingStation
Add a charging station.- Parameters:
station
- The new charging station.
-
addPheromone
Add a pheromone.- Parameters:
pheromone
- The new pheromone.
-
getWastes
Get all wastes.- Returns:
- All wastes.
-
getWastebins
Get all wastebins.- Returns:
- All wastebins.
-
getChargingstations
Get all charging stations.- Returns:
- All stations.
-
getCleaners
Get all cleaners.- Returns:
- All cleaners.
-
getPheromones
Get all pheromones.- Returns:
- All pheromones.
-
updateCleaner
Update a cleaner. -
pickupWaste
Let a cleaner pick up waste. -
dropWasteInWastebin
Drop a piece of waste. -
getWastebin
Get a wastebin for a name.- Returns:
- The wastebin.
-
cloneList
Deep clone a list of objects.
-