|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--CycleCostAlgorithm
This class represents an improved algorithm to be used in collaboration with an heuristic on the algorithm using graphical methods by Yutsis, Vanagas et. al for the calculation of general recoupling coefficients of angular momenta. When constructing an CycleCostAlgorithm object an heuristic by means of an object implementing the CCAHeuristic interface has to be delivered.
This algorithm will reduce the graph in the following way: when there are bubbles present they are removed, otherwise when there are triangles present they are removed. When there are no bubbles nor triangles present, the heuristic will decide which interchange will be applied.
Yutsis
,
CCAHeuristic
Constructor Summary | |
CycleCostAlgorithm(Yutsis y,
CCAHeuristic h)
Constructs a new CycleCostAlgorithm object for the Yutsis y with heuristic h. |
Method Summary | |
CCAHeuristic |
heuristic()
Returns the used CCAHeuristic object. |
protected void |
log(java.lang.String tolog)
Write the String to the logstream. |
static void |
main(java.lang.String[] args)
This program reduces a Yutsis Graph to a so called triangular delta in as few operations possible, while constructing the general recoupling coefficient associated with it, which is written to the screen. |
int |
nrOfInterchanges()
Returns the number of interchanges performed so far to reduce the Yutsis object. |
static void |
outputResults(Yutsis y,
CycleCostAlgorithm cca)
Outputs the results of the reduction process; if the Yutsis object is a instance of YutsisGraph, the generated summation formula, an instance of GenRecoupCoeff, is printed to System.out. |
static void |
outputResults(Yutsis y,
CycleCostAlgorithm cca,
GRVisitor grv)
Outputs the results of the reduction process; if the Yutsis object is a instance of YutsisGraph, the generated summation formula, an instance of GenRecoupCoeff, is printed to the given PrintStream in the format delivered by the GRVisitor. |
static void |
outputResults(Yutsis y,
CycleCostAlgorithm cca,
GRVisitor grv,
java.io.PrintStream out)
Outputs the results of the reduction process; if the Yutsis object is a instance of YutsisGraph, the generated summation formula, an instance of GenRecoupCoeff, is printed to the given PrintStream in the format delivered by the GRVisitor. |
void |
performOperation()
Searches for the best operation to reduce the Yutsis object and performs it. |
Yutsis |
problem()
Returns the Yutsis object defining the problem. |
void |
reduce()
Reduces the Yutsis object to a so called triangular delta by repeatedly calling performOperation. |
static CycleCostAlgorithm |
reduceYutsisGraph(Yutsis y,
CCAHeuristic h,
java.io.PrintStream ruleslogstream,
java.lang.String gmlbasename)
This function calls performOperation until the given Yutsis object is equal to a triangular delta and returns the used CycleCostAlgorithm object. |
void |
setGmlOutputBasename(java.lang.String gmlbasename)
Sets the basename of the file(s) where the graphs will be written after each reductionstep in gml-format (graphlet). |
void |
setHeuristic(CCAHeuristic h)
Sets the CCAHeuristic, used to select an operation when no bubbles or triangles are present. |
void |
setLogStream(java.io.PrintStream logstream)
Sets the PrintStream to which all operation which alter the graph will be logged. |
void |
stateChanged(javax.swing.event.ChangeEvent e)
Implementation of the ChangeListener interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CycleCostAlgorithm(Yutsis y, CCAHeuristic h)
y
- the Yutsis object defining the problemh
- the heuristic to be used when no bubbles or triangles are
presentYutsis
,
CCAHeuristic
Method Detail |
public int nrOfInterchanges()
Yutsis
public void performOperation()
CCAHeuristic
public Yutsis problem()
Yutsis
public CCAHeuristic heuristic()
CCAHeuristic
public void setHeuristic(CCAHeuristic h)
h
- the CCAHeuristic object to be used.protected void log(java.lang.String tolog)
tolog
- the String to be loggedpublic void setLogStream(java.io.PrintStream logstream)
System.err
.
When no logging is desired, set it to be null
.
logstream
- The PrintStream where logging will be donepublic void reduce()
#performOperation.
,
Yutsis
public void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
public void setGmlOutputBasename(java.lang.String gmlbasename)
gmlbasename
.i.gml".
gmlbasename
- the basename of the files to which gml-output
will be written after each step.public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public static CycleCostAlgorithm reduceYutsisGraph(Yutsis y, CCAHeuristic h, java.io.PrintStream ruleslogstream, java.lang.String gmlbasename)
y
- the Yutsis to be reducedh
- the heuristic to be used as a CCAHeuristic objectruleslogstream
- the stream to where the applied rules have
to be loggedgmlbasename
- the basename of the files to which the graphs
will be written in gml-format (graphlet) after
each step or null for no gml output.
performOperation()
,
Yutsis
,
CCAHeuristic
public static void outputResults(Yutsis y, CycleCostAlgorithm cca)
y
- the Yutsis object for which the results will be printed.cca
- the CycleCostAlgorithm object used to reduce y.Yutsis
,
YutsisGraph
,
GenRecoupCoeff
public static void outputResults(Yutsis y, CycleCostAlgorithm cca, GRVisitor grv)
y
- the Yutsis object for which the results will be printed.cca
- the CycleCostAlgorithm object used to reduce y.grv
- the GRVisitor visiting the GenRecoupCoeffYutsis
,
YutsisGraph
,
GRVisitor
,
GenRecoupCoeff
public static void outputResults(Yutsis y, CycleCostAlgorithm cca, GRVisitor grv, java.io.PrintStream out)
y
- the Yutsis object for which the results will be printed.cca
- the CycleCostAlgorithm object used to reduce y.grv
- the GRVisitor visiting the GenRecoupCoeffout
- the PrintStream to which the output will be printed.Yutsis
,
YutsisGraph
,
GRVisitor
,
GenRecoupCoeff
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |