at.dms.kjc.spacetime
Class AnnealedGreedyLayout

java.lang.Object
  extended by at.dms.kjc.common.SimulatedAnnealing
      extended by at.dms.kjc.spacetime.AnnealedGreedyLayout
All Implemented Interfaces:
Layout<RawTile>

public class AnnealedGreedyLayout
extends SimulatedAnnealing
implements Layout<RawTile>

An experimental class that tries to optimize the data-reordering stage of the greedy layout. It was not helpful. Please don't look at it!

Author:
mgordon

Field Summary
 
Fields inherited from class at.dms.kjc.common.SimulatedAnnealing
ANNEALITERATIONS, assignment, MAXTEMPITERATIONS, MINTEMPITERATIONS, TFACTR
 
Constructor Summary
AnnealedGreedyLayout(SpaceTimeSchedule spaceTime, RawChip chip, StreamlinedDuplicate duplicate)
           
 
Method Summary
 RawTile getComputeNode(SliceNode node)
          Get the ComputeNode for a Slice
 void initialize()
          Perform any initialization that has to be done before simulated annealing.
 void initialPlacement()
          The initial assignment, this must set up assignment so that is can be called by placemenCost() and perturbConfiguration(T);
protected  boolean keepNewEqualMin()
          Decide if we should keep a configuration that has a cost that is EQUAL to the current minimum of the search.
 double placementCost(boolean debug)
          The placement cost (energy) of the configuration.
 void run()
          Do the setup for getComputeNode.
 void setAssignment(HashMap newAssign)
          Use this function to reassign the assignment to , update anything that needs to be updated on a new assignment.
 void setComputeNode(SliceNode node, RawTile tile)
          Set the ComputeNode for a Slice
 void swapAssignment()
          Called by perturbConfiguration() to perturb the configuration.
 
Methods inherited from class at.dms.kjc.common.SimulatedAnnealing
getRandom, printLayoutStats, setConstants, simAnnealAssign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnealedGreedyLayout

public AnnealedGreedyLayout(SpaceTimeSchedule spaceTime,
                            RawChip chip,
                            StreamlinedDuplicate duplicate)
Method Detail

getComputeNode

public RawTile getComputeNode(SliceNode node)
Description copied from interface: Layout
Get the ComputeNode for a Slice

Specified by:
getComputeNode in interface Layout<RawTile>
Parameters:
node - : the SliceNode to look up.
Returns:
the ComputeNode that should execute the SliceNode.

setComputeNode

public void setComputeNode(SliceNode node,
                           RawTile tile)
Description copied from interface: Layout
Set the ComputeNode for a Slice

Specified by:
setComputeNode in interface Layout<RawTile>
Parameters:
node - the SliceNode to associate with ...
tile - the ComputeNode where the SliceNode should execute.

setAssignment

public void setAssignment(HashMap newAssign)
Use this function to reassign the assignment to , update anything that needs to be updated on a new assignment.

Specified by:
setAssignment in class SimulatedAnnealing
Parameters:
newAssign -

swapAssignment

public void swapAssignment()
Called by perturbConfiguration() to perturb the configuration. perturbConfiguration() decides if we should keep the new assignment.

Specified by:
swapAssignment in class SimulatedAnnealing

initialPlacement

public void initialPlacement()
The initial assignment, this must set up assignment so that is can be called by placemenCost() and perturbConfiguration(T);

Specified by:
initialPlacement in class SimulatedAnnealing

placementCost

public double placementCost(boolean debug)
The placement cost (energy) of the configuration.

Specified by:
placementCost in class SimulatedAnnealing
Parameters:
debug - Might want to do some debugging...
Returns:
placement cost

initialize

public void initialize()
Perform any initialization that has to be done before simulated annealing. This does not include the initial placement.

Specified by:
initialize in class SimulatedAnnealing

keepNewEqualMin

protected boolean keepNewEqualMin()
Decide if we should keep a configuration that has a cost that is EQUAL to the current minimum of the search. By default, don't keep it. Override if you want other behavior.

Specified by:
keepNewEqualMin in class SimulatedAnnealing
Returns:
Should we set the min config to this config (they have the same cost).

run

public void run()
Description copied from interface: Layout
Do the setup for getComputeNode.

Specified by:
run in interface Layout<RawTile>