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 int
capacity
The actual available capacity.protected static int
cnt
A static instance count.protected int
initialcapacity
The max.protected boolean
marked
Was the target visited.protected int
ore
The 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 int
getCapacity()
Getter for capacityint
getInitialcapacity()
Getter for initialcapacityint
getOre()
Get the amount of ore.int
getOreCapacity()
Get the capacity of ore.boolean
isMarked()
Test if target was visited.boolean
isOre()
Test if target can produce some ore.void
produceOre(int ore)
Change the amount of ore at the Locationint
retrieveOre(int amount)
Retrieve some ore amount.void
setCapacity(int capacity)
Setter for capacity.void
setInitialcapacity(int initialcapacity)
Setter for initialcapacity.void
setMarked()
Mark this target as visited.void
setMarked(boolean marked)
Setter for marked.void
setOre(int ore)
Setter for ore.java.lang.String
toString()
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:
toString
in classLocationObject
- Returns:
- The string representation.
-
-