EgtNumKernel 2.3k1 :

- in ShortestPath aumentato il numero max di punti consentiti.
This commit is contained in:
SaraP
2021-11-18 09:34:24 +01:00
parent 82b402e7eb
commit ec9e4b4c76
10 changed files with 44 additions and 48 deletions
+5 -5
View File
@@ -159,23 +159,23 @@ ShortestPath::ZigZag( void)
// ne calcolo il risultato
m_nMinCost = TotalCost() ;
string sOut = "-- ZigZag/OneWay : TotalCost = " + ToString( (int)m_nMinCost) ;
string sOut = "-- ZigZag/OneWay : TotalCost = " + to_string( m_nMinCost) ;
MY_LOG( sOut.c_str()) ;
return true ;
}
//----------------------------------------------------------------------------
unsigned
ShortestPath::TotalCost( void)
long long unsigned
ShortestPath::TotalCost( void)
{
unsigned nCost = 0 ;
long long unsigned nCost = 0 ;
// ciclo sui nodi
for ( unsigned i = 1 ; i < m_nNumPnts ; ++ i) {
double dDx = m_Points[m_nOrder[i]].dXi - m_Points[m_nOrder[i-1]].dXi ;
double dDy = m_Points[m_nOrder[i]].dYi - m_Points[m_nOrder[i-1]].dYi ;
double dDz = m_Points[m_nOrder[i]].dZi - m_Points[m_nOrder[i-1]].dZi ;
nCost += unsigned( sqrt( dDx * dDx + dDy * dDy + dDz * dDz)) ;
nCost += (long long unsigned)( sqrt( dDx * dDx + dDy * dDy + dDz * dDz)) ;
}
return nCost ;
}