本文整理汇总了C++中CCopasiMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ CCopasiMessage函数的具体用法?C++ CCopasiMessage怎么用?C++ CCopasiMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CCopasiMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CCopasiMessage
bool CEFMMethod::initialize()
{
CEFMTask * pTask = dynamic_cast< CEFMTask * >(getObjectParent());
if (pTask == NULL)
{
CCopasiMessage(CCopasiMessage::ERROR, MCEFMAnalysis + 1);
return false;
}
CEFMProblem * pProblem = dynamic_cast< CEFMProblem *>(pTask->getProblem());
if (pProblem == NULL)
{
CCopasiMessage(CCopasiMessage::ERROR, MCEFMAnalysis + 2);
return false;
}
mpFluxModes = & pProblem->getFluxModes();
mpReorderedReactions = & pProblem->getReorderedReactions();
mpReorderedReactions->clear();
mpFluxModes->clear();
return true;
}
示例2: assert
//virtual
bool CLyapWolfMethod::isValidProblem(const CCopasiProblem * pProblem)
{
if (!CLyapMethod::isValidProblem(pProblem)) return false;
const CLyapProblem * pLP = dynamic_cast<const CLyapProblem *>(pProblem);
assert(pLP);
C_FLOAT64 stepSize = getValue< C_FLOAT64 >("Orthonormalization Interval");
C_FLOAT64 transientTime = pLP->getTransientTime();
C_FLOAT64 endTime = getValue< C_FLOAT64 >("Overall time");
if (transientTime >= endTime)
{
//
CCopasiMessage(CCopasiMessage::EXCEPTION, MCLyap + 4);
return false;
}
if (stepSize > (endTime - transientTime))
{
//
CCopasiMessage(CCopasiMessage::EXCEPTION, MCLyap + 5);
return false;
}
return true;
}
示例3: switch
// virtual
CXMLHandler * ReactionGlyphHandler::processStart(const XML_Char * pszName,
const XML_Char ** papszAttrs)
{
CXMLHandler * pHandlerToCall = NULL;
switch (mCurrentElement.first)
{
case ReactionGlyph:
{
//workload
const char * key;
const char * name;
const char * reaction;
key = mpParser->getAttributeValue("key", papszAttrs);
name = mpParser->getAttributeValue("name", papszAttrs);
reaction = mpParser->getAttributeValue("reaction", papszAttrs, false);
mpData->pReactionGlyph = new CLReactionGlyph(name);
const char * objectRole = mpParser->getAttributeValue("objectRole", papszAttrs, false);
if (objectRole != NULL && objectRole[0] != 0)
{
mpData->pReactionGlyph->setObjectRole(objectRole);
}
if (reaction && reaction[0])
{
CReaction * pReaction = dynamic_cast< CReaction * >(mpData->mKeyMap.get(reaction));
if (!pReaction)
{
CCopasiMessage(CCopasiMessage::WARNING, MCXML + 19, "ReactionGlyph" , key);
}
else
{
mpData->pReactionGlyph->setModelObjectKey(pReaction->getKey());
}
}
mpData->pCurrentLayout->addReactionGlyph(mpData->pReactionGlyph);
addFix(key, mpData->pReactionGlyph);
}
break;
case BoundingBox:
case Curve:
case ListOfMetaboliteReferenceGlyphs:
pHandlerToCall = getHandler(mCurrentElement.second);
break;
default:
CCopasiMessage(CCopasiMessage::EXCEPTION, MCXML + 2,
mpParser->getCurrentLineNumber(), mpParser->getCurrentColumnNumber(), pszName);
break;
}
return pHandlerToCall;
}
示例4: CCopasiMessage
//virtual
bool CTrajectoryMethodDsaLsodar::isValidProblem(const CCopasiProblem * pProblem)
{
if (!CTrajectoryMethod::isValidProblem(pProblem)) return false;
const CTrajectoryProblem * pTP = dynamic_cast<const CTrajectoryProblem *>(pProblem);
if (pTP->getDuration() < 0.0)
{
//back integration not possible
CCopasiMessage(CCopasiMessage::ERROR, MCTrajectoryMethod + 9);
return false;
}
//events are not supported at the moment
if (mpContainer->getEvents().size() > 0)
{
CCopasiMessage(CCopasiMessage::ERROR, MCTrajectoryMethod + 23);
return false;
}
//TODO: rewrite CModel::suitableForStochasticSimulation() to use
// CCopasiMessage
std::string message = mpContainer->getModel().suitableForStochasticSimulation();
if (message != "")
{
//model not suitable, message describes the problem
CCopasiMessage(CCopasiMessage::ERROR, message.c_str());
return false;
}
/* Lower Limit, Upper Limit */
*mpLowerLimit = getValue< C_FLOAT64 >("Lower Limit");
*mpUpperLimit = getValue< C_FLOAT64 >("Upper Limit");
if (*mpLowerLimit > *mpUpperLimit)
{
CCopasiMessage(CCopasiMessage::ERROR, MCTrajectoryMethod + 4, *mpLowerLimit, *mpUpperLimit);
return false;
}
/* Partitioning Interval */
// nothing to be done here so far
/* Use Random Seed */
// should be checked in the widget later on
/* Random Seed */
// nothing to be done here
return true;
}
示例5: fabs
bool CTSSATask::processStep(const C_FLOAT64 & nextTime)
{
C_FLOAT64 CompareTime = nextTime - 100.0 * fabs(nextTime) * std::numeric_limits< C_FLOAT64 >::epsilon();
if (*mpCurrentTime <= CompareTime)
{
do
{
mpTSSAMethod->step(nextTime - *mpCurrentTime);
if (*mpCurrentTime > CompareTime) break;
/* Here we will do conditional event processing */
/* Currently this is correct since no events are processed. */
CCopasiMessage(CCopasiMessage::EXCEPTION, MCTSSAMethod + 3);
}
while (true);
mpTSSAProblem->getModel()->setState(*mpCurrentState);
mpTSSAProblem->getModel()->updateSimulatedValues(true);
return true;
}
CompareTime = nextTime + 100.0 * fabs(nextTime) * std::numeric_limits< C_FLOAT64 >::epsilon();
if (*mpCurrentTime >= CompareTime)
{
do
{
mpTSSAMethod->step(nextTime - *mpCurrentTime);
if (*mpCurrentTime < CompareTime) break;
/* Here we will do conditional event processing */
/* Currently this is correct since no events are processed. */
CCopasiMessage(CCopasiMessage::EXCEPTION, MCTSSAMethod + 3);
}
while (true);
mpTSSAProblem->getModel()->setState(*mpCurrentState);
mpTSSAProblem->getModel()->updateSimulatedValues(true);
return true;
}
// Current time is approximately nextTime;
return false;
}
示例6: switch
void CCopasiXMLParser::ModelParameterGroupElement::end(const XML_Char *pszName)
{
switch (mCurrentElement)
{
case ModelParameterGroup:
if (strcmp(pszName, "ModelParameterGroup"))
CCopasiMessage(CCopasiMessage::EXCEPTION, MCXML + 11,
pszName, "ModelParameterGroup", mParser.getCurrentLineNumber());
mCommon.pCurrentModelParameter = mCommon.ModelParameterGroupStack.top();
mCommon.ModelParameterGroupStack.pop();
mParser.popElementHandler();
mLastKnownElement = START_ELEMENT;
/* Tell the parent element we are done. */
mParser.onEndElement(pszName);
break;
case Content:
if (strcmp(pszName, "ModelParameterGroup") &&
strcmp(pszName, "ModelParameter"))
{
CCopasiMessage(CCopasiMessage::EXCEPTION, MCXML + 11,
pszName, "ModelParameterGroup or ModelParameter", mParser.getCurrentLineNumber());
}
if (mCommon.pCurrentModelParameter != NULL)
{
mCommon.ModelParameterGroupStack.top()->add(mCommon.pCurrentModelParameter);
mCommon.pCurrentModelParameter = NULL;
}
// Content may be repeated therefore we set to the previous element which is ModelParameterGroup.
mCurrentElement = mLastKnownElement = ModelParameterGroup;
break;
case UNKNOWN_ELEMENT:
mCurrentElement = mLastKnownElement;
break;
default:
CCopasiMessage(CCopasiMessage::EXCEPTION, MCXML + 11,
pszName, "???", mParser.getCurrentLineNumber());
break;
}
return;
}
示例7: CCopasiMessage
//virtual
bool CTauLeapMethod::isValidProblem(const CCopasiProblem * pProblem)
{
if (!CTrajectoryMethod::isValidProblem(pProblem)) return false;
const CTrajectoryProblem * pTP = dynamic_cast<const CTrajectoryProblem *>(pProblem);
if (pTP->getDuration() < 0.0)
{
//back integration not possible
CCopasiMessage(CCopasiMessage::ERROR, MCTrajectoryMethod + 9);
return false;
}
if (mpContainer->getReactions().size() < 1)
{
//at least one reaction necessary
CCopasiMessage(CCopasiMessage::ERROR, MCTrajectoryMethod + 17);
return false;
}
//check for ODE rules
if (mpContainer->getCountODEs() > 0)
{
//ode rule found
CCopasiMessage(CCopasiMessage::ERROR, MCTrajectoryMethod + 28);
return false;
}
//events are not supported at the moment
if (mpContainer->getEvents().size() > 0)
{
CCopasiMessage(CCopasiMessage::ERROR, MCTrajectoryMethod + 23);
return false;
}
//TODO: rewrite CModel::suitableForStochasticSimulation() to use
// CCopasiMessage
std::string message = mpContainer->getModel().suitableForStochasticSimulation();
if (message != "")
{
//model not suitable, message describes the problem
CCopasiMessage(CCopasiMessage::ERROR, message.c_str());
return false;
}
return true;
}
示例8: while
CTrajectoryMethod::Status CTauLeapMethod::step(const double & deltaT)
{
// do several steps
C_FLOAT64 Time = mpCurrentState->getTime();
C_FLOAT64 EndTime = Time + deltaT;
size_t Steps = 0;
while (Time < EndTime)
{
mMethodState.setTime(Time);
mpModel->setState(mMethodState);
mpModel->updateSimulatedValues(false);
// We do not need to update the the method state since the only independent state
// values are species of type reaction which are all controlled by the method.
Time += doSingleStep(EndTime - Time);
if (++Steps > mMaxSteps)
{
CCopasiMessage(CCopasiMessage::EXCEPTION, MCTrajectoryMethod + 12);
}
}
*mpCurrentState = mpProblem->getModel()->getState();
mpCurrentState->setTime(Time);
return NORMAL;
}
示例9: while
CTrajectoryMethod::Status CStochDirectMethod::step(const double & deltaT)
{
C_FLOAT64 EndTime = *mpContainerStateTime + deltaT;
if (mTargetTime != EndTime)
{
// We have a new end time and reset the root counter.
mTargetTime = EndTime;
mSteps = 0;
}
while (*mpContainerStateTime < EndTime)
{
// The Container State Time is updated during the reaction firing or root interpolation
doSingleStep(*mpContainerStateTime, EndTime);
if (mStatus == ROOT ||
(mNumRoot > 0 && checkRoots()))
{
return ROOT;
}
if (mpProblem->getAutomaticStepSize())
{
break;
}
if (++mSteps > mMaxSteps)
{
CCopasiMessage(CCopasiMessage::EXCEPTION, MCTrajectoryMethod + 12);
}
}
return NORMAL;
}
示例10: CCopasiMessage
// static
void CRDFParser::ErrorHandler(void *, raptor_locator * pLocator, const char * message)
{
CCopasiMessage(CCopasiMessage::ERROR, MCMiriam + 1,
raptor_locator_line(pLocator),
raptor_locator_column(pLocator),
message);
}
示例11: getObjectDataModel
bool CReportDefinition::preCompileTable(const std::vector< CCopasiContainer * > & listOfContainer)
{
bool success = true;
mHeaderVector.clear();
mBodyVector.clear();
mFooterVector.clear();
std::vector<CRegisteredObjectName>::const_iterator it = mTableVector.begin();
std::vector<CRegisteredObjectName>::const_iterator end = mTableVector.end();
CCopasiDataModel* pDataModel = getObjectDataModel();
CCopasiObject * pObject;
for (; it != end; ++it)
{
pObject = pDataModel->ObjectFromName(listOfContainer, *it);
if (pObject != NULL)
{
addTableElement(pObject);
}
else
{
CCopasiMessage(CCopasiMessage::WARNING, MCCopasiTask + 6, it->c_str());
}
}
return success;
}
示例12: image
CLTextureSpec* CQQtImageTexturizer::create_texture_for_image(const std::string& filename, const char* format)
{
CLTextureSpec* pResult = NULL;
// use UTF8 strings for filenames since this seems to be safer across platforms
QImage image(FROM_UTF8(filename), format);
if (!image.isNull())
{
image = image.mirrored();
QImage glImage = QGLWidget::convertToGLFormat(image);
pResult = new CLTextureSpec;
pResult->mTextureWidth = pResult->mTextWidth = glImage.width();
pResult->mTextureHeight = pResult->mTextHeight = glImage.height();
pResult->mNumComponents = 4;
glGenTextures(1, &pResult->mTextureName);
assert(pResult->mTextureName != 0);
glBindTexture(GL_TEXTURE_2D, pResult->mTextureName);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)pResult->mTextureWidth, (GLsizei)pResult->mTextureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, glImage.bits());
}
else
{
CCopasiMessage(CCopasiMessage::ERROR, MCLayout + 1, filename.c_str());
}
return pResult;
}
示例13: CCopasiMessage
// make to support parallel tasks
void CReport::generateObjectsFromName(const CObjectInterface::ContainerList & listOfContainer,
std::vector< CObjectInterface * > & objectList,
CReport *& pReport,
const std::vector<CRegisteredObjectName>* nameVector)
{
objectList.clear();
unsigned C_INT32 i;
CObjectInterface * pObjectInterface;
CReportDefinition * pReportDefinition;
for (i = 0; i < nameVector->size(); i++)
{
pObjectInterface = CObjectInterface::GetObjectFromCN(listOfContainer, (*nameVector)[i]);
if (pObjectInterface == NULL)
{
CCopasiMessage(CCopasiMessage::WARNING, MCCopasiTask + 6, (*nameVector)[i].c_str());
continue;
}
if (!i && (pReportDefinition = dynamic_cast< CReportDefinition * >(pObjectInterface)) != NULL)
{
pReport = new CReport();
pReport->setReportDefinition(pReportDefinition);
return;
}
mObjects.insert(pObjectInterface);
objectList.push_back(pObjectInterface);
}
}
示例14: switch
// virtual
CXMLHandler * SubstrateHandler::processStart(const XML_Char * pszName,
const XML_Char ** papszAttrs)
{
const char * Metabolite;
CMetab * pMetabolite;
const char * Stoichiometry;
switch (mCurrentElement.first)
{
case Substrate:
Metabolite = mpParser->getAttributeValue("metabolite", papszAttrs);
Stoichiometry = mpParser->getAttributeValue("stoichiometry", papszAttrs);
pMetabolite = dynamic_cast< CMetab * >(mpData->mKeyMap.get(Metabolite));
if (!pMetabolite) fatalError();
mpData->pReaction->addSubstrate(pMetabolite->getKey(),
CCopasiXMLInterface::DBL(Stoichiometry));
break;
default:
CCopasiMessage(CCopasiMessage::EXCEPTION, MCXML + 2,
mpParser->getCurrentLineNumber(), mpParser->getCurrentColumnNumber(), pszName);
break;
}
return NULL;
}
示例15: switch
// virtual
bool ReportDefinitionHandler::processEnd(const XML_Char * pszName)
{
bool finished = false;
switch (mCurrentElement.first)
{
case ReportDefinition:
finished = true;
break;
case Comment:
// check parameter type CCopasiStaticString
mpData->pReport->setComment(mpData->CharacterData);
mpData->CharacterData = "";
break;
case Table:
case Header:
case Body:
case Footer:
break;
default:
CCopasiMessage(CCopasiMessage::EXCEPTION, MCXML + 2,
mpParser->getCurrentLineNumber(), mpParser->getCurrentColumnNumber(), pszName);
break;
}
return finished;
}