checkpoint
[anneal.git] / src / edu / berkeley / qfat / Main.java
index 000fd94..2b36405 100644 (file)
@@ -239,7 +239,7 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
         Random random = new Random();
 
     public synchronized void breakit() {
-        if (verts > 300) return;
+        if (verts > 50) return;
         //double min = (tile.avgedge/tile.numedges)*(1+(4/(double)verts));
         //if (verts>0 && tile.es.peek().length() < min) return;
         PriorityQueue<Mesh.E> es = new PriorityQueue<Mesh.E>();
@@ -257,14 +257,14 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
     public synchronized void rand(double temperature, Mesh.Vert p) {
         double tile_score = tile.score();
         double goal_score = goal.score();
-        
         p.rescore();
+
+        /*
         //if (p.watch==null) return;
         float r1 = Math.abs(random.nextFloat());
         r1 = r1 - (float)Math.floor(r1);
         r1 = r1 * (float)0.01;
         r1 = r1 - (float)0.005;
-        /*
         public Vert partner() { return quadric==null ? this : quadric; }
         public Point quadric() { return quadric_count==0 ? partner().p :
                 new Point(quadric_x/quadric_count, quadric_y/quadric_count, quadric_z/quadric_count); }
@@ -302,6 +302,7 @@ public class Main implements GLEventListener, MouseListener, MouseMotionListener
         double swapProbability = Math.exp((-1 * delta) / temperature);
         //boolean doSwap = Math.random() < swapProbability;
         boolean doSwap = good && (tile_delta <= 0 && goal_delta <= 0);
+        //System.out.println(doSwap);
         if (doSwap) {
             tile_score = new_tile_score;
             goal_score = new_goal_score;