xia_meta.health.generate_overlap_map

xia_meta.health.generate_overlap_map(reference_length: int, element_length: int) dict

Calculation: predefined overlap probability map

Pick a simple example:
  • period = 2**3 =8s, downtime_1 = 2**0 = 1s and downtime_2 = 2**1 = 2s

  • two downtime could be placed at any moment in the period thus a point of the surface of 8*8

  • The overlap means the abs(downtime_1 - downtime_2) < 1.5 (attention, the downtime time point is at the middle)

  • So the total probability of overlap should be 1-((8-1.5)/8)² = 34%

  • If no new downtime parameter is defined, the new downtime is defined by the overlap time.

It could be between 0-1s: * when (downtime_1 - downtime_2) < 0.5 => downtime of exact 1s = 12.1% * in the other case, The downtime decrease when two exact timetime become far away from each other. The new downtime will be: * P(min(downtime_1, downtime_2)) = abs(d1-d2)/(d1+d2) * P(min(downtime_1, downtime_2)/2) = 1-abs(d1-d2)/(d1+d2)