Class CleanerAgent
- java.lang.Object
-
- jadex.bdiv3.examples.cleanerworld.cleaner.CleanerAgent
-
public class CleanerAgent extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classCleanerAgent.AchieveCleanupAchieve cleanup goals are created for every piece of waste the agent notices.classCleanerAgent.AchieveDropWasteclassCleanerAgent.AchieveMoveToThe goal is used to move to a specific location.classCleanerAgent.AchievePickupWasteGoal for picking up a piece of waste.classCleanerAgent.DropWasteActionclassCleanerAgent.GetVisionActionclassCleanerAgent.MaintainBatteryLoadedGoal for keeping the battery loaded.classCleanerAgent.PerformLookForWasteGoal that lets the cleaner look for waste.classCleanerAgent.PerformMemorizePositionsclassCleanerAgent.PerformPatrolGoal that lets the agent perform patrol rounds.classCleanerAgent.PickupWasteActionclassCleanerAgent.QueryChargingStationclassCleanerAgent.QueryWastebin
-
Field Summary
Fields Modifier and Type Field Description protected IInternalAccessagentThe bdi agent.protected WastecarriedwasteThe carried waste (or null).protected java.util.Set<Chargingstation>chargingstationsThe known set of chargingstation.protected java.util.Set<Cleaner>cleanersThe known set of other cleaners.protected booleandaytimeThe flag if it is daytime or night.protected IEnvironmentenvironmentThe virtual environment of the cleaner.protected doublemy_chargestateThe chargestate.protected Locationmy_locationThe location of the cleaner.protected doublemy_speedThe speed of the cleaner.protected doublemy_visionThe vision.protected java.util.List<Location>patrolpointsThe patrol points.protected Tuple2<java.lang.Integer,java.lang.Integer>rasterThe raster for memorizing positions.protected java.util.Set<MapPoint>visited_positionsThe visited positions.protected java.util.Set<Wastebin>wastebinsThe known set of wastebins.protected java.util.Set<Waste>wastesThe set of wastes.
-
Constructor Summary
Constructors Constructor Description CleanerAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbody()The agent body.IInternalAccessgetAgent()Get the agent.WastegetCarriedWaste()Get the carriedwaste.java.util.Set<Chargingstation>getChargingStations()Get the chargingstations.java.util.Set<Cleaner>getCleaners()Get the cleaners.IEnvironmentgetEnvironment()Get the environment.protected java.util.List<LocationObject>getInVisionObjects()protected java.util.List<MapPoint>getMaxQuantity()doublegetMyChargestate()Get the my_chargestate.LocationgetMyLocation()Get the my_location.doublegetMySpeed()Get the my_speed.doublegetMyVision()Get the my_vision.java.util.List<Location>getPatrolPoints()Get the patrolpoints.Tuple2<java.lang.Integer,java.lang.Integer>getRaster()Get the raster.java.util.Set<MapPoint>getVisitedPositions()Get the visited_positions.java.util.Set<Wastebin>getWastebins()Get the wastebins.java.util.Set<Waste>getWastes()Get the wastes.booleanisDaytime()Get the daytime.voidsetCarriedwaste(Waste carriedwaste)Set the carriedwaste.voidsetDaytime(boolean daytime)Set the daytime.voidsetMyChargestate(double mychargestate)Set the my_chargestate.voidsetMyLocation(Location mylocation)Set the my_location.protected IFuture<java.lang.Void>updateVision(IPlan rplan)
-
-
-
Field Detail
-
agent
protected IInternalAccess agent
The bdi agent. Automatically injected
-
environment
protected IEnvironment environment
The virtual environment of the cleaner.
-
wastes
protected java.util.Set<Waste> wastes
The set of wastes.
-
wastebins
protected java.util.Set<Wastebin> wastebins
The known set of wastebins.
-
chargingstations
protected java.util.Set<Chargingstation> chargingstations
The known set of chargingstation.
-
cleaners
protected java.util.Set<Cleaner> cleaners
The known set of other cleaners.
-
raster
protected Tuple2<java.lang.Integer,java.lang.Integer> raster
The raster for memorizing positions.
-
visited_positions
protected java.util.Set<MapPoint> visited_positions
The visited positions.
-
daytime
protected boolean daytime
The flag if it is daytime or night.
-
my_location
protected Location my_location
The location of the cleaner.
-
my_speed
protected double my_speed
The speed of the cleaner.
-
my_vision
protected double my_vision
The vision.
-
my_chargestate
protected double my_chargestate
The chargestate.
-
carriedwaste
protected Waste carriedwaste
The carried waste (or null).
-
patrolpoints
protected java.util.List<Location> patrolpoints
The patrol points.
-
-
Method Detail
-
getInVisionObjects
protected java.util.List<LocationObject> getInVisionObjects()
-
body
public void body()
The agent body.
-
getEnvironment
public IEnvironment getEnvironment()
Get the environment.- Returns:
- The environment.
-
getWastes
public java.util.Set<Waste> getWastes()
Get the wastes.- Returns:
- The wastes.
-
getWastebins
public java.util.Set<Wastebin> getWastebins()
Get the wastebins.- Returns:
- The wastebins.
-
getChargingStations
public java.util.Set<Chargingstation> getChargingStations()
Get the chargingstations.- Returns:
- The chargingstations.
-
getCleaners
public java.util.Set<Cleaner> getCleaners()
Get the cleaners.- Returns:
- The cleaners.
-
getRaster
public Tuple2<java.lang.Integer,java.lang.Integer> getRaster()
Get the raster.- Returns:
- The raster.
-
getVisitedPositions
public java.util.Set<MapPoint> getVisitedPositions()
Get the visited_positions.- Returns:
- The visited_positions.
-
isDaytime
public boolean isDaytime()
Get the daytime.- Returns:
- The daytime.
-
setDaytime
public void setDaytime(boolean daytime)
Set the daytime.- Parameters:
daytime- The daytime to set.
-
getMyLocation
public Location getMyLocation()
Get the my_location.- Returns:
- The my_location.
-
setMyLocation
public void setMyLocation(Location mylocation)
Set the my_location.- Parameters:
my_location- The my_location to set.
-
getMySpeed
public double getMySpeed()
Get the my_speed.- Returns:
- The my_speed.
-
getMyVision
public double getMyVision()
Get the my_vision.- Returns:
- The my_vision.
-
getMyChargestate
public double getMyChargestate()
Get the my_chargestate.- Returns:
- The my_chargestate.
-
setMyChargestate
public void setMyChargestate(double mychargestate)
Set the my_chargestate.- Parameters:
my_chargestate- The my_chargestate to set.
-
getCarriedWaste
public Waste getCarriedWaste()
Get the carriedwaste.- Returns:
- The carriedwaste.
-
setCarriedwaste
public void setCarriedwaste(Waste carriedwaste)
Set the carriedwaste.- Parameters:
carriedwaste- The carriedwaste to set.
-
getPatrolPoints
public java.util.List<Location> getPatrolPoints()
Get the patrolpoints.- Returns:
- The patrolpoints.
-
getAgent
public IInternalAccess getAgent()
Get the agent.- Returns:
- The agent.
-
getMaxQuantity
protected java.util.List<MapPoint> getMaxQuantity()
-
-