Beispiel #1
0
 double operator()(const PointDiff& a, const Topology& s) const {
   try {
     detail::generic_interpolator_impl<svp_interpolator,Topology,TimeSpaceType> interp;
     interp.initialize(s.origin(), s.adjust(s.origin(),a), 0.0, s, *t_space, *this);
     return interp.get_minimum_travel_time();
   } catch(optim::infeasible_problem& e) { RK_UNUSED(e);
     return std::numeric_limits<double>::infinity();
   };
 };
 state_type operator()(const Topology& space) const {
   using ReaK::to_vect;
   using ReaK::from_vect;
   
   boost::variate_generator< global_rng_type&, boost::normal_distribution<scalar_type> > var_rnd(get_global_rng(), boost::normal_distribution<scalar_type>());
   
   typedef typename pp::topology_traits<Topology>::point_difference_type state_difference_type;
   BOOST_CONCEPT_ASSERT((CovarianceMatrixConcept<covariance_type,state_difference_type>));
   
   vect_n<scalar_type> z = to_vect<scalar_type>(space.difference(mean_state, mean_state));
   for(size_type i = 0; i < z.size(); ++i)
     z[i] = var_rnd();
   
   return space.adjust(mean_state, from_vect<state_difference_type>(L * z));
 };
Beispiel #3
0
 double operator()(const PointDiff& a, const Topology& s) const {
   typedef typename topology_traits<Topology>::point_type PointType;
   double d = std::numeric_limits<double>::infinity();
   try {
     PointType p = s.adjust(s.origin(),a);
     // guarantee symmetry by computing reach-times in both directions:
     detail::generic_interpolator_impl<svp_interpolator,Topology,TimeSpaceType> interp;
     interp.initialize(s.origin(), p, 0.0, s, *t_space, *this);
     d = interp.get_minimum_travel_time();
     interp.initialize(p, s.origin(), 0.0, s, *t_space, *this);
     double d2 = interp.get_minimum_travel_time();
     // pick the minimal value:
     if( d2 < d)
       d = d2;
   } catch(optim::infeasible_problem& e) { RK_UNUSED(e); };
   if( d == std::numeric_limits<double>::infinity() )
     return get(proper_metric, s)(a, s);
   return d;
 };
Beispiel #4
0
 double operator()(const PointDiff& a, const Topology& s) const {
   detail::generic_interpolator_impl<svp_interpolator,Topology,TimeSpaceType> interp;
   interp.initialize(s.origin(), s.adjust(s.origin(),a), 0.0, s, *t_space, *this);
   return interp.get_minimum_travel_time();
 };