COPASI API  4.16.103
CCopasiProblem.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/utilities/CCopasiProblem.cpp,v $
3 // $Revision: 1.21 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2008/03/12 00:33:30 $
7 // End CVS Header
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 /**
19  * CCopasiProblem class.
20  * This class is used to describe a task in COPASI. This class is
21  * intended to be used as the parent class for all tasks whithin COPASI.
22  *
23  * Created for Copasi by Stefan Hoops 2003
24  */
25 
26 #include "copasi.h"
27 
28 #include "CCopasiProblem.h"
29 #include "model/CMetab.h"
30 #include "model/CModel.h"
32 #include "CCopasiVector.h"
33 
35  CCopasiParameterGroup("NoName", NULL, "Problem"),
36  mType(CCopasiTask::unset),
37  mpModel(NULL),
38  mpCallBack(NULL),
39  mpReport(NULL)
40 {}
41 
43  const CCopasiContainer * pParent):
44  CCopasiParameterGroup(CCopasiTask::TypeName[type], pParent, "Problem"),
45  mType(type),
46  mpModel(NULL),
47  mpCallBack(NULL),
48  mpReport(NULL)
49 {}
50 
52  const CCopasiContainer * pParent):
53  CCopasiParameterGroup(src, pParent),
54  mType(src.mType),
55  mpModel(src.mpModel),
56  mpCallBack(src.mpCallBack),
57  mpReport(src.mpReport)
58 {}
59 
61 
63 
65 {
66  mpModel = pModel;
67  return true;
68 }
69 
71 
73 {
74  mpCallBack = pCallBack;
75  return true;
76 }
77 
78 // propably for optimization only
79 
80 bool CCopasiProblem::initialize() {return true;}
81 
82 bool CCopasiProblem::restore(const bool & /* updateModel */) {return true;}
83 
84 void CCopasiProblem::print(std::ostream * ostream) const
85  {*ostream << *this;}
86 
87 void CCopasiProblem::printResult(std::ostream * ostream) const
88  {*ostream << "Not implemented.";}
89 
90 std::ostream &operator<<(std::ostream &os, const CCopasiProblem & o)
91 {
92  os << "Problem Description:" << std::endl;
93 
94  CCopasiParameterGroup::parameterGroup::const_iterator it =
95  o.CCopasiParameter::getValue().pGROUP->begin();
96  CCopasiParameterGroup::parameterGroup::const_iterator end =
97  o.CCopasiParameter::getValue().pGROUP->end();
98 
99  for (; it != end; ++it)
100  {
101  (*it)->print(&os);
102  os << std::endl;
103  }
104 
105  return os;
106 }
std::ostream & operator<<(std::ostream &os, const CCopasiProblem &o)
virtual void print(std::ostream *ostream) const
virtual bool setModel(CModel *pModel)
CCopasiTask::Type mType
virtual bool restore(const bool &updateModel)
Definition: CModel.h:50
virtual bool setCallBack(CProcessReport *pCallBack)
CModel * mpModel
CProcessReport * mpCallBack
virtual void printResult(std::ostream *ostream) const
const CCopasiTask::Type & getType() const
CModel * getModel() const
virtual bool initialize()
virtual ~CCopasiProblem()