Beispiel #1
0
void
GiLightObject::draw(QGLViewer *viewer,
		    bool active,
		    bool backToFront)
{
  if (m_updateFlag)
    {
      m_updateFlag = false;

      computePathLength();
    }

  if (m_show)
    drawLines(viewer, active, backToFront);
}
Beispiel #2
0
void CGeneticSystem::updateBestSoFarPath()
{
   
	int dist = computePathLength(m_bestSoFarPath);

	int irrdist = getBestPathLength();
	if(dist > irrdist || firsttime == 1)
	{
		  m_bestSoFarPath =  m_ChromoPopulation[0].getPath();
	}


//	for(int i = 0; i < m_populationSize; i++)
//	{
//		if(computePathLength(m_bestSoFarPath) > m_ChromoPopulation[i].getDistance() || this->firsttime ==1)
//		{
//			firsttime = 0;
//            for(int j = 0; j < m_noCitys; j++)
//                m_bestSoFarPath[j] = m_ChromoPopulation[i].getGene(j);
  //      }

//    }
}
Beispiel #3
0
int CGeneticSystem::getBestSoFarPathLength()
{
    return computePathLength(m_bestSoFarPath);
}
Beispiel #4
0
QList<Vec> GiLightObject::pathY()
{
  if (m_updateFlag)
    computePathLength();
  return m_pathY;
}
Beispiel #5
0
QList<Vec> GiLightObject::tangents()
{
  if (m_updateFlag)
    computePathLength();
  return m_tgP;
}