Summer work on the planner

Robert Helling helling at atdotde.de
Tue Aug 29 03:52:43 PDT 2017


Hi,

I just submitted a pull request for what I have done in the last week for the planner. Here is the comment with the request for feedback (but this is intended to be ready to be merged):

Instead of an essay, here is a pull request representing what I have done so far in my summer vacation.

The main goal is to provide information for contingency plans in the planner. To this end, we compute alternate plans where the final manually added segment is either deeper or shallower by 1m and either longer or shorter by 1min. From this we compute the change of total runtime upon these changes so the diver can estimate the effect of not exactly sticking to the plan (or allows a "per dive deco on the fly" calculation).

To this end, we need to compute stop times up to a second rather than up to a minute.

To not make this only a slow computation (rather than a terribly slow computation), on the way I improve the caching of Buehlmann factors to prevent recalculations of expensive transcendental functions and implement a binary search for the stop times (rather than repeatedly adding a fixed tilmestep). Those changes in themselves improve the responsiveness of the planner UI significantly in particular for dives with hours of decompression time.

What is still missing:
A ui element to turn this expensive calculation off.
A way to do this calculation in the background (I tried to implement this but the planner is not reentrant to a degree that I failed even with huge locks)
The variation information is computed in seconds for individual stops as is the second derivative (which tells about the validity of linear extrapolation). Currently there is no way to present this information to the user (except by printfs to stdout).
Finally, thanks to signals/slots flying in all directions, I do not understand when exactly the planner is called. I am under the impression it is called three times upon each change of a dive parameter in the UI. By understanding this, there is a possible 200% performance gain in sight.

Best
Robert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20170829/9b9517a7/attachment.sig>


More information about the subsurface mailing list