pub struct Topp2ProblemBuilder<'a> {
pub constraints: &'a Constraints,
pub idx_s_interval: (usize, usize),
pub a_boundary: (f64, f64),
}Expand description
Builder for Topp2Problem.
§Example
The example below builds the smallest TOPP2 problem from a robot’s station grid.
use copp::robot::Robot;
use copp::solver::topp2_ra::Topp2ProblemBuilder;
let mut robot = Robot::with_capacity(2usize, 3);
let s = [0.0, 0.5, 1.0];
robot.with_s(s.as_slice())?;
let problem = Topp2ProblemBuilder::new(&robot, (0, 2), (0.0, 0.0)).build()?;
assert_eq!(problem.s_len(), 3);Fields§
§constraints: &'a ConstraintsReference to path constraints.
idx_s_interval: (usize, usize)Closed station-index interval (idx_s_start, idx_s_final).
a_boundary: (f64, f64)Endpoint state tuple (a_start, a_final).
Implementations§
Source§impl<'a> Topp2ProblemBuilder<'a>
impl<'a> Topp2ProblemBuilder<'a>
Sourcepub fn new<M: RobotBasic>(
robot: &'a Robot<M>,
idx_s_interval: (usize, usize),
a_boundary: (f64, f64),
) -> Self
pub fn new<M: RobotBasic>( robot: &'a Robot<M>, idx_s_interval: (usize, usize), a_boundary: (f64, f64), ) -> Self
Create a TOPP2 builder from a Robot reference.
§Parameters
robot: robot wrapper with the traitRobotBasicwhose constraint buffer defines the problem domain.idx_s_interval: closed station-index interval(idx_s_start, idx_s_final).a_boundary: endpoint state tuple(a_start, a_final).
Sourcepub fn with_constraint(
constraints: &'a Constraints,
idx_s_interval: (usize, usize),
a_boundary: (f64, f64),
) -> Self
pub fn with_constraint( constraints: &'a Constraints, idx_s_interval: (usize, usize), a_boundary: (f64, f64), ) -> Self
Create a TOPP2 builder with all required fields.
§Parameters
constraints: reference to path constraints defining the problem domain.idx_s_interval: closed station-index interval(idx_s_start, idx_s_final).a_boundary: endpoint state tuple(a_start, a_final).
Sourcepub fn build(&self) -> Result<Topp2Problem<'a>, CoppError>
pub fn build(&self) -> Result<Topp2Problem<'a>, CoppError>
Build a validated Topp2Problem.
Auto Trait Implementations§
impl<'a> Freeze for Topp2ProblemBuilder<'a>
impl<'a> RefUnwindSafe for Topp2ProblemBuilder<'a>
impl<'a> Send for Topp2ProblemBuilder<'a>
impl<'a> Sync for Topp2ProblemBuilder<'a>
impl<'a> Unpin for Topp2ProblemBuilder<'a>
impl<'a> UnwindSafe for Topp2ProblemBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.