X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=moebius2.git;a=blobdiff_plain;f=energy.c;h=80ac7e885f989e627b2c01edf3f0ba02a6bf5c73;hp=4f66e6c0aa6b3a253d7e0eda715d6a510126d494;hb=3433861ecff84ad63c6336f24dc082f3ec62bf4c;hpb=f130f541f2e9afc121f41146cec51a4e80227e4a diff --git a/energy.c b/energy.c index 4f66e6c..80ac7e8 100644 --- a/energy.c +++ b/energy.c @@ -32,17 +32,24 @@ double compute_energy(const struct Vertices *vs) { if (printing) printf("%15lld c>e |", evaluations); -#if YBITS==3 - COST( 3e2, line_bending_cost(vs->a)); - COST( 1e3, edge_length_variation_cost(vs->a)); - COST( 0.2e3, rim_proximity_cost(vs->a)); - COST( 1e8, noncircular_rim_cost(vs->a)); -#else - COST( 3e3, line_bending_cost(vs->a)); - COST( 1e4, edge_length_variation_cost(vs->a)); - COST( 0.2e3, rim_proximity_cost(vs->a)); - COST( 1e8, noncircular_rim_cost(vs->a)); -#endif + if (XBITS==3) { + COST( 3e2, line_bending_cost(vs->a)); + COST( 1e3, edge_length_variation_cost(vs->a)); + COST( 0.2e3, rim_proximity_cost(vs->a)); + COST( 1e8, noncircular_rim_cost(vs->a)); + stop_epsilon= 1e-6; + } else if (XBITS==4) { + COST( 3e2, line_bending_cost(vs->a)); + COST( 3e3, edge_length_variation_cost(vs->a)); + COST( 3.8e1, rim_proximity_cost(vs->a)); // 5e1 is too much + // 2.5e1 is too little + // 0.2e1 grows compared to previous ? + // 0.6e0 shrinks compared to previous ? + COST( 1e12, noncircular_rim_cost(vs->a)); + stop_epsilon= 1e-5; + } else { + abort(); + } if (printing) printf("| total %# e |", energy);