|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmas.agentsHempelsSofa.data.graph.Vertex
public class Vertex
An implementation of the vertices for our graph. A node knows
Field Summary | |
---|---|
static int |
UNPROBED_VALUE
|
Constructor Summary | |
---|---|
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(java.lang.String identifier)
|
Method Summary | |
---|---|
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(java.lang.Object obj)
|
java.util.LinkedList<Vertex> |
getAdjacentVertices()
|
java.lang.String[] |
getAgentNames()
|
eis.iilang.Parameter |
getIdentifier()
|
java.util.LinkedList<Edge> |
getIncidentEdges()
|
java.lang.String |
getName()
|
int |
getNumber()
|
int |
getNumberOfEdges()
|
int |
getNumberOfUnsurveyedEdges()
|
java.util.LinkedList<AgentToken> |
getTokens()
|
int |
getValue()
|
double |
getWeightedDistance()
|
boolean |
hasEnemyTokens(java.lang.String team)
|
boolean |
hasUnsurveyedEdges()
|
boolean |
isAdjacentTo(Vertex adjacentVertex)
|
boolean |
isProbed()
|
boolean |
isTarget(java.lang.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. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int UNPROBED_VALUE
Constructor Detail |
---|
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(java.lang.String identifier)
Method Detail |
---|
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object
public final int compareTo(Vertex v)
compareTo
in interface java.lang.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 java.util.LinkedList<Edge> getIncidentEdges()
public java.util.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 java.lang.String getName()
public void addToken(AgentToken token)
token
- The agent token which has to be added to the vertexpublic java.util.LinkedList<AgentToken> getTokens()
public boolean contains(AgentToken token)
token
- The agent token
public AgentToken removeToken(AgentToken token)
token
- agent token to remove.public boolean isTarget(java.lang.String teamname)
true
, if the vertex s already target of a different
agent,false
, otherwise.public java.lang.String[] getAgentNames()
public boolean hasEnemyTokens(java.lang.String team)
public boolean hasUnsurveyedEdges()
public int getNumber()
public void decreaseNumberOfUnsurveyedIncidentEdges(int n)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |