void GiLightObject::draw(QGLViewer *viewer, bool active, bool backToFront) { if (m_updateFlag) { m_updateFlag = false; computePathLength(); } if (m_show) drawLines(viewer, active, backToFront); }
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); // } // } }
int CGeneticSystem::getBestSoFarPathLength() { return computePathLength(m_bestSoFarPath); }
QList<Vec> GiLightObject::pathY() { if (m_updateFlag) computePathLength(); return m_pathY; }
QList<Vec> GiLightObject::tangents() { if (m_updateFlag) computePathLength(); return m_tgP; }