really really good
[anneal.git] / src / edu / berkeley / qfat / Main.java
index 7eb7b09..982119b 100644 (file)
@@ -63,12 +63,6 @@ public class Main extends MeshViewer {
             new Matrix(new Vec(rshift,  depth,    halfup)),
             new Matrix(new Vec(lshift, -depth,    halfup)),
             new Matrix(new Vec(rshift, -depth,    halfup)),
-            /*
-            new Matrix(new Vec(lshift,  depth,   -halfup)),
-            new Matrix(new Vec(rshift,  depth,   -halfup)),
-            new Matrix(new Vec(lshift, -depth,   -halfup)),
-            new Matrix(new Vec(rshift, -depth,   -halfup)),
-            */
 
             new Matrix(new Vec(lshift,       0,  height)),
             new Matrix(new Vec(rshift,       0,  height)),
@@ -77,6 +71,7 @@ public class Main extends MeshViewer {
 
             new Matrix(new Vec( width,           0,    0)),
             new Matrix(new Vec(-width,           0,    0)),
+
         };
 
 
@@ -231,6 +226,7 @@ public class Main extends MeshViewer {
 
         tile.score_against = goal;
         goal.score_against = tile;
+        tile.tilemesh = true;
     }
 
     public synchronized void breakit() {
@@ -249,19 +245,20 @@ public class Main extends MeshViewer {
     }
 
     public synchronized void rand(float temp, Mesh.Vert p) {
-        double tile_score = tile.score();
-        double goal_score = goal.score();
 
         //p.reComputeError();
         p.reComputeErrorAround();
+        double tile_score = tile.score();
+        double goal_score = goal.score();
 
-        Vec v = new Vec((random.nextFloat() - (float)0.5) / 400,
-                        (random.nextFloat() - (float)0.5) / 400,
-                        (random.nextFloat() - (float)0.5) / 400);
+        Vec v = new Vec((random.nextFloat() - (float)0.5) / 200,
+                        (random.nextFloat() - (float)0.5) / 200,
+                        (random.nextFloat() - (float)0.5) / 200);
         /*
         Matrix inv = p.errorQuadric();
-        Vec v = new Vec(inv.d, inv.h, inv.l).norm().times(1/(float)1000);
+        v = new Vec(inv.d, inv.h, inv.l).norm().times(1/(float)1000);
         */
+
         boolean good = p.move(v);
 
         p.reComputeErrorAround();
@@ -302,6 +299,7 @@ public class Main extends MeshViewer {
             if (breaks) {
                 breaks = false;
                     breakit();
+                    //gamma = 1;
                     gamma = 2;
                     //temp = last * 0.8f;
                     //last = temp;
@@ -319,6 +317,7 @@ public class Main extends MeshViewer {
                 } else {
                     breakit();
                     gamma = 2;
+                    //gamma = 1;
                     //temp = last * 0.8f;
                     //last = temp;
                     //temp = hightemp;