X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FMain.java;h=1582d693849d4cc232f68de565a2fc54d437c4a0;hp=dac265bf9e87e8806d01707640f29f9a474ea498;hb=20989b5562ed9a4b438db2da8a4c2c3b9a05801d;hpb=a31f6136cd3fa98d8484bba56110c38a5c563856 diff --git a/src/edu/berkeley/qfat/Main.java b/src/edu/berkeley/qfat/Main.java index dac265b..1582d69 100644 --- a/src/edu/berkeley/qfat/Main.java +++ b/src/edu/berkeley/qfat/Main.java @@ -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;