Commits

bergsoe committed 49f713e

New [PaplInterpolate.option_t] type.

  • Participants
  • Parent commits 5d39fc6

Comments (0)

Files changed (2)

File src/PaplInterpolate.ml

 
 type 'a t = 'a -> 'a -> float -> 'a
 
+type 'a option_t = 'a -> 'a -> float -> 'a option
+
 type 'a intermediary_t = 'a -> 'a -> 'a BatEnum.t
 
 let stop () = raise BatEnum.No_more_elements

File src/PaplInterpolate.mli

 type 'a t = 'a -> 'a -> float -> 'a
 (** Interpolation function for a planning space.
 
-    An interpolation function [interpolate] called as [x = interpolate s a b]
+    An interpolation function [interpolate] called as [x = interpolate a b s]
     returns a configuration [x] on the movement connecting [a] to [b]. The
     interpolation parameter [s] must be in the range [\[0, 1\]].
 *)
 
+type 'a option_t = 'a -> 'a -> float -> 'a option
+(** Optional interpolation for a planning space.
+
+    An interpolation function [interpolate] of this type called as [interpolate
+    a b s] returns [None] if a point [x] for the motion from [a] to [b] can't be
+    found for the position [s]. Otherwise the function returns [Some x].
+
+    The function may {e not} guarantee that if [interpolate a b s] succeeds (or
+    fails) for some [s] then [interpolate a b s] will succeed (or fail) for {e
+    all} [s].
+*)
+
 type 'a intermediary_t = 'a -> 'a -> 'a BatEnum.t
 (** Splitting of a movement into intermediary configurations.