Commit 7370d07f authored by jben's avatar jben

mise à jour status

parent 00830b11
......@@ -136,14 +136,15 @@ int main(int argc, char* argv[])
model m_model(mode,d_VplatKMH,d_masse,d_Cr,d_SCx,d_rho_air,d_vent_from,d_vent_VKMH);
double d_total_dist=0;
printf("# searching\n");
fflush(stdout);
double d_total_dist_min=0;
std::list<unsigned long long> l_id;
std::list<double> l_distances;
std::list<double> l_dists_min;
{ // to destroy database object
database D_db(s_db);
......@@ -162,9 +163,9 @@ int main(int argc, char* argv[])
continue;
}
double d_d=m_model.dist_node(D_db.get_node(*it_id),D_db.get_node(previous));
l_distances.push_back(d_d);
d_total_dist+=d_d;
double d_c=m_model.dist_node(D_db.get_node(*it_id),D_db.get_node(previous));
l_dists_min.push_back(d_c);
d_total_dist_min+=d_c;
previous=*it_id;
......@@ -179,7 +180,7 @@ int main(int argc, char* argv[])
int troncon=0;
double d_status_offset=0;
std::list<double>::iterator it_dist=l_distances.begin();
std::list<double>::iterator it_dist_min=l_dists_min.begin();
for(std::list<unsigned long long>::iterator it_id=l_id.begin();it_id!=l_id.end();it_id++)
{
if(it_id==l_id.begin())
......@@ -188,7 +189,7 @@ int main(int argc, char* argv[])
continue;
}
double d_status_echelle=(*it_dist++)/d_total_dist;
double d_status_echelle=(*it_dist_min++)/d_total_dist_min;
route r_route(s_db,m_model,previous,*it_id);
......
......@@ -19,7 +19,7 @@ void route::go()
P_depart.d_cout_minimal = m_model.cout_etat(P_depart.e_etat_cycliste_optimal);
P_depart.ull_from=0;
double d_dist_min_totale = P_depart.d_dist_min_arrive;
double d_dist_min_total = P_depart.d_dist_min_arrive;
double d_status;
S_queue.push(node_in_queue(ull_depart,P_depart.d_cout_minimal + P_depart.d_cout_minimal_arrive));
......@@ -36,11 +36,11 @@ void route::go()
node_parcouru & P_en_cours = M_map[ull_en_cours];
P_en_cours.b_frozen=true;
double d_nstatus=1-P_en_cours.d_dist_min_arrive/d_dist_min_totale;
double d_nstatus=1-P_en_cours.d_dist_min_arrive/d_dist_min_total;
if(d_nstatus>d_status)
{
d_status=d_nstatus;
double d_realstatus = d_status*d_status*d_status_echelle+d_status_offset;
double d_realstatus = .5*(d_status*d_status+d_status)*d_status_echelle+d_status_offset;
printf("# status: %.4f\n",d_realstatus);
fflush(stdout);
}
......
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