Constructor and Description |
---|
ZoneManager(Graph graph)
Creates a new zone manager.
|
Modifier and Type | Method and Description |
---|---|
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(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() |
LinkedList<String> |
getTeams() |
int |
getValue() |
int |
getValue(AgentToken agent) |
int |
getValue(Vertex vertex) |
Zone |
getZone(AgentToken agent) |
Zone |
getZone(Vertex vertex) |
LinkedList<Zone> |
getZones() |
boolean |
isInMostPreciousZone(Vertex vertex) |
void |
setOwnTeam(String ownTeam) |
void |
setTeams(LinkedList<String> teams) |
void |
setZones(LinkedList<Zone> zones) |
LinkedList<apltk.interpreter.data.LogicBelief> |
toBeliefs() |
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.
|
public ZoneManager(Graph graph)
graph
.graph
- the graph the zones shall refer to.ownTeam
- the team of the agent which creates this manager.public void setOwnTeam(String ownTeam)
public void update()
public void computeDominatingTeams()
public void determineTeams(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 zoneagent
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 LinkedList<Zone> getZones()
public LinkedList<apltk.interpreter.data.LogicBelief> toBeliefs()
public boolean isInMostPreciousZone(Vertex vertex)
vertex
- the vertextrue
, if the vertex
is in the most precious
zone of the own team.false
, otherwise.public void setZones(LinkedList<Zone> zones)
zones
- the zones to setpublic void setTeams(LinkedList<String> teams)
teams
- the teams to setpublic LinkedList<String> getTeams()
Copyright © 2013. All Rights Reserved.