|
AI for Games 1.1.1
|

Public Member Functions | |
| GraphEdge (GraphNode from, GraphNode to) | |
| GraphEdge (GraphEdge edge) | |
| GraphEdge (GraphNode from, GraphNode to, double cost) | |
| double | getCost () |
| void | setCost (double cost) |
| GraphNode | from () |
| GraphNode | to () |
| int | compareTo (Object o) |
| String | toString () |
Protected Member Functions | |
| GraphEdge () | |
Protected Attributes | |
| GraphNode | from |
| GraphNode | to |
| double | cost = 1.0 |
Package Functions | |
| GraphEdge (GraphEdge edge, double costSoFar) | |
This class is used to represent a directed edge between 2 nodes and the cost of traversing this edge.
|
protected |
Make protected to prevent its use outside the class.
Create an edge of cost 1.0f
| from | 'from' node |
| to | 'to' node |
| game2dai.graph.GraphEdge.GraphEdge | ( | GraphEdge | edge | ) |
Copy constructor.
| edge |
Create an edge from 2 existing nodes. If the cost is 0.0 then calculate the cost based on the physical distance between the nodes.
| from | 'from' node |
| to | 'to' node |
| cost | traversal cost |
|
package |
This constructor is used to create new edges for use with the path finding algorithms Dijkstra and A*
It should not be used directly.
| edge | the existing edge |
| costSoFar | the cost to the destination node so far. |
| int game2dai.graph.GraphEdge.compareTo | ( | Object | o | ) |
Compare two graph edges.
| GraphNode game2dai.graph.GraphEdge.from | ( | ) |
| double game2dai.graph.GraphEdge.getCost | ( | ) |
| void game2dai.graph.GraphEdge.setCost | ( | double | cost | ) |
Change the traversal cost.
| cost | the new traversal cost. |
| GraphNode game2dai.graph.GraphEdge.to | ( | ) |