public class GraphEdge
extends java.lang.Object
implements java.lang.Comparable<java.lang.Object>
Constructor and Description |
---|
GraphEdge(GraphEdge edge)
Copy constructor.
|
GraphEdge(GraphNode from,
GraphNode to)
Create an edge of cost 1.0f
|
GraphEdge(GraphNode from,
GraphNode to,
double cost)
Create an edge from 2 existing nodes.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o)
Compare two graph edges.
|
GraphNode |
from() |
double |
getCost() |
void |
setCost(double cost)
Change the traversal cost.
|
GraphNode |
to() |
java.lang.String |
toString() |
public GraphEdge(GraphNode from, GraphNode to)
from
- 'from' nodeto
- 'to' nodepublic GraphEdge(GraphEdge edge)
edge
- public double getCost()
public void setCost(double cost)
cost
- the new traversal cost.public GraphNode from()
public GraphNode to()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable<java.lang.Object>
public java.lang.String toString()
toString
in class java.lang.Object
Processing library AI_for_2D_Games by Peter Lager. (C) 2013