|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.common.SimulatedAnnealing
public abstract class SimulatedAnnealing
This is a abstract class that any simulated annealing assignment algorithm can inherit and use.
Field Summary | |
---|---|
static int |
ANNEALITERATIONS
|
protected HashMap |
assignment
the assignment that we arrive at and use during execution |
static int |
MAXTEMPITERATIONS
|
static int |
MINTEMPITERATIONS
|
static double |
TFACTR
|
Constructor Summary | |
---|---|
protected |
SimulatedAnnealing()
|
Method Summary | |
---|---|
int |
getRandom(int max)
Get the nex random number from [0, max). |
abstract void |
initialize()
Perform any initialization that has to be done before simulated annealing. |
abstract void |
initialPlacement()
The initial assignment, this must set up assignment so that is can be called by placemenCost() and perturbConfiguration(T); |
protected abstract boolean |
keepNewEqualMin()
Decide if we should keep a configuration that has a cost that is EQUAL to the current minimum of the search. |
abstract double |
placementCost(boolean debug)
The placement cost (energy) of the configuration. |
void |
printLayoutStats()
Use this method to print stats for the layout... |
abstract void |
setAssignment(HashMap newAssign)
Use this function to reassign the assignment to |
protected void |
setConstants(int minTempIts,
int maxTempIts,
int annealIts,
double tFactor)
Set the annealing constants. |
void |
simAnnealAssign(int iterations,
int nover)
Run the simulated annealing assignment. |
abstract void |
swapAssignment()
Called by perturbConfiguration() to perturb the configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int MINTEMPITERATIONS
public static int MAXTEMPITERATIONS
public static int ANNEALITERATIONS
public static double TFACTR
protected HashMap assignment
Constructor Detail |
---|
protected SimulatedAnnealing()
Method Detail |
---|
public void printLayoutStats()
public abstract void setAssignment(HashMap newAssign)
newAssign
- public abstract void swapAssignment()
public abstract void initialPlacement()
public abstract double placementCost(boolean debug)
debug
- Might want to do some debugging...
public abstract void initialize()
protected final void setConstants(int minTempIts, int maxTempIts, int annealIts, double tFactor)
minTempIts
- maxTempIts
- annealIts
- tFactor
- public final void simAnnealAssign(int iterations, int nover)
iterations
- The number of simulated annealing iterations to
run.nover
- The number of paths tried at an iteration (It was 100 before).protected abstract boolean keepNewEqualMin()
public int getRandom(int max)
max
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |