checkpoint
[anneal.git] / src / edu / berkeley / qfat / Main.java
index dac265b..1582d69 100644 (file)
@@ -51,9 +51,9 @@ public class Main extends MeshViewer {
         */
         float width  = (float)0.7;
         float depth  = (float)0.08;
-        float height = (float)0.35;
+        float height = (float)0.4;
 
-        float rshift = width/2;
+        float rshift =   width/2;
         float lshift = -(width/2);
 
         //float halfup = height/2;
@@ -65,7 +65,10 @@ 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(0,  depth,    halfup)),
+            new Matrix(new Vec(0, -depth,    halfup)),
+            */
             new Matrix(new Vec(lshift,       0,  height)),
             new Matrix(new Vec(rshift,       0,  height)),
             new Matrix(new Vec(lshift,       0, -height)),
@@ -76,6 +79,9 @@ public class Main extends MeshViewer {
 
         };
 
+        //   
+
+
 
         Point ltf = new Point(lshift,  (depth/2),  (height/2));
         Point mtf = new Point( 0.0,    (depth/2),  (height/2));
@@ -255,14 +261,15 @@ public class Main extends MeshViewer {
 
         Vec v;
         Matrix inv = p.errorQuadric();
-        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)300);
         if (p.quadric_count == 0) {
-            v = goal.nearest(p.p).p.minus(p.p).norm().times(1/(float)1000);
+            v = goal.nearest(p.p).p.minus(p.p).norm().times(1/(float)300);
         }
         Vec v2 = new Vec((random.nextFloat() - (float)0.5) / 500,
                         (random.nextFloat() - (float)0.5)  / 500,
                         (random.nextFloat() - (float)0.5)  / 500);
-        v = v.plus(v2.norm().times(1/(float)1000));
+        v = v.plus(v2.norm().times(1/(float)300));
+        //v = v2;
 
         boolean good = p.move(v);
 
@@ -275,7 +282,8 @@ public class Main extends MeshViewer {
         double delta = tile_delta + goal_delta;
         double swapProbability = Math.exp((-1 * delta) / temp);
         //boolean doSwap = good && (Math.random() < swapProbability);
-        boolean doSwap = good && (tile_delta <= 0 && goal_delta <= 0);
+        //boolean doSwap = good && (tile_delta <= 0 && goal_delta <= 0);
+        boolean doSwap = good && (tile_delta + goal_delta <= 0);
         if (doSwap) {
             tile_score = new_tile_score;
             goal_score = new_goal_score;