Hi,

On 17 Aug 2015, at 15:44, Rick Walsh <[email protected]> wrote:

Which approach is more justified?  Debatable.  The method used by Subsurface should be 'better', but when the depth of the first stop/ceiling is given a special significance thanks to the Boyles law compensation process, I'm not so sure.  The 'instantaneous' ceiling method is more conservative, and, without having modified the code and tested, I'm guessing would produce deco schedules more consistent with other VPM-B programs.

I thought a bit about this. To me, it does not make much sense to ascent only if I can „see“ the ceiling is above the next stop and not to ascent as long as we don’t violate the ceiling.

On the other hand, one could argue this behaviour is part of the definition of the model and has been tested as such (or otherwise, some of the constants would have to be changed). 

So maybe the best might be to let the user decide. So here is a patch that adds this as a preferences value (so far without UI, so to test it, you have to set it in the code).

On the other hand, we don’t want to confuse the user with too many options. 

And what is a reasonable default? Set this to false for Buehlmann and to true for VPM-B or maybe even only make this an option for VPM-B?

Best
Robert
From a4188c580f6a3bd47b533aa1cdf9edbde422ac6f Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <[email protected]>
Date: Mon, 17 Aug 2015 17:40:47 +0200
Subject: [PATCH] Pref. to ascent to next stop only when stop is below ceiling

Usually, we try to ascent to the next stop and check if we break the
ceiling while doing that. This patch adds a preference value to rather
check if the ceiling is above the next stop before attempting to ascent.

The difference if off-gasing during the ascent is taken into account.

Logically, it does not sound like it could be relevant to ignore that
off-gasing but it leads to more conservative schedules and it seems
the original Fortran VPM-B implementation does just this. So one could
argue it is part of that model (if it makes sense or not), so we should
at least give users the possibility to turn this on.

Maybe we should even make this the default for VPM-B.

This patch just addes the code to have the value in the preferences and
the planner to act accordingly. There is no UI for it, yet. To test, you
have to set it in the code. There could be a later patch with a UI if people
like to have it.

Signed-off-by: Robert C. Helling <[email protected]>
---
 planner.c           | 5 +++++
 pref.h              | 1 +
 subsurfacestartup.c | 1 +
 3 files changed, 7 insertions(+)

diff --git a/planner.c b/planner.c
index 3c09a61..bd56500 100644
--- a/planner.c
+++ b/planner.c
@@ -879,6 +879,11 @@ bool trial_ascent(int trial_depth, int stoplevel, int 
avg_depth, int bottom_time
        bool clear_to_ascend = true;
        char *trial_cache = NULL;
 
+       // Don't do a trail ascent but check if the ceiling is above the next 
stoplevel.
+       // This does not sound like a relevant question but it seems the 
original VPM-B implementation does that.
+       if (prefs.check_ceiling_before_ascent)
+               return (deco_allowed_depth(tissue_tolerance, surface_pressure, 
&displayed_dive, 1) <= stoplevel);
+
        cache_deco_state(tissue_tolerance, &trial_cache);
        while (trial_depth > stoplevel) {
                int deltad = ascent_velocity(trial_depth, avg_depth, 
bottom_time) * TIMESTEP;
diff --git a/pref.h b/pref.h
index 3791f62..c6c6138 100644
--- a/pref.h
+++ b/pref.h
@@ -97,6 +97,7 @@ struct preferences {
        bool display_transitions;
        bool safetystop;
        bool switch_at_req_stop;
+        bool check_ceiling_before_ascent;
        int reserve_gas;
        int min_switch_duration; // seconds
        int bottomsac;
diff --git a/subsurfacestartup.c b/subsurfacestartup.c
index 17bd43e..4667250 100644
--- a/subsurfacestartup.c
+++ b/subsurfacestartup.c
@@ -48,6 +48,7 @@ struct preferences default_prefs = {
        .doo2breaks = false,
        .drop_stone_mode = false,
        .switch_at_req_stop = false,
+       .check_ceiling_before_ascent = false,
        .min_switch_duration = 60,
        .last_stop = false,
        .verbatim_plan = false,
-- 
1.9.5 (Apple Git-50.3)

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to