Class CleanerAgent.AchieveCleanup
- java.lang.Object
- 
- jadex.bdiv3.examples.cleanerworld.cleaner.CleanerAgent.AchieveCleanup
 
- 
- Enclosing class:
- CleanerAgent
 
 public class CleanerAgent.AchieveCleanup extends java.lang.ObjectAchieve cleanup goals are created for every piece of waste the agent notices. Avoids having multiple goals for the same piece of waste by setting goal to unique. For this purpose the hashcode and equals method need to be implemented.
- 
- 
Constructor SummaryConstructors Constructor Description AchieveCleanup(Waste waste)Create a new goal.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckContext()Suspend the goal when night.booleancheckDrop()Drop the goal when waste is not seen anymore and the agent agent does not carry it.booleancheckTarget()Check if the waste is contained in a wastebin.booleanequals(java.lang.Object obj)Test if equal to other goal.WastegetWaste()Get the waste.inthashCode()Get the hashcode.protected booleaninhibitAchieveCleanUp(CleanerAgent.AchieveCleanup other)Inhibit other achieve cleanup goals that are farer away from the cleaner.java.lang.StringtoString()Get the string representation.
 
- 
- 
- 
Field Detail- 
wasteprotected Waste waste The waste.
 
- 
 - 
Constructor Detail- 
AchieveCleanuppublic AchieveCleanup(Waste waste) Create a new goal.
 
- 
 - 
Method Detail- 
checkContextpublic boolean checkContext() Suspend the goal when night.
 - 
checkDroppublic boolean checkDrop() Drop the goal when waste is not seen anymore and the agent agent does not carry it.
 - 
checkTargetpublic boolean checkTarget() Check if the waste is contained in a wastebin.
 - 
inhibitAchieveCleanUpprotected boolean inhibitAchieveCleanUp(CleanerAgent.AchieveCleanup other) Inhibit other achieve cleanup goals that are farer away from the cleaner.
 - 
getWastepublic Waste getWaste() Get the waste.- Returns:
- The waste.
 
 - 
hashCodepublic int hashCode() Get the hashcode.- Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) Test if equal to other goal.- Overrides:
- equalsin class- java.lang.Object
- Parameters:
- obj- The other object.
- Returns:
- True, if equal.
 
 - 
toStringpublic java.lang.String toString() Get the string representation.- Overrides:
- toStringin class- java.lang.Object
- Returns:
- The string representation.
 
 
- 
 
-