コード例 #1
0
        void validity_checker_t::valid_trajectory(const space_t* space, const trajectory_t& input, trajectory_t& result)
        {
            result.clear();

            foreach(state_t* state, input)
            {
                if( !is_valid(state) )
                    return;
                result.copy_onto_back(state);
            }
        }
コード例 #2
0
        void validity_checker_t::valid_trajectory_prefix(const space_t* space, const trajectory_t& input, trajectory_t& result, unsigned int size)
        {
            unsigned int traj_size = 0;
            result.clear();

            foreach(state_t* state, input)
            {
                if( !is_valid(state) || traj_size == size )
                    return;
                result.copy_onto_back(state);
                traj_size++;
            }
        }
int smp::minimum_time_reachability<typeparams,NUM_DIMENSIONS>
::get_solution (trajectory_t &trajectory_out) {


  if (!min_cost_vertex)
    return 1;

  trajectory_out.clear();

  for (typename list<state_t*>::iterator it_state = min_cost_trajectory.list_states.begin();
       it_state != min_cost_trajectory.list_states.end(); it_state++) {

    trajectory_out.list_states.push_front (new state_t(**it_state));
  }

  for (typename list<input_t*>::iterator it_input = min_cost_trajectory.list_inputs.begin();
       it_input != min_cost_trajectory.list_inputs.end(); it_input++) {
    trajectory_out.list_inputs.push_front (new input_t(**it_input));
  }



  return 1;
}