Class Target
- java.lang.Object
- 
- jadex.bdi.examples.marsworld_classic.LocationObject
- 
- jadex.bdi.examples.marsworld_classic.Target
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 
 public class Target extends LocationObject The target is a map position- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected intcapacityThe actual available capacity.protected static intcntA static instance count.protected intinitialcapacityThe max.protected booleanmarkedWas the target visited.protected intoreThe currently available ore amount.- 
Fields inherited from class jadex.bdi.examples.marsworld_classic.LocationObjectid, location
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCapacity()Getter for capacityintgetInitialcapacity()Getter for initialcapacityintgetOre()Get the amount of ore.intgetOreCapacity()Get the capacity of ore.booleanisMarked()Test if target was visited.booleanisOre()Test if target can produce some ore.voidproduceOre(int ore)Change the amount of ore at the LocationintretrieveOre(int amount)Retrieve some ore amount.voidsetCapacity(int capacity)Setter for capacity.voidsetInitialcapacity(int initialcapacity)Setter for initialcapacity.voidsetMarked()Mark this target as visited.voidsetMarked(boolean marked)Setter for marked.voidsetOre(int ore)Setter for ore.java.lang.StringtoString()Convert the Location to a string representation.- 
Methods inherited from class jadex.bdi.examples.marsworld_classic.LocationObjectequals, getId, getLocation, hashCode, setId, setLocation
 
- 
 
- 
- 
- 
Field Detail- 
oreprotected int ore The currently available ore amount.
 - 
initialcapacityprotected int initialcapacity The max. produceable ore amount.
 - 
capacityprotected int capacity The actual available capacity.
 - 
markedprotected boolean marked Was the target visited.
 - 
cntprotected static int cnt A static instance count.
 
- 
 - 
Constructor Detail- 
Targetpublic Target() Create a new target. Empty bean constructor.
 - 
Targetpublic Target(Location loc, int initialcapacity) Create a new target.
 
- 
 - 
Method Detail- 
produceOrepublic void produceOre(int ore) Change the amount of ore at the Location- Parameters:
- ore- The produced ore.
 
 - 
retrieveOrepublic int retrieveOre(int amount) Retrieve some ore amount.- Parameters:
- amount- The amount.
 
 - 
getOreCapacitypublic int getOreCapacity() Get the capacity of ore.- Returns:
- The amount of Ore
 
 - 
getOrepublic int getOre() Get the amount of ore.- Returns:
- The amount of Ore
 
 - 
setMarkedpublic void setMarked() Mark this target as visited.
 - 
isMarkedpublic boolean isMarked() Test if target was visited.- Returns:
- True if already visited.
 
 - 
isOrepublic boolean isOre() Test if target can produce some ore.- Returns:
- true if target can produce some ore
 
 - 
getCapacitypublic int getCapacity() Getter for capacity- Returns:
- Returns capacity.
 
 - 
setCapacitypublic void setCapacity(int capacity) Setter for capacity.- Parameters:
- capacity- The Target.java value to set
 
 - 
getInitialcapacitypublic int getInitialcapacity() Getter for initialcapacity- Returns:
- Returns initialcapacity.
 
 - 
setInitialcapacitypublic void setInitialcapacity(int initialcapacity) Setter for initialcapacity.- Parameters:
- initialcapacity- The Target.java value to set
 
 - 
setMarkedpublic void setMarked(boolean marked) Setter for marked.- Parameters:
- marked- The Target.java value to set
 
 - 
setOrepublic void setOre(int ore) Setter for ore.- Parameters:
- ore- The Target.java value to set
 
 - 
toStringpublic java.lang.String toString() Convert the Location to a string representation.- Overrides:
- toStringin class- LocationObject
- Returns:
- The string representation.
 
 
- 
 
-