java.lang.Object
jadex.quickstart.cleanerworld.environment.impl.Environment

public class Environment extends Object
The environment object for non distributed applications.
  • Method Details

    • getInstance

      public static Environment getInstance()
      Get the singleton.
      Returns:
      The environment.
    • createCleaner

      public Cleaner createCleaner(jadex.core.IComponent agent)
      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

      public void addWaste(Waste waste)
      Add a piece of waste.
      Parameters:
      waste - The new piece of waste.
    • removeWaste

      public boolean 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.
    • addPheromone

      public void addPheromone(Pheromone pheromone)
      Add a pheromone.
      Parameters:
      pheromone - The new pheromone.
    • 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.
    • getPheromones

      public Pheromone[] getPheromones()
      Get all pheromones.
      Returns:
      All pheromones.
    • updateCleaner

      public void updateCleaner(Cleaner cleaner)
      Update a cleaner.
    • pickupWaste

      public void pickupWaste(Cleaner cleaner, Waste waste)
      Let a cleaner pick up waste.
    • dropWasteInWastebin

      public void dropWasteInWastebin(Cleaner cleaner, Waste waste, Wastebin wastebin)
      Drop a piece of waste.
    • getWastebin

      public Wastebin getWastebin(String name)
      Get a wastebin for a name.
      Returns:
      The wastebin.
    • cloneList

      public static <T extends ILocationObject> T[] cloneList(Collection<T> list, Class<T> type)
      Deep clone a list of objects.