EgtNumKernel 2.3k1 :
- in ShortestPath aumentato il numero max di punti consentiti.
This commit is contained in:
@@ -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 ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user