COPASI API  4.16.103
COscillationMethod.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/oscillation/COscillationMethod.cpp,v $
3 // $Revision: 1.1 $
4 // $Name: $
5 // $Author: ssahle $
6 // $Date: 2008/11/11 16:47:54 $
7 // End CVS Header
8 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
9 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
10 // and The University of Manchester.
11 // All rights reserved.
12 
13 #include "copasi.h"
14 
15 #include "COscillationTask.h"
16 #include "COscillationMethod.h"
17 #include "COscillationProblem.h"
18 
20 
22 {
23  COscillationMethod * pMethod = NULL;
24 
25  switch (subType)
26  {
27  case oscillationIntegrate:
28  pMethod = new COscillationMethodIntegrate();
29  break;
30 
31  default:
32  pMethod = new COscillationMethodIntegrate();
33  }
34  //TODO
35  return pMethod;
36 }
37 
38 // Default constructor
40  CCopasiMethod(CCopasiTask::optimization, CCopasiMethod::unset),
41  mpOscProblem(NULL)
42  // mpParentTask(NULL),
44 
46  const COscillationMethod::SubType & subType,
47  const CCopasiContainer * pParent):
48  CCopasiMethod(taskType, subType, pParent),
49  mpOscProblem(NULL)
50  // mpParentTask(NULL),
52 
54  const CCopasiContainer * pParent):
55  CCopasiMethod(src, pParent),
56  mpOscProblem(src.mpOscProblem)
57  // mpParentTask(src.mpParentTask),
59 
61 {}
62 
64 {
65  assert(problem);
66  mpOscProblem = problem;
67 }
68 
69 // bool COscillationMethod::run(void)
70 // {
71 // return false;
72 //}
73 
75 {
76  if (!mpOscProblem)
77  return false;
78 
79  // mpParentTask = dynamic_cast<COptTask *>(getObjectParent());
80  // if (!mpParentTask) return false;
81 
82  return true;
83 }
84 
86 {return true;}
87 
88 //virtual
90 {
91  if (!CCopasiMethod::isValidProblem(pProblem)) return false;
92 
93  const COscillationProblem * pTP = dynamic_cast<const COscillationProblem *>(pProblem);
94  if (!pTP)
95  {
96  CCopasiMessage(CCopasiMessage::EXCEPTION, "Problem is not an oscillation detection problem.");
97  return false;
98  }
99 
100  return true;
101 }
virtual bool initialize()
void setProblem(COscillationProblem *problem)
virtual bool isValidProblem(const CCopasiProblem *pProblem)
virtual bool isValidProblem(const CCopasiProblem *pProblem)
COscillationProblem * mpOscProblem
static COscillationMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::oscillationIntegrate)
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202