bool COptTask::initialize(const OutputFlag & of, COutputHandler * pOutputHandler, std::ostream * pOstream) { COptProblem * pProblem = dynamic_cast<COptProblem *>(mpProblem); COptMethod * pMethod = dynamic_cast<COptMethod *>(mpMethod); if (!pProblem || !pMethod) return false; //initialize reporting bool success = true; //do the part of the initialization of the subtask that needs to be //performed before the output is initialized. This is kind of a hack, //we need to find a more general solution for this if (!pProblem->initializeSubtaskBeforeOutput()) success = false; if (!CCopasiTask::initialize(of, pOutputHandler, pOstream)) success = false; //if (!mReport.open(pOstream)) success = false; //if (!mReport.compile()) success = false; if (!pProblem->initialize()) success = false; pMethod->setProblem(pProblem); // if (!pMethod->initialize()) return false; return success; }