if (currentCost == 0.0)
if (currentCost == 0.0) { dumpLayout("layout.dot");
    public static void simAnnealAssign(FlatNode node)     {	System.out.println("Simulated Annealing Assignment");	int nsucc =0, j = 0;	double currentCost = 0.0, minCost = 0.0;	//number of paths tried at an iteration	int nover = 100; //* StreamItOptions.rawRows * StreamItOptions.rawColumns;	try {	    init(node);	    random = new Random(17);	    //random placement	    randomPlacement();	    //filew = new FileWriter("simanneal.out");	    currentCost = placementCost();	    System.out.println("Initial Cost: " + currentCost);	    	    //as a little hack, we will cache the layout with the minimum cost	    //these two hashmaps store this layout	    HashMap sirMin = (HashMap)SIRassignment.clone();	    HashMap tileMin = (HashMap)tileAssignment.clone();	    minCost = currentCost;	    	    if (currentCost == 0.0)		return;	    //run the annealing twice.  The first iteration is really just to get a 	    //good initial layout.  Some random layouts really kill the algorithm	    for (int two = 0; two < StreamItOptions.rawRows ; two++) {		double t = annealMaxTemp(); 		double tFinal = annealMinTemp();		while (true) {		    int k = 0;		    nsucc = 0;		    for (k = 0; k < nover; k++) {			if (perturbConfiguration(t)) {			    //filew.write(placementCost() + "\n");			    nsucc++;			}			if (placementCost() == 0.0)			    break;		    }		    		    t *= TFACTR;		    currentCost = placementCost();		    //keep the layout with the minimum cost		    //this will be the final layout		    if (currentCost < minCost) {			minCost = currentCost;			//save the layout with the minimum cost		        sirMin = (HashMap)SIRassignment.clone();			tileMin = (HashMap)tileAssignment.clone();		    }		    if (nsucc == 0) break;		    if (currentCost == 0)			break;		    if (t <= tFinal)			break;		    j++;		}	    }	   	    currentCost = placementCost();	    System.out.println("Final Cost: " + currentCost + 			       " Min Cost : " + minCost + 			       " in  " + j + " iterations.");	    if (minCost < currentCost) {		SIRassignment = sirMin;		tileAssignment = tileMin;	    }	    	    //filew.close();	}	catch (Exception e) {	    e.printStackTrace();	}	dumpLayout("layout.dot");    }