sr_rcd/tmspace.rs
1use crate::point::Point;
2
3/// Time-dependent-metric (timetric) space.
4///
5/// **F-timetric.** Let X be a non-empty set and τ be a nonnegative function defined on ℝ×X×X that satisfies the following axioms:
6///
7/// 1. *Forward reflexivity:* for any t ∊ ℝ: τ(t, **x**, **y**) = 0 if and only if **x** = **y**,
8///
9/// 2. *Forward timed triangle inequality:* for any t ∊ ℝ and any **x**, **y**, **z** ∊ X: τ(t, **x**, **y**) ≤ τ(t, **x**, **z**) + τ(t + τ(t, **x**, **z**), **z**, **y**).
10///
11/// Then (X, τ) is called an *f-timetric* space.
12///
13/// **B-timetric.** Let X be a non-empty set and τ̅ be a nonnegative function defined on ℝ×X×X that satisfies the following axioms:
14///
15/// 1. *Backward reflexivity:* for any t ∊ ℝ: τ̅(t, **x**, **y**) = 0 if and only if **x** = **y**,
16///
17/// 2. *Backward timed triangle inequality:* for any t ∊ ℝ and any **x**, **y**, **z** ∊ X: τ̅(t, **x**, **y**) ≤ τ̅(t, **z**, **y**) + τ̅(t - τ̅(t, **z**, **y**), **x**, **z**).
18///
19///Then (X, τ̅) is called a *b-timetric* space.
20pub trait TimetricSpace: Sync {
21 /// How many coordinates a point of the space has.
22 fn dim(&self) -> usize;
23
24 /// Forward timetric τ: time required for sound wave that was emitted in `p_from` at the instant `t_from` to propagate to `p_to`.
25 fn ftau(&self, t_from: f64, p_from: &Point, p_to: &Point) -> f64;
26
27 /// Backward timetric τ̅: time required for sound wave that was emitted in `p_from` to propagate to `p_to` and reach it at the instant `t_to`.
28 fn btau(&self, t_to: f64, p_from: &Point, p_to: &Point) -> f64;
29
30 /// A metric equivalent to ψ̅(**x**, **y**),
31 ///
32 /// where the metric ψ̅(**x**, **y**) = max{φ̅(**x**, **y**), φ̅(**y**, **x**)}
33 ///
34 /// and the quasi-metric φ̅(**x**, **y**) = sup{t ∊ ℝ}τ̅(t, **x**, **y**)
35 fn rho(&self, p1: &Point, p2: &Point) -> f64;
36
37 /// ψ̅(**x**, **y**) ≥ α · ρ(**x**, **y**)
38 fn alpha(&self) -> f64;
39
40 /// ψ̅(**x**, **y**) ≤ β · ρ(**x**, **y**)
41 fn beta(&self) -> f64;
42
43 /// Anchors of coverands of `radius`/2 that cover the coverand with anchor `anchor` of `radius`.
44 fn make_rc_anchors(&self, anchor: &Point, radius: f64) -> Vec<Point>;
45}