Commit 81b8d4ab authored by Jean-Benoist Leger's avatar Jean-Benoist Leger

APPROX CRITERION are default one now

parent c16392a3
......@@ -184,29 +184,12 @@ double rv_heuristic(
nodeF->lat,
nodeF->elevation);
if(parameters.criterion == RV_CRITERION_ENERGY)
{
double delta_elevation = nodeF->elevation - nodeA->elevation;
double min_energy = parameters.mass * RV_G * (parameters.Cr * distance_AF + delta_elevation);
if(min_energy<0)
min_energy = 0;
return(statusA.criterion + min_energy);
}
if(parameters.criterion == RV_CRITERION_TIME)
{
double delta_elevation = nodeF->elevation - nodeA->elevation;
double min_energy = parameters.mass * RV_G * (parameters.Cr * distance_AF + delta_elevation);
if(min_energy<0)
min_energy = 0;
return(statusA.criterion + min_energy/parameters.power);
}
if(parameters.criterion == RV_CRITERION_DISTANCE)
{
return(statusA.criterion + distance_AF);
}
if(parameters.criterion == RV_CRITERION_ENERGY_APPROX || parameters.criterion == RV_CRITERION_TIME_APPROX)
if(parameters.criterion == RV_CRITERION_ENERGY || parameters.criterion == RV_CRITERION_TIME)
{
double delta_elevation = nodeF->elevation - nodeA->elevation;
double velocity = rv_constant_speed_with_constant_power(parameters, distance_AF, delta_elevation);
......@@ -214,7 +197,7 @@ double rv_heuristic(
if(min_energy<0)
min_energy = 0;
if(parameters.criterion == RV_CRITERION_ENERGY_APPROX)
if(parameters.criterion == RV_CRITERION_ENERGY)
return(statusA.criterion + min_energy);
else
return(statusA.criterion + min_energy/parameters.power);
......@@ -328,9 +311,9 @@ void rv_step(
statusB.distance = statusA.distance + distance_AB;
statusB.power = power;
if(parameters.criterion == RV_CRITERION_ENERGY || parameters.criterion == RV_CRITERION_ENERGY_APPROX || parameters.criterion == RV_CRITERION_ENERGY_D)
if(parameters.criterion == RV_CRITERION_ENERGY || parameters.criterion == RV_CRITERION_ENERGY_D)
statusB.criterion = statusA.criterion + energy * penalty;
else if(parameters.criterion == RV_CRITERION_TIME || parameters.criterion == RV_CRITERION_TIME_APPROX || parameters.criterion == RV_CRITERION_TIME_D)
else if(parameters.criterion == RV_CRITERION_TIME || parameters.criterion == RV_CRITERION_TIME_D)
statusB.criterion = statusA.criterion + time * penalty;
else if(parameters.criterion == RV_CRITERION_DISTANCE)
statusB.criterion = statusA.criterion + distance_AB * penalty;
......
......@@ -59,8 +59,6 @@ enum criterion_t
RV_CRITERION_ENERGY,
RV_CRITERION_TIME,
RV_CRITERION_DISTANCE,
RV_CRITERION_ENERGY_APPROX,
RV_CRITERION_TIME_APPROX,
RV_CRITERION_ENERGY_D,
RV_CRITERION_TIME_D
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment