|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Net
The Net class is in essence an n-dimensional array of Nodes.
| Field Summary | |
int |
cycleNum
The number of cycles the algorithm has taken so far |
int |
dim
The number of dimesions |
Node[] |
grid
The actual array of Nodes |
int |
gridSize
The number of cells (L^dim) |
float |
J
The bond strength |
int |
L
The side length of the Net |
int |
trueSize
The number of cells including the virtual "+" and "-" cells (gridSize+2) |
| Constructor Summary | |
Net(java.io.File f,
Wrapper didItFail)
Creates a Net from a previously saved file |
|
Net(int size,
float sigma,
int d)
Creates a random Net |
|
Net(int size,
int d)
Creates an empty Net |
|
| Method Summary | |
void |
clearFlows()
"Resets" the Net by clearing all flows so it may be solved multiple times sequentially |
java.lang.Object |
clone()
Creates an independent copy of the Net. |
double |
findEnergy()
Finds the energy (aka max-flow value) of the Net once it has been solved |
int[] |
getCoords(Node node)
Returns the coordinates of a given Node |
Node |
getNode(int[] coords)
Returns a node given an array of its coordinates |
ArrayHeap |
globalUpdate()
For Heaps |
void |
globalUpdate(Deque S)
For Stacks |
void |
globalUpdate(Queue Q)
For Queues |
void |
globalUpdate(Queue Q,
boolean b)
For double-sided queues. |
static void |
main(java.lang.String[] arg)
|
void |
prStep(ArrayHeap H)
For Heaps (uses gap) |
void |
prStep(ArrayHeap H,
boolean gapFlag)
For Heaps |
void |
prStep(Deque S)
For Stacks |
void |
prStep(Queue Q)
For Queues |
void |
prStep(Queue Q,
boolean b)
For double-sided queues |
void |
randNet(float cs)
Changes the field strength of each Node in the Net by a small (or large) amount. |
void |
reTimes(float oldS,
float newS)
Gives a Net a new field strength by multilplying every Node's field strength b a conversion factor. |
void |
saveNet(java.io.File f)
Writes the net to a file as the number of dimensions, followed by the side length, followed by the random field strengths, each on a new line |
void |
solve(int method,
boolean gap,
int updateFreq)
The actual push-relabel algorithm |
java.lang.String |
toString()
Not used in the actual applet, this method is included for use in debugging algorithmic changes. |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public int L
public int dim
public int gridSize
public int trueSize
public float J
public Node[] grid
public int cycleNum
| Constructor Detail |
public Net(java.io.File f,
Wrapper didItFail)
public Net(int size,
float sigma,
int d)
size - is the side length (L) of the Netsigma - is the standard deviation of the
Gaussian-distributed random field strengthsd - is the number of dimensions
public Net(int size,
int d)
size - is the side length (L) of the Netd - is the number of dimensions| Method Detail |
public void randNet(float cs)
cs - is standard deviation of the Gaussian distribution
governing the changespublic void clearFlows()
public java.lang.String toString()
toString in class java.lang.Object
public void solve(int method,
boolean gap,
int updateFreq)
method - the heuristic to use (heap, stack, queue, etc.)gap - whether or not to use the gap
(only meaningful if a heap-based heuristic is used)updateFreq - the number of push-relabel cycles
to elapse between global updates (-1 gives no global updates)public void prStep(ArrayHeap H)
public void prStep(ArrayHeap H,
boolean gapFlag)
gapFlag - specifies whether the gap is to be used or notpublic ArrayHeap globalUpdate()
public void prStep(Deque S)
public void globalUpdate(Deque S)
public void prStep(Queue Q)
public void globalUpdate(Queue Q)
public void prStep(Queue Q,
boolean b)
public void globalUpdate(Queue Q,
boolean b)
public void reTimes(float oldS,
float newS)
public Node getNode(int[] coords)
public int[] getCoords(Node node)
public double findEnergy()
public java.lang.Object clone()
clone in class java.lang.Objectpublic void saveNet(java.io.File f)
public static void main(java.lang.String[] arg)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||