unsigned int mtspSolution::depot() const { for (unsigned int i = 0; i < _size; i++) { if (_route[i] == 0) return i; } throw edaException(this, "There is no depot in the route !"); }
void schedSwapArea::update(edaSolution& sol) { checkError(); schedSolution& route = (schedSolution&) sol; route.checkError(); double fitness = route.evaluate(); if(route == *_route) { eda::swap( route[_first ], route[_second] ); route.set(route.evaluate()); } else { throw edaException(this, "The input solution is not same the solution in the neighbor !"); } }
void mtspSolution::initError() const { if (_size == 0) throw edaException(this, "Not initial the route !"); if (_size != _graph->size()) throw edaException(this, "The route not satisfy the graph !"); }
void mtspSolution::graphError() const { if (_graph == NULL) throw edaException(this, "Not set graph !"); _graph->checkError(); }