Some progress on the planner

Robert Helling helling at lmu.de
Thu Apr 17 01:54:55 PDT 2014


Hi everybody,

the last days, I have spend some time with the planner. All this has happened on my “oneplannertable” branch on github but here I send the currents state of affairs as a single patch to me merged with master before Tomaz in his aim to separate out things touches every single line in every single file in his attempt to weed out legacy connections between C and C++ code.

I guess I made some progress but the planner is still far from being complete or even presentable to the average user. Here is a list of things I did, Dirk, you may want to take the following as a commit message:

Improvement of various bits of the planner

Rewrite of the actual planner logic. Now ascend to the next potential stop depth. There the state is cached and we try to ascend to the next stop depth. If we hit the ceiling while doing that we go back to the cached state and wait there for a minute. Then we try again. Then loop. 

Converted all depth related variables from unsigned int to int. During planning, in a time step the current depth can temporarily be negative and comparisons of a negative int with an unsigned it have not the result I expected ( (int) -2 < (unsigned int) 3 turns out to be false). And we don’t really need the 32nd bit that unsigned buys us for depths.

Deco stops are now shown in the same table as manually entered stops in boldface (I removed the second table to save screen estate).

The gas shown in the table is still misleading as it means the gas used on the segment leading up to that event.

The update of the profile only works partially upon changes in the list of available gases.

Treatment of various gases is basically there but needs some more love.

The ascent velocity is now provided by a function that takes the current depth as argument. Currently it always returns 10m/min but that will later be variable (and hopefully user configurable).

The profile is not redrawn while deco is computed (avoiding an infinite recursion).

The table got a new column for the duration of a segment while the old “duration” column was renamed “Runtime” to reflect what it actually shows. Currently, only the run time but not the duration are editable.

All deco gases are used from the depth where their pO2 is 1.4bar. This should become more flexible.

Calculation of the pressure drop in cylinders without configured volumes is suppressed. This solves a problem with the planner crashing when saving a dive where not all cylinders had been manually given a volume. 

[Short rant break: Treating 0/0 as air bites back at so many places. E.g. Cylinder data is initialized with memsetting the whole structures to 0. Then later suddenly this totally unconfigured cylinder is being treated as it would contain air. Maybe at some point this was a feature. But it lead to a naughty bug which took me over an hour to resolve. We should seriously reconsider this choice and better move to 209/0 being air if changing this everywhere is not too much trouble]

Signed-off-by: Robert C. Helling <helling at atdotde.de>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: planner_work.patch
Type: application/octet-stream
Size: 30009 bytes
Desc: not available
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140417/5bf74530/attachment-0001.obj>
-------------- next part --------------


Happy easter holiday everybody!
Robert

-- 
.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO
Robert C. Helling     Elite Master Course Theoretical and Mathematical Physics
                      Scientific Coordinator
                      Ludwig Maximilians Universitaet Muenchen, Dept. Physik
                      Phone: +49 89 2180-4523  Theresienstr. 39, rm. B339
                      http://www.atdotde.de

Enhance your privacy, use cryptography! My PGP keys have fingerprints
A9D1 A01D 13A5 31FA 6515  BB44 0820 367C 36BC 0C1D    and
DCED 37B6 251C 7861 270D  5613 95C7 9D32 9A8D 9B8F




-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20140417/5bf74530/attachment-0001.sig>


More information about the subsurface mailing list