Class SensorActuator
- java.lang.Object
- 
- jadex.quickstart.cleanerworld.environment.SensorActuator
 
- 
 public class SensorActuator extends java.lang.ObjectThe sensor / actuator gives access to the perceived environment and provides operations to manipulate the environment. Each cleaner agent should create its own sensor/actuator.
- 
- 
Constructor SummaryConstructors Constructor Description SensorActuator()Create a sensor for a new cleaner robot.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddropWasteInWastebin(IWaste waste, IWastebin wastebin)Drop a piece of waste.java.util.Set<IChargingstation>getChargingstations()Get the known charging stations.java.util.Set<ICleaner>getCleaners()Get the known other cleaners.ICleanergetSelf()Get the knowledge about the cleaner itself.ILocationgetTarget()Get the current movement target, if any.java.util.Set<IWastebin>getWastebins()Get the known waste pieces.java.util.Set<IWaste>getWastes()Get the known waste pieces.booleanisDaytime()Check, if it is at day or at night.voidmanageChargingstationsIn(java.util.Set<IChargingstation> chargingstations)Use the provided set to manage the known charging station objects.voidmanageCleanersIn(java.util.Set<ICleaner> cleaners)Use the provided set to manage the known cleaner objects.voidmanageWastebinsIn(java.util.Set<IWastebin> wastebins)Use the provided set to manage the known waste bin objects.voidmanageWastesIn(java.util.Set<IWaste> wastes)Use the provided set to manage the known waste objects.voidmoveTo(double x, double y)Move to the given location.voidmoveTo(ILocation location)Move to the given location.voidpickUpWaste(IWaste waste)Try to pick up some piece of waste.voidrecharge(IChargingstation chargingstation, double level)Recharge a cleaner at a charging station to a desired charging level.
 
- 
- 
- 
Method Detail- 
getSelfpublic ICleaner getSelf() Get the knowledge about the cleaner itself.- Returns:
- The cleaner object.
 
 - 
isDaytimepublic boolean isDaytime() Check, if it is at day or at night.- Returns:
- true, if at day.
 
 - 
getCleanerspublic java.util.Set<ICleaner> getCleaners() Get the known other cleaners.- Returns:
- a Set of Cleaner objects.
 
 - 
getWastespublic java.util.Set<IWaste> getWastes() Get the known waste pieces.- Returns:
- a Set of Waste objects.
 
 - 
getChargingstationspublic java.util.Set<IChargingstation> getChargingstations() Get the known charging stations.- Returns:
- a Set of Chargingstation objects.
 
 - 
getWastebinspublic java.util.Set<IWastebin> getWastebins() Get the known waste pieces.- Returns:
- a Set of Waste objects.
 
 - 
manageWastesInpublic void manageWastesIn(java.util.Set<IWaste> wastes) Use the provided set to manage the known waste objects. Allows using custom data structures such as BDI belief sets directly.
 - 
manageWastebinsInpublic void manageWastebinsIn(java.util.Set<IWastebin> wastebins) Use the provided set to manage the known waste bin objects. Allows using custom data structures such as BDI belief sets directly.
 - 
manageChargingstationsInpublic void manageChargingstationsIn(java.util.Set<IChargingstation> chargingstations) Use the provided set to manage the known charging station objects. Allows using custom data structures such as BDI belief sets directly.
 - 
manageCleanersInpublic void manageCleanersIn(java.util.Set<ICleaner> cleaners) Use the provided set to manage the known cleaner objects. Allows using custom data structures such as BDI belief sets directly.
 - 
moveTopublic void moveTo(ILocation location) Move to the given location. Blocks until the location is reached or a failure occurs.- Parameters:
- location- The location.
 
 - 
moveTopublic void moveTo(double x, double y)Move to the given location. Blocks until the location is reached or a failure occurs.- Parameters:
- x- X coordinate.
- y- Y coordinate.
 
 - 
rechargepublic void recharge(IChargingstation chargingstation, double level) Recharge a cleaner at a charging station to a desired charging level. The cleaner needs to be at the location of the charging station Note, the charging rate gets slower over 70% charge state.- Parameters:
- chargingstation- The charging station to recharge at.
- level- The desired charging level between 0 and 1.
 
 - 
getTargetpublic ILocation getTarget() Get the current movement target, if any.- Returns:
- The target or null when no current target.
 
 - 
pickUpWastepublic void pickUpWaste(IWaste waste) Try to pick up some piece of waste.- Parameters:
- waste- The waste.
 
 
- 
 
-