|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmas.agentsHempelsSofa.data.zone.ZoneManager
public class ZoneManager
An implementation of a zone manager which shall keep all zones up to date. it
can be created and there is a single method update()
to update all
zones.
Constructor Summary | |
---|---|
ZoneManager(Graph graph)
Creates a new zone manager. |
Method Summary | |
---|---|
void |
addAllIsolatedVertices()
adds all isolated vertices to each zone. |
void |
computeDominatingTeams()
looks up which vertex is dominated by which ownTeam. |
void |
createElementaryNeighboringZones()
creates elementary zones for a team out of each vertex, if the following conditioned are complied with. |
void |
createElementaryZones()
creates elementary zones for each dominated vertex and saves these in zones . |
void |
determineTeams(java.lang.String[] dominatingTeams)
computes a list of all different teams which are dominating at least one vertex. |
boolean |
enemiesSpotted()
|
Zone |
getBiggestEnemyZone()
|
Zone |
getBiggestZone()
|
Zone |
getMostPreciousEnemyZone()
|
Zone |
getMostPreciousZone()
|
java.util.LinkedList<java.lang.String> |
getTeams()
|
int |
getValue()
|
int |
getValue(AgentToken agent)
|
int |
getValue(Vertex vertex)
|
Zone |
getZone(AgentToken agent)
|
Zone |
getZone(Vertex vertex)
|
java.util.LinkedList<Zone> |
getZones()
|
boolean |
isInMostPreciousZone(Vertex vertex)
|
void |
setOwnTeam(java.lang.String ownTeam)
|
void |
setTeams(java.util.LinkedList<java.lang.String> teams)
|
void |
setZones(java.util.LinkedList<Zone> zones)
|
java.util.LinkedList<apltk.interpreter.data.LogicBelief> |
toBeliefs()
|
java.lang.String |
toString()
|
void |
uniteAllNeighboringZones()
unites all neighboring zones to one zone in zones . |
void |
update()
updates the zone manager. this should be executed everytimes after updating the graph and agent tokens. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ZoneManager(Graph graph)
graph
.
graph
- the graph the zones shall refer to.ownTeam
- the team of the agent which creates this manager.Method Detail |
---|
public void setOwnTeam(java.lang.String ownTeam)
public void update()
public java.lang.String toString()
toString
in class java.lang.Object
public void computeDominatingTeams()
public void determineTeams(java.lang.String[] dominatingTeams)
dominatingTeams
- the array which is a mapping: graph.vertices(i) ->
dominatingTeam(i)public void createElementaryZones()
zones
.
public void createElementaryNeighboringZones()
public void uniteAllNeighboringZones()
zones
.
public void addAllIsolatedVertices()
public int getValue()
public int getValue(Vertex vertex)
vertex
- the vertex of one zone.
vertex
belongs to. if vertex
is in no zone the value will be 0.public int getValue(AgentToken agent)
agent
- the agent token of one zone
agent
is positioned in. if
agent
is in no zone the value will be 0.public Zone getZone(Vertex vertex)
vertex
- the vertex of one zone.
vertex
belongs to. if the vertex
is
in no zone the return value will be null
.public Zone getZone(AgentToken agent)
agent
- the agent token of one zone.
agent
is positioned in. if the agent
is in no zone the return value will be null
.public Zone getMostPreciousZone()
public Zone getMostPreciousEnemyZone()
public Zone getBiggestZone()
public Zone getBiggestEnemyZone()
public boolean enemiesSpotted()
true
, if there are enemy agent tokens on the graphfalse
, otherwise.public java.util.LinkedList<Zone> getZones()
public java.util.LinkedList<apltk.interpreter.data.LogicBelief> toBeliefs()
public boolean isInMostPreciousZone(Vertex vertex)
vertex
- the vertex
true
, if the vertex
is in the most precious
zone of the own team.false
, otherwise.public void setZones(java.util.LinkedList<Zone> zones)
zones
- the zones to setpublic void setTeams(java.util.LinkedList<java.lang.String> teams)
teams
- the teams to setpublic java.util.LinkedList<java.lang.String> getTeams()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |