コード例 #1
0
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 !");
}
コード例 #2
0
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 !");
    }
}
コード例 #3
0
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 !");
}
コード例 #4
0
void mtspSolution::graphError() const {
    if (_graph == NULL)
        throw edaException(this, "Not set graph !");
    _graph->checkError();
}