diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-02-19 10:28:55 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-02-19 15:29:40 -0800 |
commit | bd89e33e765d73aa2b48419031d6922b8bf5eb37 (patch) | |
tree | f052263173322f7a9de1ba429c1c5e3d13b3e239 | |
parent | dc55ee4a23bfbd013bc7085e005ab22beb2dd1a1 (diff) | |
download | subsurface-bd89e33e765d73aa2b48419031d6922b8bf5eb37.tar.gz |
Fix typo in saturation/desatureation rates
This patch eliminates the difference between the saturation and
desaturation rates. This was probably once meant as a conservative
measure but the desaturation rate was increased rather than the
saturation rate (which is probably a typo, as reported by Stefan).
Since there is no good basis for this anyway, this patch sets
both factors to 1.0 (and if accepted the whole factor business
should be removed).
This makes our deco times slightly longer. But in the past,
we had introduced a 1.2% fudge factor in the critical radius
calculation to add conservatism and match the benchmark better.
Removing this fudge factor brings us close to the benchmarks.
Expected test values updated.
Reported-by: Stefan <sjti@gmx.net>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
-rw-r--r-- | core/deco.c | 4 | ||||
-rw-r--r-- | tests/testplan.cpp | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/core/deco.c b/core/deco.c index 5014f1b61..8247800da 100644 --- a/core/deco.c +++ b/core/deco.c @@ -27,7 +27,7 @@ // Subsurface appears to produce marginally less conservative plans than our benchmarks // Introduce 1.2% additional conservatism -#define subsurface_conservatism_factor 1.012 +#define subsurface_conservatism_factor 1.0 extern bool in_planner(); @@ -48,7 +48,7 @@ struct buehlmann_config { struct buehlmann_config buehlmann_config = { .satmult = 1.0, - .desatmult = 1.01, + .desatmult = 1.0, .last_deco_stop_in_mtr = 0, .gf_high = 0.75, .gf_low = 0.35, diff --git a/tests/testplan.cpp b/tests/testplan.cpp index 3be4497e4..90e1d4b75 100644 --- a/tests/testplan.cpp +++ b/tests/testplan.cpp @@ -309,8 +309,8 @@ void TestPlan::testMetric() QCOMPARE(ev->gas.index, 2); QCOMPARE(ev->value, 100); QCOMPARE(get_depth_at_time(&displayed_dive.dc, ev->time.seconds), 6000); - // check expected run time of 108 minutes - QVERIFY(compareDecoTime(displayed_dive.dc.duration.seconds, 108u * 60u, 108u * 60u)); + // check expected run time of 109 minutes + QVERIFY(compareDecoTime(displayed_dive.dc.duration.seconds, 109u * 60u, 109u * 60u)); } void TestPlan::testImperial() @@ -345,8 +345,8 @@ void TestPlan::testImperial() QCOMPARE(ev->gas.index, 2); QCOMPARE(ev->value, 100); QCOMPARE(get_depth_at_time(&displayed_dive.dc, ev->time.seconds), 6096); - // check expected run time of 110 minutes - QVERIFY(compareDecoTime(displayed_dive.dc.duration.seconds, 110u * 60u - 2u, 110u * 60u - 2u)); + // check expected run time of 111 minutes + QVERIFY(compareDecoTime(displayed_dive.dc.duration.seconds, 111u * 60u - 2u, 111u * 60u - 2u)); } void TestPlan::testVpmbMetric60m30minAir() @@ -474,7 +474,7 @@ void TestPlan::testVpmbMetric100m60min() QCOMPARE(ev->value, 100); QCOMPARE(get_depth_at_time(&displayed_dive.dc, ev->time.seconds), 6000); // check benchmark run time of 311 minutes, and known Subsurface runtime of 314 minutes - QVERIFY(compareDecoTime(displayed_dive.dc.duration.seconds, 311u * 60u + 20u, 314u * 60u + 20u)); + QVERIFY(compareDecoTime(displayed_dive.dc.duration.seconds, 311u * 60u + 20u, 315u * 60u + 20u)); } void TestPlan::testVpmbMetricMultiLevelAir() @@ -567,7 +567,7 @@ void TestPlan::testVpmbMetricRepeat() // print first ceiling printf("First ceiling %.1f m\n", (mbar_to_depth(first_ceiling_pressure.mbar, &displayed_dive) * 0.001)); - // check benchmark run time of 27 minutes, and known Subsurface runtime of 27 minutes + // check benchmark run time of 27 minutes, and known Subsurface runtime of 28 minutes QVERIFY(compareDecoTime(displayed_dive.dc.duration.seconds, 27u * 60u + 20u, 27u * 60u + 20u)); int firstDiveRunTimeSeconds = displayed_dive.dc.duration.seconds; @@ -602,7 +602,7 @@ void TestPlan::testVpmbMetricRepeat() QCOMPARE(ev->value, 100); QCOMPARE(get_depth_at_time(&displayed_dive.dc, ev->time.seconds), 6000); // we don't have a benchmark, known Subsurface runtime is 126 minutes - QVERIFY(compareDecoTime(displayed_dive.dc.duration.seconds, 126u * 60u + 20u, 126u * 60u + 20u)); + QVERIFY(compareDecoTime(displayed_dive.dc.duration.seconds, 127u * 60u + 20u, 127u * 60u + 20u)); setupPlanVpmb30m20min(&testPlan); plan(&testPlan, &cache, 1, 0); |