public class Vertex extends Object implements Comparable<Vertex>, Believable
Modifier and Type | Field and Description |
---|---|
static int |
UNPROBED_VALUE |
Constructor and Description |
---|
Vertex(eis.iilang.Parameter identifier)
Creates a new unprobed node with a specified
identifier , unknown
value and a graph it thinks it belongs to. |
Vertex(eis.iilang.Parameter identifier,
int value)
Creates a new node with a specified
identifier , a certain value , a boolean probed which says whether the real value is
known and a graph it thinks it belongs to. |
Vertex(String identifier) |
Modifier and Type | Method and Description |
---|---|
void |
addIncidentEdge(Edge incidentEdge)
Immediately adds an incident edge to the vertex.
|
void |
addToken(AgentToken token) |
int |
compareTo(Vertex v) |
boolean |
contains(AgentToken token)
Determines, whether the agent token is on the vertex or not
|
void |
decreaseNumberOfUnsurveyedIncidentEdges(int n) |
boolean |
equals(Object obj) |
LinkedList<Vertex> |
getAdjacentVertices() |
String[] |
getAgentNames() |
eis.iilang.Parameter |
getIdentifier() |
LinkedList<Edge> |
getIncidentEdges() |
String |
getName() |
int |
getNumber() |
int |
getNumberOfEdges() |
int |
getNumberOfUnsurveyedEdges() |
LinkedList<AgentToken> |
getTokens() |
int |
getValue() |
double |
getWeightedDistance() |
boolean |
hasEnemyTokens(String team) |
boolean |
hasUnsurveyedEdges() |
boolean |
isAdjacentTo(Vertex adjacentVertex) |
boolean |
isProbed() |
boolean |
isTarget(String teamname) |
AgentToken |
removeToken(AgentToken token)
removes a token from the vertex
|
void |
setIdentifier(eis.iilang.Parameter identifier) |
void |
setValue(int value)
Sets the
value of the vertex. |
void |
setWeightedDistance(double weightedDistance) |
void |
surveyAllIncidentEdges()
clears the list of incident unsurveyed edges.
|
apltk.interpreter.data.LogicBelief |
toBelief()
generates a belief for this node.
|
String |
toString() |
public static final int UNPROBED_VALUE
public Vertex(eis.iilang.Parameter identifier, int value)
identifier
, a certain value
, a boolean probed
which says whether the real value is
known and a graph
it thinks it belongs to.identifier
- The identifier of the node.value
- The value of the node.public Vertex(eis.iilang.Parameter identifier)
identifier
, unknown
value and a graph
it thinks it belongs to.identifier
- The identifier of the node.public Vertex(String identifier)
public final int compareTo(Vertex v)
compareTo
in interface Comparable<Vertex>
public apltk.interpreter.data.LogicBelief toBelief()
toBelief
in interface Believable
predicate
- vertex,parameter1
- identifier,parameter2
- value,parameter3
- probedpublic void addIncidentEdge(Edge incidentEdge)
incidentEdge
- the incidentEdge.public boolean isAdjacentTo(Vertex adjacentVertex)
adjacentVertex
- The vertex which shall be tested.true
, if adjacentVertex
is adjacent to this
vertex,false
, otherwise.public void surveyAllIncidentEdges()
public LinkedList<Edge> getIncidentEdges()
public LinkedList<Vertex> getAdjacentVertices()
public void setIdentifier(eis.iilang.Parameter identifier)
identifier
- the identifier to set.public eis.iilang.Parameter getIdentifier()
public boolean isProbed()
public void setValue(int value)
value
of the vertex.value
- The new value.public int getValue()
public int getNumberOfUnsurveyedEdges()
public void setWeightedDistance(double weightedDistance)
weightedDistance
- the weightedDistance to setpublic double getWeightedDistance()
public int getNumberOfEdges()
public String getName()
public void addToken(AgentToken token)
token
- The agent token which has to be added to the vertexpublic LinkedList<AgentToken> getTokens()
public boolean contains(AgentToken token)
token
- The agent tokenpublic AgentToken removeToken(AgentToken token)
token
- agent token to remove.public boolean isTarget(String teamname)
true
, if the vertex s already target of a different
agent,false
, otherwise.public String[] getAgentNames()
public boolean hasEnemyTokens(String team)
public boolean hasUnsurveyedEdges()
public int getNumber()
public void decreaseNumberOfUnsurveyedIncidentEdges(int n)
Copyright © 2013. All Rights Reserved.