Class SensorActuator
java.lang.Object
jadex.quickstart.cleanerworld.environment.SensorActuator
The sensor / actuator gives access to the perceived environment
and provides operations to manipulate the environment.
Each cleaner agent should create its own sensor/actuator.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dropWasteInWastebin
(IWaste waste, IWastebin wastebin) Drop a piece of waste.Get the known charging stations.Get the known other cleaners.getSelf()
Get the knowledge about the cleaner itself.Get the current movement target, if any.Get the known waste pieces.Get the known waste pieces.boolean
Check, if it is at day or at night.void
manageChargingstationsIn
(Set<IChargingstation> chargingstations) Use the provided set to manage the known charging station objects.void
manageCleanersIn
(Set<ICleaner> cleaners) Use the provided set to manage the known cleaner objects.void
manageWastebinsIn
(Set<IWastebin> wastebins) Use the provided set to manage the known waste bin objects.void
manageWastesIn
(Set<IWaste> wastes) Use the provided set to manage the known waste objects.void
moveTo
(double x, double y) Move to the given location.void
Move to the given location.void
pickUpWaste
(IWaste waste) Try to pick up some piece of waste.void
recharge
(IChargingstation chargingstation, double level) Recharge a cleaner at a charging station to a desired charging level.
-
Field Details
-
agent
public jadex.execution.IExecutionFeature agentThe agent. Must be public due to Java Reflection Restrictions
-
-
Constructor Details
-
SensorActuator
public SensorActuator()Create a sensor for a new cleaner robot.
-
-
Method Details
-
getSelf
Get the knowledge about the cleaner itself.- Returns:
- The cleaner object.
-
isDaytime
public boolean isDaytime()Check, if it is at day or at night.- Returns:
- true, if at day.
-
getCleaners
Get the known other cleaners.- Returns:
- a Set of Cleaner objects.
-
getWastes
Get the known waste pieces.- Returns:
- a Set of Waste objects.
-
getChargingstations
Get the known charging stations.- Returns:
- a Set of Chargingstation objects.
-
getWastebins
Get the known waste pieces.- Returns:
- a Set of Waste objects.
-
manageWastesIn
Use the provided set to manage the known waste objects. Allows using custom data structures such as BDI belief sets directly. -
manageWastebinsIn
Use the provided set to manage the known waste bin objects. Allows using custom data structures such as BDI belief sets directly. -
manageChargingstationsIn
Use the provided set to manage the known charging station objects. Allows using custom data structures such as BDI belief sets directly. -
manageCleanersIn
Use the provided set to manage the known cleaner objects. Allows using custom data structures such as BDI belief sets directly. -
moveTo
Move to the given location. Blocks until the location is reached or a failure occurs.- Parameters:
location
- The location.
-
moveTo
public 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.
-
recharge
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.
-
getTarget
Get the current movement target, if any.- Returns:
- The target or null when no current target.
-
pickUpWaste
Try to pick up some piece of waste.- Parameters:
waste
- The waste.
-
dropWasteInWastebin
Drop a piece of waste.
-