|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectalgo.PathByteArray
public final class PathByteArray
A Path in a graph implementd as arrays of bytes.
| Field Summary | |
|---|---|
double |
cost
|
Graph |
graph
|
int |
length
|
int |
maxsize
|
byte[] |
unused
|
byte[] |
used
|
| Constructor Summary | |
|---|---|
PathByteArray(Graph g,
byte[] u,
byte[] uu,
double c)
|
|
PathByteArray(Graph g,
byte[] u,
int pos,
byte[] uu,
double c)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clone / copy this path. |
Path |
copyMax()
Clone / copy this path, but allocate full length used array. |
double |
cost()
|
protected static double |
cost(double c)
Dummy function. |
static PathByteArray |
emptyPath(Graph g)
Empty path, all n points unused. |
int |
length()
|
int |
maxsize()
|
Path |
nextPath(int pos)
Get next possible path reusing used array. |
Path[] |
nextPaths()
Get array of next possible paths. |
static PathByteArray |
onePath(Graph g)
One path. |
static PathByteArray |
standardPath(Graph g)
Standard path from point 0 to point n-1 to 0. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final Graph graph
public final byte[] used
public final byte[] unused
public final double cost
public final int maxsize
public final int length
| Constructor Detail |
|---|
public PathByteArray(Graph g,
byte[] u,
byte[] uu,
double c)
g - the graph.u - used points.uu - unused points.c - cost of this path.
public PathByteArray(Graph g,
byte[] u,
int pos,
byte[] uu,
double c)
g - the graph.u - used points.pos - position of last used point in path, e.g. length.uu - unused points.c - cost of this path.| Method Detail |
|---|
public java.lang.Object clone()
clone in interface Pathclone in class java.lang.ObjectObject.clone()public double cost()
cost in interface Pathpublic int length()
length in interface Pathpublic int maxsize()
maxsize in interface Pathpublic static PathByteArray emptyPath(Graph g)
g - the graph.
public static PathByteArray onePath(Graph g)
g - the graph.
public static PathByteArray standardPath(Graph g)
g - the graph.
public Path copyMax()
copyMax in interface Pathpublic Path nextPath(int pos)
nextPath in interface Pathpos - position of last valid point in used array.
public Path[] nextPaths()
nextPaths in interface Pathpublic java.lang.String toString()
toString in interface PathtoString in class java.lang.Objectprotected static double cost(double c)
c - actual cost.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||