Mercurial > public > ostc4
comparison Discovery/Src/base.c @ 250:822416168585 bm-2
Buelmann: new implementation for ceiling
Since my first functional fix in the ceiling computation in
commit ceecabfddb57, I noticed that the computation used a
linear search, that became rather computational expensive after
that commit. The simple question is: why not a binary search?
So, this commit implements the binary search. But there is a long
story attached to this. Comparing ceiling results from hwOS and this
OSTC4 code were very different. Basically, the original OSTC4
algorithm computed the ceiling using the same GFlow to GFhigh
slope, in such a way, that the ceiling was in sync with the
presented deco stops, where the hwOS code presents a GFhigh
based ceiling.
This said, it is more logical when the OSTC4 and hwOS code give
similar results. This new recursive algorithm gives very similar
results for the ceiling compared to hwOS.
To be complete here, the Buelmann ceiling is the depth to which
you can ascend, so that the leading tissue reaches GFhigh. This
also explains why the deepest deco stop is normally deeper than
the ceiling (unless one dives with GF like 80/80).
The code implemented here is rather straightforward recursion.
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
author | Jan Mulder <jlmulder@xs4all.nl> |
---|---|
date | Thu, 11 Apr 2019 17:48:48 +0200 |
parents | ac2b06b5d09f |
children | a6c0375bc950 |
comparison
equal
deleted
inserted
replaced
249:cefee1448ea6 | 250:822416168585 |
---|---|
1704 vpm_calc(&stateDeco.lifeData,&stateDeco.diveSettings,&stateDeco.vpm,&stateDeco.decolistFutureVPM, FUTURESTOPS); | 1704 vpm_calc(&stateDeco.lifeData,&stateDeco.diveSettings,&stateDeco.vpm,&stateDeco.decolistFutureVPM, FUTURESTOPS); |
1705 decoLock = DECO_CALC_FINSHED_Futurevpm; | 1705 decoLock = DECO_CALC_FINSHED_Futurevpm; |
1706 return; | 1706 return; |
1707 case CALC_BUEHLMANN: | 1707 case CALC_BUEHLMANN: |
1708 buehlmann_calc_deco(&stateDeco.lifeData,&stateDeco.diveSettings,&stateDeco.decolistBuehlmann); | 1708 buehlmann_calc_deco(&stateDeco.lifeData,&stateDeco.diveSettings,&stateDeco.decolistBuehlmann); |
1709 buehlmann_ceiling_calculator(&stateDeco.lifeData,&stateDeco.diveSettings,&stateDeco.decolistBuehlmann); | 1709 buehlmann_ceiling_calculator(&stateDeco.lifeData, &stateDeco.decolistBuehlmann); |
1710 buehlmann_super_saturation_calculator(&stateDeco.lifeData,&stateDeco.decolistBuehlmann); | 1710 buehlmann_super_saturation_calculator(&stateDeco.lifeData,&stateDeco.decolistBuehlmann); |
1711 decoLock = DECO_CALC_FINSHED_Buehlmann; | 1711 decoLock = DECO_CALC_FINSHED_Buehlmann; |
1712 return; | 1712 return; |
1713 case CALC_BUEHLMANN_FUTURE: | 1713 case CALC_BUEHLMANN_FUTURE: |
1714 decom_tissues_exposure(stateDeco.diveSettings.future_TTS_minutes * 60,&stateDeco.lifeData); | 1714 decom_tissues_exposure(stateDeco.diveSettings.future_TTS_minutes * 60,&stateDeco.lifeData); |
1715 buehlmann_calc_deco(&stateDeco.lifeData,&stateDeco.diveSettings,&stateDeco.decolistFutureBuehlmann); | 1715 buehlmann_calc_deco(&stateDeco.lifeData,&stateDeco.diveSettings,&stateDeco.decolistFutureBuehlmann); |
1716 //buehlmann_ceiling_calculator(&stateDeco.lifeData,&stateDeco.diveSettings,&stateDeco.decolistBuehlmann); | |
1717 decoLock = DECO_CALC_FINSHED_FutureBuehlmann; | 1716 decoLock = DECO_CALC_FINSHED_FutureBuehlmann; |
1718 return; | 1717 return; |
1719 default: break; | 1718 default: break; |
1720 } | 1719 } |
1721 counter++; | 1720 counter++; |