32 static bool init =
false;
35 logger <<
"Warning: Calling frepple::LibrarySolver::initialize() more "
36 <<
"than once." << endl;
51 (
"solver",
"solver_mrp",Object::createString<SolverMRP>,
true);
81 logger <<
"Start solving cluster " << cluster <<
" at " << Date::now() << endl;
95 for (deque<Demand*>::const_iterator i = demands->begin();
96 i != demands->end(); ++i)
102 (*i)->getConstraints().clear();
110 try {(*i)->solve(*Solver,
this);}
121 logger <<
"Error: Caught an exception while solving demand '"
122 << (*i)->getName() <<
"':" << endl;
124 catch (
const bad_exception&) {
logger <<
" bad exception" << endl;}
125 catch (
const exception& e) {
logger <<
" " << e.what() << endl;}
126 catch (...) {
logger <<
" Unknown type" << endl;}
147 logger <<
"Error: Caught an exception while solving cluster "
148 << cluster <<
":" << endl;
150 catch (
const bad_exception&) {
logger <<
" bad exception" << endl;}
151 catch (
const exception& e) {
logger <<
" " << e.what() << endl;}
152 catch (...) {
logger <<
" Unknown type" << endl;}
156 if (f->getCluster() == cluster)
157 f->deleteOperationPlans();
165 logger <<
"End solving cluster " << cluster <<
" at " << Date::now() << endl;
173 demands_per_cluster[i->getCluster()].push_back(&*i);
184 if (demands_per_cluster.find(e->getCluster())!=demands_per_cluster.end())
185 e->deleteOperationPlans();
188 int cl = demands_per_cluster.size();
200 for (classified_demand::iterator j = demands_per_cluster.begin();
201 j != demands_per_cluster.end(); ++j)
209 if (gres->getSetupMatrix()) gres->updateSetups();
230 if (iteration_threshold != 1.0)
232 if (iteration_accuracy != 0.01)
241 if (userexit_resource)
243 if (userexit_operation)
335 PyObject *dem = NULL;
336 if (args && !PyArg_ParseTuple(args,
"|O:solve", &dem))
return NULL;
340 Py_BEGIN_ALLOW_THREADS
361 PythonType::evalException();
365 return Py_BuildValue(
"");
371 Py_BEGIN_ALLOW_THREADS
376 me->
commands.CommandManager::commit();
381 PythonType::evalException();
385 return Py_BuildValue(
"");
391 Py_BEGIN_ALLOW_THREADS
399 PythonType::evalException();
403 return Py_BuildValue(
"");