COPASI API  4.16.103
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Private Member Functions | List of all members
CCopasiTask Class Reference

#include <CCopasiTask.h>

Inheritance diagram for CCopasiTask:
Inheritance graph
[legend]
Collaboration diagram for CCopasiTask:
Collaboration graph
[legend]

Classes

class  CDescription
 
class  CResult
 

Public Types

enum  eOutputFlagBase {
  INITIALIZE = 0x01, STREAM = 0x02, FINISH = 0x04, REPORT = 0x10,
  PLOT = 0x20, TIME_SERIES = 0x40
}
 
enum  OutputFlag {
  NO_OUTPUT = 0, OUTPUT_BEFORE = INITIALIZE, OUTPUT_AFTER = FINISH, OUTPUT = REPORT | PLOT | STREAM,
  OUTPUT_SE = REPORT | PLOT | INITIALIZE | STREAM | FINISH, OUTPUT_UI = REPORT | PLOT | TIME_SERIES | INITIALIZE | STREAM | FINISH, ONLY_TIME_SERIES = TIME_SERIES | INITIALIZE | STREAM | FINISH
}
 
enum  Type {
  steadyState = 0, timeCourse, scan, fluxMode,
  optimization, parameterFitting, mca, lyap,
  tssAnalysis, sens, moieties, crosssection,
  lna, unset
}
 
- Public Types inherited from CCopasiContainer
typedef std::multimap
< std::string, CCopasiObject * > 
objectMap
 
- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 

Public Member Functions

 CCopasiTask (const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const std::string &type="Task")
 
 CCopasiTask (const Type &taskType, const CCopasiContainer *pParent=NULL, const std::string &type="Task")
 
 CCopasiTask (const CCopasiTask &src, const CCopasiContainer *pParent=NULL)
 
void cleanup ()
 
virtual CCopasiMethodcreateMethod (const int &type) const
 
CProcessReportgetCallBack () const
 
const CDescriptiongetDescription () const
 
virtual const std::string & getKey () const
 
CCopasiMethodgetMethod ()
 
const CCopasiMethodgetMethod () const
 
COutputHandlergetOutputHandler () const
 
const OutputFlaggetOutputMode () const
 
CCopasiProblemgetProblem ()
 
const CCopasiProblemgetProblem () const
 
CReportgetReport ()
 
const CResultgetResult () const
 
CCopasiParameterGroupgetSliders ()
 
Type getType () const
 
virtual bool initialize (const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
 
const bool & isScheduled () const
 
const bool & isUpdateModel () const
 
virtual void output (const COutputInterface::Activity &activity)
 
virtual bool process (const bool &useInitialValues)
 
virtual bool restore ()
 
virtual void separate (const COutputInterface::Activity &activity)
 
virtual bool setCallBack (CProcessReport *pCallBack)
 
virtual bool setMethodType (const int &type)
 
void setScheduled (const bool &scheduled)
 
void setType (const Type &type)
 
void setUpdateModel (const bool &updateModel)
 
virtual bool updateMatrices ()
 
virtual ~CCopasiTask ()
 
- Public Member Functions inherited from CCopasiContainer
virtual bool add (CCopasiObject *pObject, const bool &adopt=true)
 
 CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container)
 
 CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL)
 
virtual std::string getChildObjectUnits (const CCopasiObject *pObject) const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
virtual const objectMapgetObjects () const
 
virtual std::string getUnits () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual bool remove (CCopasiObject *pObject)
 
virtual ~CCopasiContainer ()
 
- Public Member Functions inherited from CCopasiObject
void addDirectDependency (const CCopasiObject *pObject)
 
 CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL)
 
void clearDirectDependencies ()
 
void clearRefresh ()
 
bool dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const
 
void getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const
 
virtual CCopasiObjectName getCN () const
 
virtual const DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
UpdateMethodgetUpdateMethod () const
 
virtual voidgetValuePointer () const
 
bool hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
 
bool hasUpdateMethod () const
 
bool isArray () const
 
bool isContainer () const
 
bool isDataModel () const
 
bool isMatrix () const
 
bool isNameVector () const
 
bool isNonUniqueName () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
bool isReference () const
 
bool isRoot () const
 
bool isSeparator () const
 
bool isStaticString () const
 
bool isValueBool () const
 
bool isValueDbl () const
 
bool isValueInt () const
 
bool isValueInt64 () const
 
bool isValueString () const
 
bool isVector () const
 
virtual bool mustBeDeleted (const DataObjectSet &deletedObjects) const
 
virtual void print (std::ostream *ostream) const
 
void removeDirectDependency (const CCopasiObject *pObject)
 
void setDirectDependencies (const DataObjectSet &directDependencies)
 
bool setObjectName (const std::string &name)
 
virtual bool setObjectParent (const CCopasiContainer *pParent)
 
void setObjectValue (const C_FLOAT64 &value)
 
void setObjectValue (const C_INT32 &value)
 
void setObjectValue (const bool &value)
 
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const bool &))
 
virtual ~CCopasiObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Static Public Member Functions

static bool isValidMethod (const unsigned int &method, const unsigned int *validMethods)
 
- Static Public Member Functions inherited from CCopasiObject
static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 

Public Attributes

std::string Error
 
std::string Warning
 

Static Public Attributes

static const std::string TypeName []
 
static const unsigned int ValidMethods []
 
static const char * XMLType []
 
- Static Public Attributes inherited from CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 

Protected Attributes

CDescription mDescription
 
OutputFlag mDoOutput
 
std::string mKey
 
unsigned C_INT32 mOutputCounter
 
CProcessReportmpCallBack
 
CStatempInitialState
 
CCopasiMethodmpMethod
 
COutputHandlermpOutputHandler
 
CCopasiProblemmpProblem
 
CCopasiParameterGroupmpSliders
 
CReport mReport
 
CResult mResult
 
bool mScheduled
 
Type mType
 
bool mUpdateModel
 
- Protected Attributes inherited from CCopasiContainer
objectMap mObjects
 

Private Member Functions

void initObjects ()
 

Additional Inherited Members

- Protected Types inherited from CCopasiObject
enum  Flag {
  Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8,
  Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80,
  ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800,
  Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000,
  Root = 0x10000, Gui = 0x20000
}
 
- Protected Member Functions inherited from CCopasiContainer
template<class CType >
CCopasiObjectaddMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
void initObjects ()
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

Definition at line 39 of file CCopasiTask.h.

Member Enumeration Documentation

Enumerator
INITIALIZE 
STREAM 
FINISH 
REPORT 
PLOT 
TIME_SERIES 

Definition at line 89 of file CCopasiTask.h.

90  {
91  INITIALIZE = 0x01,
92  STREAM = 0x02,
93  FINISH = 0x04,
94  REPORT = 0x10,
95  PLOT = 0x20,
96  TIME_SERIES = 0x40
97  };
Enumerator
NO_OUTPUT 
OUTPUT_BEFORE 
OUTPUT_AFTER 
OUTPUT 
OUTPUT_SE 
OUTPUT_UI 
ONLY_TIME_SERIES 

Definition at line 99 of file CCopasiTask.h.

100  {
101  //do no output
102  NO_OUTPUT = 0,
105  //do output except time series, but do not initialize/finish
106  OUTPUT = REPORT | PLOT | STREAM,
107  //do output, including initialization and closing
110  // only do time series
112  };

Enumeration of the types of tasks known to COPASI.

Enumerator
steadyState 
timeCourse 
scan 
fluxMode 
optimization 
parameterFitting 
mca 
lyap 
tssAnalysis 
sens 
moieties 
crosssection 
lna 
unset 

Definition at line 45 of file CCopasiTask.h.

Constructor & Destructor Documentation

CCopasiTask::CCopasiTask ( const std::string &  name = "NoName",
const CCopasiContainer pParent = NULL,
const std::string &  type = "Task" 
)

Default constructor

Definition at line 100 of file CCopasiTask.cpp.

References initObjects().

102  :
103  CCopasiContainer(name, pParent, type),
105  mKey(CCopasiRootContainer::getKeyFactory()->add("Task", this)),
106  mDescription(this),
107  mResult(this),
108  mScheduled(false),
109  mUpdateModel(false),
110  mpInitialState(NULL),
111  mpProblem(NULL),
112  mpMethod(NULL),
113  mReport(),
114  mpCallBack(NULL),
115  mpSliders(NULL),
117  mOutputCounter(0)
118 {initObjects();}
CResult mResult
Definition: CCopasiTask.h:212
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
bool mScheduled
Definition: CCopasiTask.h:217
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
CReport mReport
Definition: CCopasiTask.h:244
CState * mpInitialState
Definition: CCopasiTask.h:229
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
OutputFlag mDoOutput
Definition: CCopasiTask.h:463
std::string mKey
Definition: CCopasiTask.h:202
bool mUpdateModel
Definition: CCopasiTask.h:223
unsigned C_INT32 mOutputCounter
Definition: CCopasiTask.h:465
CCopasiParameterGroup * mpSliders
Definition: CCopasiTask.h:254
CDescription mDescription
Definition: CCopasiTask.h:207
static CKeyFactory * getKeyFactory()
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
void initObjects()
CCopasiTask::CCopasiTask ( const Type taskType,
const CCopasiContainer pParent = NULL,
const std::string &  type = "Task" 
)

Specific constructor

Parameters
constType & taskType
constCCopasiContainer * pParent (default: NULL)
conststd::string & type (default: "Task")

Definition at line 120 of file CCopasiTask.cpp.

References initObjects().

122  :
123  CCopasiContainer(CCopasiTask::TypeName[taskType], pParent, type),
124  mType(taskType),
125  mKey(CCopasiRootContainer::getKeyFactory()->add("Task", this)),
126  mDescription(this),
127  mResult(this),
128  mScheduled(false),
129  mUpdateModel(false),
130  mpInitialState(NULL),
131  mpProblem(NULL),
132  mpMethod(NULL),
133  mReport(),
134  mpCallBack(NULL),
135  mpSliders(NULL),
137  mpOutputHandler(NULL),
138  mOutputCounter(0)
139 {initObjects();}
CResult mResult
Definition: CCopasiTask.h:212
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
static const std::string TypeName[]
Definition: CCopasiTask.h:67
bool mScheduled
Definition: CCopasiTask.h:217
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
CReport mReport
Definition: CCopasiTask.h:244
CState * mpInitialState
Definition: CCopasiTask.h:229
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
OutputFlag mDoOutput
Definition: CCopasiTask.h:463
std::string mKey
Definition: CCopasiTask.h:202
bool mUpdateModel
Definition: CCopasiTask.h:223
unsigned C_INT32 mOutputCounter
Definition: CCopasiTask.h:465
CCopasiParameterGroup * mpSliders
Definition: CCopasiTask.h:254
CDescription mDescription
Definition: CCopasiTask.h:207
static CKeyFactory * getKeyFactory()
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
COutputHandler * mpOutputHandler
Definition: CCopasiTask.h:464
void initObjects()
CCopasiTask::CCopasiTask ( const CCopasiTask src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

Parameters
constCCopasiTask & src
constCCopasiContainer * pParent (default: NULL)

Definition at line 141 of file CCopasiTask.cpp.

References initObjects().

142  :
143  CCopasiContainer(src, pParent),
144  mType(src.mType),
145  mKey(CCopasiRootContainer::getKeyFactory()->add("Task", this)),
146  mDescription(src.mDescription, this),
147  mResult(src.mResult, this),
148  mScheduled(src.mScheduled),
150  mpInitialState(src.mpInitialState ? new CState(*src.mpInitialState) : NULL),
151  mpProblem(NULL),
152  mpMethod(NULL),
153  mReport(src.mReport),
154  mpCallBack(NULL),
155  mpSliders(NULL),
157  mpOutputHandler(NULL),
158  mOutputCounter(0)
159 {initObjects();}
CResult mResult
Definition: CCopasiTask.h:212
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
bool mScheduled
Definition: CCopasiTask.h:217
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
Definition: CState.h:305
CReport mReport
Definition: CCopasiTask.h:244
CState * mpInitialState
Definition: CCopasiTask.h:229
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
OutputFlag mDoOutput
Definition: CCopasiTask.h:463
std::string mKey
Definition: CCopasiTask.h:202
bool mUpdateModel
Definition: CCopasiTask.h:223
unsigned C_INT32 mOutputCounter
Definition: CCopasiTask.h:465
CCopasiParameterGroup * mpSliders
Definition: CCopasiTask.h:254
CDescription mDescription
Definition: CCopasiTask.h:207
static CKeyFactory * getKeyFactory()
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
COutputHandler * mpOutputHandler
Definition: CCopasiTask.h:464
void initObjects()
CCopasiTask::~CCopasiTask ( )
virtual

Destructor

Definition at line 161 of file CCopasiTask.cpp.

References CCopasiRootContainer::getKeyFactory(), mKey, mpInitialState, mpMethod, mpProblem, mpSliders, pdelete, and CKeyFactory::remove().

162 {
164 
167  pdelete(mpMethod);
169 }
bool remove(const std::string &key)
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
#define pdelete(p)
Definition: copasi.h:215
CState * mpInitialState
Definition: CCopasiTask.h:229
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
std::string mKey
Definition: CCopasiTask.h:202
CCopasiParameterGroup * mpSliders
Definition: CCopasiTask.h:254
static CKeyFactory * getKeyFactory()

Member Function Documentation

void CCopasiTask::cleanup ( )

Cleanup function

Definition at line 324 of file CCopasiTask.cpp.

324 {}
CCopasiMethod * CCopasiTask::createMethod ( const int &  type) const
virtual

Create a method of the specified type to solve the task. It is the duty of the caller to release the CCopasiMethod.

Parameters
constCCopasiMethod::SubType & type
Returns
CCopasiMethod *

Reimplemented in CCrossSectionTask, CLyapTask, CTrajectoryTask, CTSSATask, CSteadyStateTask, CEFMTask, COptTask, COscillationTask, CMoietiesTask, CFitTask, CScanTask, CMCATask, CLNATask, and CSensTask.

Definition at line 307 of file CCopasiTask.cpp.

Referenced by CQTaskMethodWidget::setActiveMethod().

308 {
309  return NULL;
310 }
CProcessReport * CCopasiTask::getCallBack ( ) const

Definition at line 196 of file CCopasiTask.cpp.

References mpCallBack.

197 {
198  return mpCallBack;
199 }
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
const CCopasiTask::CDescription & CCopasiTask::getDescription ( ) const

Retrieve the description

Definition at line 318 of file CCopasiTask.cpp.

References mDescription.

Referenced by operator<<().

319 {return mDescription;}
CDescription mDescription
Definition: CCopasiTask.h:207
const std::string & CCopasiTask::getKey ( ) const
virtual

Retrieve the key for the task.

Returns
std::string key

Reimplemented from CCopasiObject.

Definition at line 180 of file CCopasiTask.cpp.

References mKey.

Referenced by CCopasiXML::saveTaskList(), CMCAProblem::setSteadyStateRequested(), and CLNAProblem::setSteadyStateRequested().

180 {return mKey;}
std::string mKey
Definition: CCopasiTask.h:202
CCopasiMethod * CCopasiTask::getMethod ( )
const CCopasiMethod * CCopasiTask::getMethod ( ) const

Retrieve the method

Definition at line 314 of file CCopasiTask.cpp.

References mpMethod.

314 {return mpMethod;}
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
COutputHandler * CCopasiTask::getOutputHandler ( ) const

Definition at line 201 of file CCopasiTask.cpp.

References mpOutputHandler.

202 {
203  return mpOutputHandler;
204 }
COutputHandler * mpOutputHandler
Definition: CCopasiTask.h:464
const OutputFlag& CCopasiTask::getOutputMode ( ) const
inline

Definition at line 457 of file CCopasiTask.h.

References mDoOutput.

458  {return mDoOutput;};
OutputFlag mDoOutput
Definition: CCopasiTask.h:463
CCopasiProblem * CCopasiTask::getProblem ( )

Retrieve the problem

Definition at line 296 of file CCopasiTask.cpp.

References mpProblem.

Referenced by CCopasiDataModel::addTask(), CFitProblem::calculate(), COptProblem::calculate(), CFitProblem::calculateCrossValidation(), CQNewMainWindow::checkForElementaryModesSlot(), COutputAssistant::createDefaultOutput(), COutputAssistant::createPlot(), CSEDMLExporter::createScanTask(), CSEDMLExporter::createSteadyStateTask(), CSEDMLExporter::createTimeCourseTask(), CQTSSAResultSubWidget::displayResult(), CNewtonMethod::doIntegration(), CQNewMainWindow::elementaryModeTriggeredSlot(), CCopasiXMLParser::TaskElement::end(), CQOptimizationResult::enterProtected(), CQFittingResult::enterProtected(), CQSensResultWidget::enterProtected(), CODEExporter::exportExpression(), CODEExporterBM::exportTitleData(), CODEExporterXPPAUT::exportTitleData(), CEFMTask::getInternalSpecies(), CEFMTask::getNetReaction(), QFluxModeAnimation::getScales(), CCopasiDataModel::importSBML(), CCopasiDataModel::importSBMLFromString(), SEDMLImporter::importTasks(), CQTSSAResultSubWidget::init(), CSSAMethod::initialize(), CEFMMethod::initialize(), CFitProblem::initialize(), QFluxModeAnimation::initialize(), CSensMethod::initialize(), CEFMAlgorithm::initialize(), CBitPatternMethod::initialize(), CBitPatternTreeMethod::initialize(), CNewtonMethod::initialize(), CScanTask::initSubtask(), StateSubwidget::loadAll(), CQLyapResultWidget::loadFromBackend(), CQSteadyStateResult::loadResult(), CQCrossSectionTaskWidget::loadTask(), CQLyapWidget::loadTask(), ScanWidget::loadTask(), CQLNAWidget::loadTask(), CQMCAWidget::loadTask(), SensitivitiesWidget::loadTask(), SteadyStateWidget::loadTask(), CQFittingWidget::loadTask(), CQTSSAWidget::loadTask(), CQOptimizationWidget::loadTask(), CQTrajectoryWidget::loadTask(), CQSensResultWidget::newResult(), operator<<(), CQSimpleSelectionTree::populateTree(), Arguments::prepareModel(), CCSPMethod::printResult(), CLNATask::process(), CScanTask::processCallback(), CFitProblem::restore(), CQTSSAResultSubWidget::saveDataToFile(), CQCrossSectionTaskWidget::saveTask(), CQLyapWidget::saveTask(), CQMCAWidget::saveTask(), CQLNAWidget::saveTask(), ScanWidget::saveTask(), SensitivitiesWidget::saveTask(), SteadyStateWidget::saveTask(), CQFittingWidget::saveTask(), CQTSSAWidget::saveTask(), CQOptimizationWidget::saveTask(), CQTrajectoryWidget::saveTask(), CCopasiXML::saveTaskList(), CQEFMReactionDM::setTask(), CQEFMSpeciesDM::setTask(), CCopasiXMLParser::TaskElement::start(), test000087::test_simulate_reaction_flux_reference_1(), and SEDMLImporter::updateCopasiTaskForSimulation().

296 {return mpProblem;}
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
const CCopasiProblem * CCopasiTask::getProblem ( ) const

Retrieve the problem

Definition at line 298 of file CCopasiTask.cpp.

References mpProblem.

298 {return mpProblem;}
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
CReport & CCopasiTask::getReport ( )
const CCopasiTask::CResult & CCopasiTask::getResult ( ) const
CCopasiParameterGroup * CCopasiTask::getSliders ( )

Retrieve a pointer to the group of sliders.

Returns
CCopasiParameterGroup * pSliders

Definition at line 326 of file CCopasiTask.cpp.

References mpSliders.

327 {return mpSliders;}
CCopasiParameterGroup * mpSliders
Definition: CCopasiTask.h:254
CCopasiTask::Type CCopasiTask::getType ( void  ) const
bool CCopasiTask::initialize ( const OutputFlag of,
COutputHandler pOutputHandler,
std::ostream *  pOstream 
)
virtual

Initialize the task. If an ostream is given this ostream is used instead of the target specified in the report. This allows nested tasks to share the same output device.

Parameters
constOutputFlag & of
COutputHandler* pOutputHandler
std::ostream* pOstream (default: NULL)
Returns
bool success

Reimplemented in CCrossSectionTask, CSteadyStateTask, CTrajectoryTask, CTSSATask, CMCATask, CLyapTask, CScanTask, CEFMTask, COptTask, CLNATask, COscillationTask, CSensTask, CFitTask, and CMoietiesTask.

Definition at line 207 of file CCopasiTask.cpp.

References COutputHandler::addInterface(), CCopasiMessage::COMMANDLINE, COutputHandler::compile(), CModel::compileIfNecessary(), CCopasiMessage::ERROR, CModel::getInitialState(), CCopasiProblem::getModel(), CCopasiObject::getObjectDataModel(), CCopasiObject::getObjectName(), CReport::getTarget(), MCCopasiTask, mDoOutput, mOutputCounter, mpCallBack, mpInitialState, mpMethod, mpOutputHandler, mpProblem, mReport, NO_OUTPUT, CReport::open(), pdelete, REPORT, and CCopasiMessage::WARNING.

Referenced by COptProblem::calculate(), TaskWidget::commonRunTask(), CMoietiesTask::initialize(), CSensTask::initialize(), COscillationTask::initialize(), CLNATask::initialize(), COptTask::initialize(), CEFMTask::initialize(), CSensMethod::initialize(), CScanTask::initialize(), CLyapTask::initialize(), CMCATask::initialize(), CTrajectoryTask::initialize(), CTSSATask::initialize(), CSteadyStateTask::initialize(), CCrossSectionTask::initialize(), COptProblem::initializeSubtaskBeforeOutput(), and CScanTask::initSubtask().

210 {
211  bool success = true;
212 
213  if (!mpProblem)
214  {
216  return false;
217  }
218 
219  if (!mpProblem->getModel())
220  {
222  return false;
223  }
224 
225  if (!mpMethod)
226  {
228  return false;
229  }
230 
232  {
234  return false;
235  }
236 
238 
240 
241  mDoOutput = of;
242  mpOutputHandler = pOutputHandler;
243 
244  if (mDoOutput == NO_OUTPUT ||
245  mpOutputHandler == NULL) return true;
246 
247  mOutputCounter = 0;
248 
249  if (mDoOutput & REPORT)
250  {
251  if (mReport.open(getObjectDataModel(), pOstream) &&
252  mReport.getTarget() != "")
254  else if (pOstream == NULL)
256  }
257 
258  std::vector< CCopasiContainer * > ListOfContainer;
259  ListOfContainer.push_back(this);
260 
261  CCopasiDataModel* pDataModel = getObjectDataModel();
262  assert(pDataModel != NULL);
263 
264  if (!mpOutputHandler->compile(ListOfContainer, pDataModel))
265  {
266  // Warning
268  success = false;
269  }
270 
271  return success;
272 }
CCopasiDataModel * getObjectDataModel()
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
#define pdelete(p)
Definition: copasi.h:215
const std::string & getObjectName() const
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
Definition: CState.h:305
const std::string & getTarget() const
Definition: CReport.cpp:89
CReport mReport
Definition: CCopasiTask.h:244
CState * mpInitialState
Definition: CCopasiTask.h:229
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
#define MCCopasiTask
virtual void addInterface(COutputInterface *pInterface)
OutputFlag mDoOutput
Definition: CCopasiTask.h:463
unsigned C_INT32 mOutputCounter
Definition: CCopasiTask.h:465
virtual bool compile(std::vector< CCopasiContainer * > listOfContainer, const CCopasiDataModel *pDataModel)
const CState & getInitialState() const
Definition: CModel.cpp:1768
bool compileIfNecessary(CProcessReport *pProcessReport)
Definition: CModel.cpp:612
std::ostream * open(const CCopasiDataModel *pDataModel, std::ostream *pOstream=NULL)
Definition: CReport.cpp:336
COutputHandler * mpOutputHandler
Definition: CCopasiTask.h:464
CModel * getModel() const
void CCopasiTask::initObjects ( )
private

Definition at line 390 of file CCopasiTask.cpp.

References CCopasiContainer::addObjectReference(), mOutputCounter, CCopasiTimer::PROCESS, CCopasiObject::ValueInt, and CCopasiTimer::WALL.

Referenced by CCopasiTask().

391 {
393  new CCopasiTimer(CCopasiTimer::WALL, this);
395 }
unsigned C_INT32 mOutputCounter
Definition: CCopasiTask.h:465
CCopasiObject * addObjectReference(const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
const bool & CCopasiTask::isScheduled ( ) const

Check whether the task is scheduled

Returns
const bool & scheduled

Definition at line 184 of file CCopasiTask.cpp.

References mScheduled.

Referenced by Arguments::getFirstScheduledTask(), TaskWidget::loadCommon(), TaskWidget::saveCommon(), and CCopasiXML::saveTaskList().

184 {return mScheduled;}
bool mScheduled
Definition: CCopasiTask.h:217
const bool & CCopasiTask::isUpdateModel ( ) const

Check whether the task must update the model

Returns
const bool & updateModel

Definition at line 188 of file CCopasiTask.cpp.

References mUpdateModel.

Referenced by CFitProblem::initialize(), CSensMethod::initialize(), TaskWidget::loadCommon(), CScanTask::processCallback(), TaskWidget::saveCommon(), CCopasiXML::saveTaskList(), and CQSteadyStateResult::slotUpdateModel().

188 {return mUpdateModel;}
bool mUpdateModel
Definition: CCopasiTask.h:223
bool CCopasiTask::isValidMethod ( const unsigned int &  method,
const unsigned int *  validMethods 
)
static

Check whether the given method is in the list of valid methods This list must end with CCopasiMethod::unset

Parameters
constunsigned int & method
constunsigned int * validMethods
Returns
bool isValid

Definition at line 89 of file CCopasiTask.cpp.

References C_INT32, and CCopasiMethod::unset.

Referenced by CTrajectoryTask::setMethodType(), CTSSATask::setMethodType(), and CCrossSectionTask::setMethodType().

91 {
92  unsigned C_INT32 i;
93 
94  for (i = 0; validMethods[i] != CCopasiMethod::unset; i++)
95  if (method == validMethods[i]) return true;
96 
97  return false;
98 }
#define C_INT32
Definition: copasi.h:90
void CCopasiTask::output ( const COutputInterface::Activity activity)
virtual

Perform an output event for the current activity

Parameters
constActivity & activity

Definition at line 331 of file CCopasiTask.cpp.

References COutputInterface::AFTER, COutputInterface::BEFORE, COutputInterface::DURING, mDoOutput, mOutputCounter, mpOutputHandler, NO_OUTPUT, COutputHandler::output(), OUTPUT_AFTER, and OUTPUT_BEFORE.

Referenced by CExperimentSet::calculateStatistics(), COptMethodPS::create(), COptMethodPraxis::evaluateFunction(), CCrossSectionTask::eventCallBack(), CCrossSectionTask::finish(), CLyapTask::methodCallback(), COptMethodPS::move(), COptMethodDE::optimise(), COptMethodSRES::optimise(), COptMethodSS::optimise(), COptMethodPS::optimise(), COptMethodGA::optimise(), COptMethodHookeJeeves::optimise(), COptMethodGASR::optimise(), COptMethodLevenbergMarquardt::optimise(), COptMethodNelderMead::optimise(), COptMethodCoranaWalk::optimise(), COptMethodSA::optimise(), COptMethodPraxis::optimise(), COptMethodTruncatedNewton::optimise(), COptMethodStatistics::optimise(), COptMethodSteepestDescent::optimise(), COptMethodEP::optimise(), CRandomSearch::optimise(), CMoietiesTask::process(), CFitTask::process(), COscillationTask::process(), CLNATask::process(), COptTask::process(), CScanTask::process(), CLyapTask::process(), CMCATask::process(), CTrajectoryTask::process(), CTSSATask::process(), CSteadyStateTask::process(), CCrossSectionTask::process(), CScanTask::processCallback(), CTrajectoryTask::processStep(), and COptMethodTruncatedNewton::sFun().

332 {
333  if (mpOutputHandler != NULL)
334  switch (activity)
335  {
337 
338  if (mDoOutput != NO_OUTPUT)
339  {
340  mpOutputHandler->output(activity);
341  ++mOutputCounter;
342  }
343 
344  break;
345 
347 
348  if (mDoOutput & OUTPUT_BEFORE)
349  mpOutputHandler->output(activity);
350 
351  break;
352 
354 
355  if (mDoOutput & OUTPUT_AFTER)
356  mpOutputHandler->output(activity);
357 
358  break;
359  }
360 }
OutputFlag mDoOutput
Definition: CCopasiTask.h:463
unsigned C_INT32 mOutputCounter
Definition: CCopasiTask.h:465
virtual void output(const Activity &activity)
COutputHandler * mpOutputHandler
Definition: CCopasiTask.h:464
bool CCopasiTask::process ( const bool &  useInitialValues)
virtual

Process the task with or without initializing to the initial state.

Parameters
constbool & useInitialValues
Returns
bool success

Reimplemented in CCrossSectionTask, CSteadyStateTask, CTrajectoryTask, CTSSATask, CMCATask, CLyapTask, CScanTask, CEFMTask, COptTask, CLNATask, COscillationTask, CSensTask, CFitTask, and CMoietiesTask.

Definition at line 274 of file CCopasiTask.cpp.

Referenced by COptProblem::calculate(), CSensMethod::do_target_calculation(), CScanTask::processCallback(), and CQTaskThread::run().

275 {return false;}
bool CCopasiTask::restore ( )
virtual

Perform necessary cleanup procedures

Reimplemented in CCrossSectionTask, CSteadyStateTask, CTrajectoryTask, CTSSATask, CMCATask, CLyapTask, CScanTask, CLNATask, CSensTask, and CMoietiesTask.

Definition at line 277 of file CCopasiTask.cpp.

References CCopasiProblem::getModel(), mpInitialState, mpProblem, mUpdateModel, CCopasiProblem::restore(), setCallBack(), CModel::setInitialState(), and CModel::updateInitialValues().

Referenced by TaskWidget::finishTask(), CLNATask::restore(), CSensMethod::restore(), CScanTask::restore(), CLyapTask::restore(), CMCATask::restore(), COptProblem::restore(), CTrajectoryTask::restore(), CTSSATask::restore(), CSteadyStateTask::restore(), and CCrossSectionTask::restore().

278 {
279  setCallBack(NULL);
280 
281  if (!mUpdateModel)
282  {
283  if (mpInitialState)
284  {
286  }
287 
289  }
290 
292 
293  return true;
294 }
virtual bool setCallBack(CProcessReport *pCallBack)
void setInitialState(const CState &state)
Definition: CModel.cpp:1774
CState * mpInitialState
Definition: CCopasiTask.h:229
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
bool mUpdateModel
Definition: CCopasiTask.h:223
virtual bool restore(const bool &updateModel)
bool updateInitialValues()
Definition: CModel.cpp:1461
CModel * getModel() const
void CCopasiTask::separate ( const COutputInterface::Activity activity)
virtual

Introduce an additional separator into the output

Parameters
constActivity & activity

Definition at line 362 of file CCopasiTask.cpp.

References COutputInterface::AFTER, COutputInterface::BEFORE, COutputInterface::DURING, mDoOutput, mpOutputHandler, OUTPUT_AFTER, OUTPUT_BEFORE, and COutputHandler::separate().

Referenced by CScanTask::outputSeparatorCallback().

363 {
364  if (mpOutputHandler != NULL)
365  switch (activity)
366  {
368 
369  if (mDoOutput)
370  mpOutputHandler->separate(activity);
371 
372  break;
373 
375 
376  if (mDoOutput & OUTPUT_BEFORE)
377  mpOutputHandler->separate(activity);
378 
379  break;
380 
382 
383  if (mDoOutput & OUTPUT_AFTER)
384  mpOutputHandler->separate(activity);
385 
386  break;
387  }
388 }
virtual void separate(const Activity &activity)
OutputFlag mDoOutput
Definition: CCopasiTask.h:463
COutputHandler * mpOutputHandler
Definition: CCopasiTask.h:464
bool CCopasiTask::setCallBack ( CProcessReport pCallBack)
virtual
bool CCopasiTask::setMethodType ( const int &  type)
virtual

Set the method type applied to solve the task

Parameters
constCCopasiMethod::SubType & type
Returns
bool success

Reimplemented in CCrossSectionTask, CLyapTask, CTrajectoryTask, CTSSATask, CEFMTask, COptTask, COscillationTask, CMoietiesTask, and CFitTask.

Definition at line 301 of file CCopasiTask.cpp.

Referenced by CQEFMWidget::createMethod(), CQTaskMethodWidget::saveMethod(), and CCopasiXMLParser::MethodElement::start().

302 {
303  return false;
304 }
void CCopasiTask::setScheduled ( const bool &  scheduled)

Set whether the task is scheduled

Parameters
constbool & scheduled

Definition at line 182 of file CCopasiTask.cpp.

References mScheduled.

Referenced by SEDMLImporter::importTasks(), TaskWidget::saveCommon(), CCopasiXMLParser::TaskElement::start(), test000087::test_simulate_reaction_flux_reference_1(), and SEDMLImporter::updateCopasiTaskForSimulation().

182 {mScheduled = scheduled;}
bool mScheduled
Definition: CCopasiTask.h:217
void CCopasiTask::setType ( const Type type)

Set the type of the task

Parameters
CCopasiTask::Type& type

Definition at line 178 of file CCopasiTask.cpp.

References mType.

178 {mType = type;}
void CCopasiTask::setUpdateModel ( const bool &  updateModel)

Set whether the task must update the model

Parameters
constbool & updateModel

Definition at line 186 of file CCopasiTask.cpp.

References mUpdateModel.

Referenced by CFitProblem::initialize(), CSensMethod::initialize(), CFitProblem::restore(), CSensMethod::restore(), TaskWidget::saveCommon(), CQSteadyStateResult::slotUpdateModel(), and CCopasiXMLParser::TaskElement::start().

186 {mUpdateModel = updateModel;}
bool mUpdateModel
Definition: CCopasiTask.h:223
virtual bool CCopasiTask::updateMatrices ( )
inlinevirtual

Resizes result matrices and updates array annotations for a specific task. For now this will be hard coded in the respective derived classes. We may introduce a more generic mechanism for this in the future. This is used when we need to know about the data structures of a task result without actually performing the task, e.g. when selecting objects for output. For now we assume that this functionality is also performed when initialize() is called.

Reimplemented in CSteadyStateTask, CTSSATask, CMCATask, CLNATask, and CSensTask.

Definition at line 347 of file CCopasiTask.h.

Referenced by CQSimpleSelectionTree::populateTree().

347 {return true;};

Member Data Documentation

std::string CCopasiTask::Error

Definition at line 372 of file CCopasiTask.h.

CDescription CCopasiTask::mDescription
protected

The description of the task.

Definition at line 207 of file CCopasiTask.h.

Referenced by getDescription().

OutputFlag CCopasiTask::mDoOutput
protected

Definition at line 463 of file CCopasiTask.h.

Referenced by getOutputMode(), initialize(), output(), and separate().

std::string CCopasiTask::mKey
protected

The key of the task

Definition at line 202 of file CCopasiTask.h.

Referenced by getKey(), and ~CCopasiTask().

unsigned C_INT32 CCopasiTask::mOutputCounter
protected

Definition at line 465 of file CCopasiTask.h.

Referenced by initialize(), initObjects(), and output().

CProcessReport* CCopasiTask::mpCallBack
protected
CState* CCopasiTask::mpInitialState
protected

The state of the model before execution of the task. If mUpdateModel is false this state is restored.

Definition at line 229 of file CCopasiTask.h.

Referenced by initialize(), restore(), and ~CCopasiTask().

CCopasiMethod* CCopasiTask::mpMethod
protected

The method used to solve the problem.

Definition at line 239 of file CCopasiTask.h.

Referenced by CCrossSectionTask::CCrossSectionTask(), CEFMTask::CEFMTask(), CFitTask::CFitTask(), CLNATask::CLNATask(), CLyapTask::CLyapTask(), CMCATask::CMCATask(), CMoietiesTask::CMoietiesTask(), COptTask::COptTask(), COscillationTask::COscillationTask(), CScanTask::CScanTask(), CSensTask::CSensTask(), CSteadyStateTask::CSteadyStateTask(), CTrajectoryTask::CTrajectoryTask(), CTSSATask::CTSSATask(), CEFMTask::getFluxModeDescription(), getMethod(), CEFMTask::getReactionEquation(), CMoietiesTask::initialize(), COscillationTask::initialize(), CLNATask::initialize(), CEFMTask::initialize(), COptTask::initialize(), CScanTask::initialize(), CLyapTask::initialize(), CMCATask::initialize(), CTSSATask::initialize(), CTrajectoryTask::initialize(), CSteadyStateTask::initialize(), CCrossSectionTask::initialize(), initialize(), CLNATask::load(), CMCATask::load(), CTrajectoryTask::load(), CSteadyStateTask::load(), CLNATask::printResult(), CMCATask::printResult(), CMoietiesTask::process(), CFitTask::process(), CSensTask::process(), COscillationTask::process(), CLNATask::process(), COptTask::process(), CEFMTask::process(), CScanTask::process(), CMCATask::process(), CSteadyStateTask::process(), CSensTask::restore(), CMoietiesTask::setCallBack(), CFitTask::setCallBack(), COscillationTask::setCallBack(), COptTask::setCallBack(), CEFMTask::setCallBack(), CFitTask::setMethodType(), CMoietiesTask::setMethodType(), COscillationTask::setMethodType(), COptTask::setMethodType(), CEFMTask::setMethodType(), CTSSATask::setMethodType(), CTrajectoryTask::setMethodType(), CLyapTask::setMethodType(), CCrossSectionTask::setMethodType(), CSensTask::updateMatrices(), CLNATask::updateMatrices(), CMCATask::updateMatrices(), CTSSATask::updateMatrices(), and ~CCopasiTask().

COutputHandler* CCopasiTask::mpOutputHandler
protected

Definition at line 464 of file CCopasiTask.h.

Referenced by getOutputHandler(), initialize(), output(), CMoietiesTask::process(), and separate().

CCopasiProblem* CCopasiTask::mpProblem
protected

The problem of the task

Definition at line 234 of file CCopasiTask.h.

Referenced by CCrossSectionTask::CCrossSectionTask(), CEFMTask::CEFMTask(), CFitTask::CFitTask(), CLNATask::CLNATask(), CLyapTask::CLyapTask(), CMCATask::CMCATask(), CMoietiesTask::CMoietiesTask(), COptTask::COptTask(), COscillationTask::COscillationTask(), CScanTask::CScanTask(), CSensTask::CSensTask(), CSteadyStateTask::CSteadyStateTask(), CTrajectoryTask::CTrajectoryTask(), CTSSATask::CTSSATask(), CCrossSectionTask::eventCallBack(), CFitTask::fixBuild55(), CScanTask::fixBuild81(), CEFMTask::getFluxModeDescription(), CEFMTask::getFluxModes(), CEFMTask::getNetReactionData(), getProblem(), CEFMTask::getReactionEquation(), CEFMTask::getSpeciesChanges(), CMoietiesTask::initialize(), COscillationTask::initialize(), CLNATask::initialize(), CEFMTask::initialize(), COptTask::initialize(), CScanTask::initialize(), CLyapTask::initialize(), CMCATask::initialize(), CTSSATask::initialize(), CTrajectoryTask::initialize(), CSteadyStateTask::initialize(), CCrossSectionTask::initialize(), initialize(), CScanTask::initSubtask(), CLNATask::load(), CMCATask::load(), CTrajectoryTask::load(), CSteadyStateTask::load(), operator<<(), CLNATask::printResult(), CMCATask::printResult(), CFitTask::process(), CSensTask::process(), COscillationTask::process(), CLNATask::process(), COptTask::process(), CScanTask::process(), CMCATask::process(), CSteadyStateTask::process(), CMoietiesTask::restore(), CLNATask::restore(), CLyapTask::restore(), CMCATask::restore(), CTrajectoryTask::restore(), CTSSATask::restore(), CSteadyStateTask::restore(), CCrossSectionTask::restore(), restore(), CMoietiesTask::setCallBack(), CFitTask::setCallBack(), COscillationTask::setCallBack(), COptTask::setCallBack(), CEFMTask::setCallBack(), CSteadyStateTask::setInitialState(), CSensTask::updateMatrices(), CLNATask::updateMatrices(), CMCATask::updateMatrices(), CTSSATask::updateMatrices(), CSteadyStateTask::updateMatrices(), and ~CCopasiTask().

CCopasiParameterGroup* CCopasiTask::mpSliders
protected

Pointer to group of sliders associated with the task.

Definition at line 254 of file CCopasiTask.h.

Referenced by getSliders(), and ~CCopasiTask().

CReport CCopasiTask::mReport
protected

The report that belongs to this specific task

Definition at line 244 of file CCopasiTask.h.

Referenced by getReport(), CLNATask::initialize(), CScanTask::initialize(), CMCATask::initialize(), initialize(), and CSensTask::process().

CResult CCopasiTask::mResult
protected

The result of the task.

Definition at line 212 of file CCopasiTask.h.

Referenced by getResult().

bool CCopasiTask::mScheduled
protected

Tells whether the task is scheduled for execution

Definition at line 217 of file CCopasiTask.h.

Referenced by isScheduled(), CLNATask::load(), CMCATask::load(), CTrajectoryTask::load(), CSteadyStateTask::load(), and setScheduled().

Type CCopasiTask::mType
protected

The type of the task

Definition at line 197 of file CCopasiTask.h.

Referenced by getType(), and setType().

bool CCopasiTask::mUpdateModel
protected

Tells whether the task shall update the model with the result. The restore method must act accordingly.

Definition at line 223 of file CCopasiTask.h.

Referenced by isUpdateModel(), CSensTask::restore(), CLyapTask::restore(), CTrajectoryTask::restore(), CTSSATask::restore(), CSteadyStateTask::restore(), CCrossSectionTask::restore(), restore(), and setUpdateModel().

const std::string CCopasiTask::TypeName
static
Initial value:
=
{
"Steady-State",
"Time-Course",
"Scan",
"Elementary Flux Modes",
"Optimization",
"Parameter Estimation",
"Metabolic Control Analysis",
"Lyapunov Exponents",
"Time Scale Separation Analysis",
"Sensitivities",
"Moieties",
"Cross Section",
"Linear Noise Approximation",
"not specified",
""
}

String literals for the GUI to display type names of tasks known to COPASI.

CCopasiTask class. This class is used to describe a task in COPASI. This class is intended to be used as the parent class for all tasks within COPASI.

Created for COPASI by Stefan Hoops 2003

Definition at line 67 of file CCopasiTask.h.

Referenced by CCopasiDataModel::addDefaultReports(), CCopasiDataModel::addDefaultTasks(), CCopasiDataModel::addReport(), CQReportDefinition::CQReportDefinition(), CQOptimizationWidget::init(), CScanTask::initSubtask(), CQOptimizationWidget::loadTask(), and CQOptimizationWidget::saveTask().

const unsigned int CCopasiTask::ValidMethods
static
Initial value:

The methods which can be selected for performing this task.

Definition at line 77 of file CCopasiTask.h.

std::string CCopasiTask::Warning

Definition at line 373 of file CCopasiTask.h.

const char * CCopasiTask::XMLType
static
Initial value:
=
{
"steadyState",
"timeCourse",
"scan",
"fluxMode",
"optimization",
"parameterFitting",
"metabolicControlAnalysis",
"lyapunovExponents",
"timeScaleSeparationAnalysis",
"sensitivities",
"moieties",
"crosssection",
"linearNoiseApproximation",
"unset",
NULL
}

XML type names of tasks known to COPASI.

Definition at line 72 of file CCopasiTask.h.

Referenced by CCopasiXML::saveReportList(), CCopasiXML::saveTaskList(), CCopasiXMLParser::TaskElement::start(), and CCopasiXMLParser::ReportElement::start().


The documentation for this class was generated from the following files: