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 Summary
Fields Modifier and Type Field Description protected intcapacityThe actual available capacity.protected static intcntA static instance count.protected intinitialcapacityThe max. produceable ore amount.protected booleanmarkedWas the target visited.protected intoreThe currently available ore amount.-
Fields inherited from class jadex.bdi.examples.marsworld_classic.LocationObject
id, location
-
-
Method Summary
All 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.LocationObject
equals, getId, getLocation, hashCode, setId, setLocation
-
-
-
-
Field Detail
-
ore
protected int ore
The currently available ore amount.
-
initialcapacity
protected int initialcapacity
The max. produceable ore amount.
-
capacity
protected int capacity
The actual available capacity.
-
marked
protected boolean marked
Was the target visited.
-
cnt
protected static int cnt
A static instance count.
-
-
Constructor Detail
-
Target
public Target()
Create a new target. Empty bean constructor.
-
Target
public Target(Location loc, int initialcapacity)
Create a new target.
-
-
Method Detail
-
produceOre
public void produceOre(int ore)
Change the amount of ore at the Location- Parameters:
ore- The produced ore.
-
retrieveOre
public int retrieveOre(int amount)
Retrieve some ore amount.- Parameters:
amount- The amount.
-
getOreCapacity
public int getOreCapacity()
Get the capacity of ore.- Returns:
- The amount of Ore
-
getOre
public int getOre()
Get the amount of ore.- Returns:
- The amount of Ore
-
setMarked
public void setMarked()
Mark this target as visited.
-
isMarked
public boolean isMarked()
Test if target was visited.- Returns:
- True if already visited.
-
isOre
public boolean isOre()
Test if target can produce some ore.- Returns:
- true if target can produce some ore
-
getCapacity
public int getCapacity()
Getter for capacity- Returns:
- Returns capacity.
-
setCapacity
public void setCapacity(int capacity)
Setter for capacity.- Parameters:
capacity- The Target.java value to set
-
getInitialcapacity
public int getInitialcapacity()
Getter for initialcapacity- Returns:
- Returns initialcapacity.
-
setInitialcapacity
public void setInitialcapacity(int initialcapacity)
Setter for initialcapacity.- Parameters:
initialcapacity- The Target.java value to set
-
setMarked
public void setMarked(boolean marked)
Setter for marked.- Parameters:
marked- The Target.java value to set
-
setOre
public void setOre(int ore)
Setter for ore.- Parameters:
ore- The Target.java value to set
-
toString
public java.lang.String toString()
Convert the Location to a string representation.- Overrides:
toStringin classLocationObject- Returns:
- The string representation.
-
-