public class Zone extends Object implements Believable
Modifier and Type | Field and Description |
---|---|
static double |
stability_front
determines the significance of critical frontier tokens in the stability
value.
|
static double |
stability_inner
determines the significance of inner tokens in the stability value.
|
Constructor and Description |
---|
Zone()
creates an empty zone
|
Modifier and Type | Method and Description |
---|---|
void |
addVertex(Vertex vertex) |
boolean |
contains(AgentToken token)
Looks up an agent token in this zone.
|
boolean |
contains(Vertex vertex)
Looks up a vertex in this zone.
|
boolean |
equals(Object obj) |
LinkedList<Vertex> |
getCriticalFrontier()
gets the frontier vertices.
|
int |
getCriticalFrontierLength()
gets the number of vertices building the critical frontier.
|
LinkedList<AgentToken> |
getCriticalFrontierTokens() |
LinkedList<Vertex> |
getIsolatedVertices() |
LinkedList<Vertex> |
getMostPreciousVertices() |
LinkedList<Vertex> |
getNonCriticalVertices() |
int |
getNumberOfIsolatedVertices() |
int |
getNumberOfTeamAgents() |
int |
getNumberOfTokens() |
int |
getPerceptedValue() |
double |
getStabilityValue() |
String |
getTeam() |
LinkedList<AgentToken> |
getTeamTokens() |
LinkedList<AgentToken> |
getTokens() |
int |
getValue() |
LinkedList<Vertex> |
getVertices() |
LinkedList<Vertex> |
getWeakestCriticalFrontierVertices() |
boolean |
isAdjacentTo(Zone z)
A zone is adjacent to another zone if one vertex out of the one zone is
adjacent to a vertex out of the other zone.
|
boolean |
isCircular() |
boolean |
isEmpty() |
boolean |
isOfTeam(String team) |
boolean |
isOnCriticalFrontier(AgentToken token)
Checks whether an agent is on the critical frontier of this zone.
|
boolean |
isOnCriticalFrontier(Vertex vertex)
Checks whether a vertex is on the critical frontier of this zone.
|
protected void |
setIsolatedVertices(LinkedList<Vertex> isolatedVertices) |
void |
setPerceptedValue(int perceptedValue) |
protected void |
setTeam(String team) |
int |
size() |
apltk.interpreter.data.LogicBelief |
toBelief() |
String |
toString() |
void |
union(Zone z)
unions two zones.
|
void |
update()
updates the fields values.
|
public static double stability_inner
public static double stability_front
public void update()
public boolean isAdjacentTo(Zone z)
z
- the zone to test.true
- if the zones are adjacent to each other,false
- otherwise.public void union(Zone z)
z
- the zone to add to this zone.public boolean contains(Vertex vertex)
vertex
- the vertex of an agent which shall be looked up.true
- if the vertex is in this zone,false
- otherwise.public boolean contains(AgentToken token)
token
- the agent token of an agent which shall be looked up.true
- if the agent is in this zone,false
- otherwise.public boolean isOnCriticalFrontier(Vertex vertex)
vertex
- the vertex which shall be checked.true
- if the agent is on the frontier,false
- otherwise.public boolean isOnCriticalFrontier(AgentToken token)
token
- the agent token which shall be checked.true
- if the agent is on the frontier,false
- otherwise.public int getValue()
public LinkedList<Vertex> getVertices()
public int size()
public boolean isEmpty()
true
, if the zone has no vertices,false
otherwise.public LinkedList<AgentToken> getTokens()
public LinkedList<AgentToken> getTeamTokens()
public int getNumberOfTokens()
public int getNumberOfTeamAgents()
public LinkedList<AgentToken> getCriticalFrontierTokens()
public void addVertex(Vertex vertex)
vertex
- the vertex to add.public double getStabilityValue()
( |inner tokens|
*
stability_inner
+ |critical frontier tokens| *
stability_front
)
/ |vertices|
public int getCriticalFrontierLength()
public LinkedList<Vertex> getCriticalFrontier()
public LinkedList<Vertex> getWeakestCriticalFrontierVertices()
public LinkedList<Vertex> getMostPreciousVertices()
protected void setTeam(String team)
team
- the team to setpublic String getTeam()
public boolean isOfTeam(String team)
team
- the team to checktrue
if the zone is from team
false
otherwisepublic void setPerceptedValue(int perceptedValue)
perceptedValue
- the perceptedValue to setpublic int getPerceptedValue()
public apltk.interpreter.data.LogicBelief toBelief()
toBelief
in interface Believable
public LinkedList<Vertex> getNonCriticalVertices()
protected void setIsolatedVertices(LinkedList<Vertex> isolatedVertices)
isolatedVertices
- the isolated vertices to setpublic LinkedList<Vertex> getIsolatedVertices()
null
, if the zone is not circularpublic int getNumberOfIsolatedVertices()
public boolean isCircular()
true
, if the zone is circularfalse
, otherwiseCopyright © 2013. All Rights Reserved.