Package kenozooid :: Module simulation

Module simulation

source code

Dive simulation routines.
Functions
 
parse(spec)
Parse dive plan specification.
source code
 
interpolate(spec)
Interpolate dive plan times and depths.
source code
 
simulate(simulator, spec, start=True, stop=True)
Simulate dive with specified simulator and dive specification.
source code
Function Details

parse(spec)

source code 

Parse dive plan specification.

Dive plan specification string is a space separated list of dive run time and depth values. For example dive plan

RT[min] | Depth[m] |
1:00 | 10 |
12:20 | 21 |
18:30 | 21 |
40:00 | 5 |
43:00 | 5 |
45:00 | 0 |

is represented by string as follows:

1:00,10 12:20,21 18:30,21 40:00,5 43:00,5 45:00,0

which can be described as

Run time can be specified in

  • seconds, i.e. 15, 20, 3600
  • minutes, i.e. 12:20, 14:00, 67:13

Depth is always specified in meters.

Dive plan specification is returned as iterator of runtime and depth pairs is returned. Returned runtime is always in seconds since start of a dive. Depth is specified in meters.

Parameters:
  • spec - Dive plan specification string.

interpolate(spec)

source code 

Interpolate dive plan times and depths.

:Parameters:
 spec
    Dive plan specification (as returned by ``parse`` function).

.. seealso::
    ``parse``

simulate(simulator, spec, start=True, stop=True)

source code 
Simulate dive with specified simulator and dive specification.
Parameters:
  • simulator - Device driver simulator implementation.
  • spec - Dive plan specification.
  • start - If False then simulation is assumed to be started.
  • stop - If False then simulation won't be stopped.