<commit_before>#ifndef _RRGLIB_COST_EVALUATOR_TIME_HPP_
#define _RRGLIB_COST_EVALUATOR_TIME_HPP_

#include <iostream>

#include <components/cost_evaluators/time.h>

#include <components/cost_evaluators/base.hpp>


using namespace std;


template< class typeparams >
int rrglib::cost_evaluator_time<typeparams>
::ce_update_vertex_cost (vertex_t *vertex_in) {

  return 1;
}


template< class typeparams >
int rrglib::cost_evaluator_time<typeparams>
::ce_update_edge_cost (edge_t *edge_in) {
  
  return 1;
}



template< class typeparams >
double rrglib::cost_evaluator_time<typeparams>
::evaluate_cost_trajectory (state_t *state_initial_in,
			    trajectory_t *trajectory_in,
			    state_t *state_final_in) {

  double total_time = 0.0;
  for (typename list<input_t*>::iterator iter = trajectory_in->list_inputs.begin();
       iter != trajectory_in->list_inputs.end(); iter++) {
    
    input_t *input_curr = *iter;
    
    total_time += (*input_curr)[0];
    
  }
  
  return total_time;
};

#endif<commit_msg>Assert that time cost evaluation is positive<commit_after>#ifndef _RRGLIB_COST_EVALUATOR_TIME_HPP_
#define _RRGLIB_COST_EVALUATOR_TIME_HPP_

#include <cassert>
#include <iostream>

#include <components/cost_evaluators/time.h>

#include <components/cost_evaluators/base.hpp>


using namespace std;


template< class typeparams >
int rrglib::cost_evaluator_time<typeparams>
::ce_update_vertex_cost (vertex_t *vertex_in) {

  return 1;
}


template< class typeparams >
int rrglib::cost_evaluator_time<typeparams>
::ce_update_edge_cost (edge_t *edge_in) {
  
  return 1;
}



template< class typeparams >
double rrglib::cost_evaluator_time<typeparams>
::evaluate_cost_trajectory (state_t *state_initial_in,
			    trajectory_t *trajectory_in,
			    state_t *state_final_in) {

  double total_time = 0.0;
  for (typename list<input_t*>::iterator iter = trajectory_in->list_inputs.begin();
       iter != trajectory_in->list_inputs.end(); iter++) {
    
    input_t *input_curr = *iter;
    
    total_time += (*input_curr)[0];
    
  }
  assert( total_time > 0.0 );
  return total_time;
};

#endif
{'fraction_non_alphanumeric': 0.10810810810810811, 'fraction_numerical': 0.005689900426742532, 'mean_word_length': 5.063218390804598, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3818461', 'n_tokens_mistral': 809, 'n_tokens_neox': 777, 'n_words': 138}