本文整理汇总了C++中pacc::xml::Streamer::insertStringContent方法的典型用法代码示例。如果您正苦于以下问题:C++ Streamer::insertStringContent方法的具体用法?C++ Streamer::insertStringContent怎么用?C++ Streamer::insertStringContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pacc::xml::Streamer
的用法示例。
在下文中一共展示了Streamer::insertStringContent方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*!
* \brief Write an MCC fitness object into a Beagle XML streamer.
* \param ioStreamer XML streamer to use to write the fitness values.
* \param inIndent Whether XML output should be indented.
*/
void GP::FitnessMCC::writeContent(PACC::XML::Streamer& ioStreamer, bool inIndent) const
{
Beagle_StackTraceBeginM();
ioStreamer.openTag("MCC", false);
ioStreamer.insertStringContent(dbl2str(mValue));
ioStreamer.closeTag();
ioStreamer.openTag("TruePositives", false);
ioStreamer.insertStringContent(dbl2str(mTruePositives));
ioStreamer.closeTag();
ioStreamer.openTag("FalsePositives", false);
ioStreamer.insertStringContent(dbl2str(mFalsePositives));
ioStreamer.closeTag();
ioStreamer.openTag("TrueNegatives", false);
ioStreamer.insertStringContent(dbl2str(mTrueNegatives));
ioStreamer.closeTag();
ioStreamer.openTag("FalseNegatives", false);
ioStreamer.insertStringContent(uint2str(mFalseNegatives));
ioStreamer.closeTag();
ioStreamer.openTag("TruePositivesRel", false);
ioStreamer.insertStringContent(dbl2str(mTruePositivesRel));
ioStreamer.closeTag();
ioStreamer.openTag("FalsePositivesRel", false);
ioStreamer.insertStringContent(dbl2str(mFalsePositivesRel));
ioStreamer.closeTag();
ioStreamer.openTag("TrueNegativesRel", false);
ioStreamer.insertStringContent(dbl2str(mTrueNegativesRel));
ioStreamer.closeTag();
ioStreamer.openTag("FalseNegativesRel", false);
ioStreamer.insertStringContent(dbl2str(mFalseNegativesRel));
ioStreamer.closeTag();
Beagle_StackTraceEndM("void GP::FitnessMCC::writeContent(PACC::XML::Streamer&, bool) const");
}
示例2:
void Beagle::WrapperT<T>::write(PACC::XML::Streamer& ioStreamer, bool inIndent) const
{
Beagle_StackTraceBeginM();
std::ostringstream lOSS;
lOSS << mWrappedValue << std::flush;
ioStreamer.insertStringContent(lOSS.str(), false);
Beagle_StackTraceEndM();
}
示例3:
/*!
* \brief Write a Koza's fitness into a Beagle XML streamer.
* \param ioStreamer XML streamer to use to write the fitness values.
* \param inIndent Whether XML output should be indented.
*/
void GP::FitnessKoza::writeContent(PACC::XML::Streamer& ioStreamer, bool inIndent) const
{
Beagle_StackTraceBeginM();
ioStreamer.openTag("Normalized", false);
ioStreamer.insertStringContent(dbl2str(mValue));
ioStreamer.closeTag();
ioStreamer.openTag("Adjusted", false);
ioStreamer.insertStringContent(dbl2str(mAdjustedFitness));
ioStreamer.closeTag();
ioStreamer.openTag("Standardized", false);
ioStreamer.insertStringContent(dbl2str(mStandardizedFitness));
ioStreamer.closeTag();
ioStreamer.openTag("Raw", false);
ioStreamer.insertStringContent(dbl2str(mRawFitness));
ioStreamer.closeTag();
ioStreamer.openTag("Hits", false);
ioStreamer.insertStringContent(uint2str(mHits));
ioStreamer.closeTag();
Beagle_StackTraceEndM("void GP::FitnessKoza::writeContent(PACC::XML::Streamer&, bool) const");
}
示例4: writeContent
/*!
* \brief Write a multiobjective fitness into an XML streamer.
* \param ioStreamer XML streamer to use to write the fitness value.
* \param inIndent Whether XML output should be indented.
*/
void FitnessMultiObj::writeContent(PACC::XML::Streamer& ioStreamer, bool inIndent) const
{
Beagle_StackTraceBeginM();
ioStreamer.insertAttribute("size", uint2str(size()));
for(unsigned int i=0; i<size(); ++i) {
ioStreamer.openTag("Obj", false);
ioStreamer.insertStringContent(dbl2str((*this)[i]));
ioStreamer.closeTag();
}
Beagle_StackTraceEndM();
}
示例5:
/*!
* \brief Write a float vector into a XML streamer.
* \param ioStreamer XML streamer into which the float vector is written.
* \param inIndent Whether output should be indented.
*/
void GA::IntegerVector::writeContent(PACC::XML::Streamer& ioStreamer, bool inIndent) const
{
Beagle_StackTraceBeginM();
ioStreamer.insertAttribute("size", uint2str(size()));
std::ostringstream lOSS;
for(unsigned int i=0; i<size(); ++i) {
lOSS << (*this)[i];
if(i!=(size()-1)) lOSS << ';';
}
ioStreamer.insertStringContent(lOSS.str());
Beagle_StackTraceEndM("void GA::IntegerVector::writeContent(PACC::XML::Streamer& ioStreamer, bool inIndent) const");
}
示例6:
/*!
* \brief Write an ES vector into a XML streamer.
* \param ioStreamer XML streamer into which the ES vector is written.
* \param inIndent Whether output should be indented.
*/
void GA::ESVector::writeContent(PACC::XML::Streamer& ioStreamer, bool inIndent) const
{
Beagle_StackTraceBeginM();
ioStreamer.insertAttribute("size", uint2str(size()));
std::ostringstream lOSS;
for(unsigned int i=0; i<size(); i++) {
lOSS << '(' << (*this)[i].mValue << ',' << (*this)[i].mStrategy << ')';
if(i!=(size()-1)) lOSS << '/';
}
ioStreamer.insertStringContent(lOSS.str());
Beagle_StackTraceEndM("void GA::ESVector::write(PACC::XML::Streamer&,bool) const");
}
示例7:
void SCHNAPS::Core::ArrayT<T>::write(PACC::XML::Streamer& ioStreamer, bool inIndent) const {
schnaps_StackTraceBeginM();
std::ostringstream lOSS;
for (unsigned int i = 0; i < std::vector<T>::size(); ++i) {
lOSS << (*this)[i];
if (i != (std::vector<T>::size() - 1)) {
lOSS << ',';
}
}
ioStreamer.insertStringContent(lOSS.str());
schnaps_StackTraceEndM("void SCHNAPS::Core::ArrayT<T>::write(PACC::XML::Streamer&, bool) const");
}
示例8: writeContent
/*!
* \brief Write a stats into a XML streamer.
* \param ioStreamer XML streamer used to write the stats into.
* \param inIndent Whether XML output should be indented.
*/
void Stats::writeContent(PACC::XML::Streamer& ioStreamer, bool inIndent) const
{
Beagle_StackTraceBeginM();
if(mValid) {
if(mID.empty() == false) ioStreamer.insertAttribute("id", mID);
ioStreamer.insertAttribute("generation", uint2str(mGeneration));
ioStreamer.insertAttribute("popsize", uint2str(mPopSize));
std::set<std::string> lSortedItemKey;
for(ItemMap::const_iterator lIterMap=mItemMap.begin(); lIterMap!=mItemMap.end(); ++lIterMap) {
lSortedItemKey.insert(lIterMap->first);
}
for(std::set<std::string>::const_iterator lIterSet=lSortedItemKey.begin();
lIterSet!=lSortedItemKey.end(); ++lIterSet) {
ioStreamer.openTag("Item", false);
ioStreamer.insertAttribute("key", *lIterSet);
ItemMap::const_iterator lIterMap = mItemMap.find(*lIterSet);
ioStreamer.insertStringContent(dbl2str(lIterMap->second,12));
ioStreamer.closeTag();
}
for(unsigned int i=0; i<size(); ++i) {
ioStreamer.openTag("Measure", inIndent);
ioStreamer.insertAttribute("id", (*this)[i].mID);
ioStreamer.openTag("Avg", false);
ioStreamer.insertStringContent(dbl2str((*this)[i].mAvg,12));
ioStreamer.closeTag();
ioStreamer.openTag("Std", false);
ioStreamer.insertStringContent(dbl2str((*this)[i].mStd,12));
ioStreamer.closeTag();
ioStreamer.openTag("Max", false);
ioStreamer.insertStringContent(dbl2str((*this)[i].mMax,12));
ioStreamer.closeTag();
ioStreamer.openTag("Min", false);
ioStreamer.insertStringContent(dbl2str((*this)[i].mMin,12));
ioStreamer.closeTag();
ioStreamer.closeTag();
}
} else ioStreamer.insertAttribute("valid", "no");
Beagle_StackTraceEndM("void Stats::writeContent(PACC::XML::Streamer&,bool) const");
}
示例9: write
/*!
* \brief Write a matrix into a XML streamer.
* \param ioStreamer XML streamer to use.
* \param inIndent Whether output should be indented.
*/
void Matrix::write(PACC::XML::Streamer& ioStreamer, bool inIndent) const
{
Beagle_StackTraceBeginM();
ioStreamer.insertStringContent(PACC::Matrix::serialize());
Beagle_StackTraceEndM();
}
示例10: writeContent
/*!
* \brief Write the state of the quasi-random generator into a XML streamer.
* \param ioStreamer XML streamer to write the randomizer into.
* \param inIndent Whether output should be indented.
*/
void QuasiRandom::writeContent(PACC::XML::Streamer& ioStreamer, bool inIndent) const
{
Beagle_StackTraceBeginM();
if(getDimensionality() != 0) ioStreamer.insertStringContent(getState());
Beagle_StackTraceEndM("void QuasiRandom::writeContent(PACC::XML::Streamer& ioStreamer, bool inIndent) const");
}
示例11: write
void BGFitness::write(PACC::XML::Streamer& ioStreamer, bool inIndent) const {
// Beagle_StackTraceBeginM();
ioStreamer.openTag("Fitness", inIndent);
ioStreamer.insertAttribute("type", "LogFitness");
if(isValid()) {
ioStreamer.openTag("Obj", inIndent);
ioStreamer.insertStringContent(dbl2str(mFitness).c_str());
ioStreamer.closeTag();
ioStreamer.openTag("OriObj", inIndent);
ioStreamer.insertStringContent(dbl2str(mOriginalFitness).c_str());
ioStreamer.closeTag();
//State Matrix
ioStreamer.openTag("StateMatrices",inIndent);
// MatrixInterface lInterface;
for(unsigned int i = 0; i < mStateMatrices.size(); ++i) {
mStateMatrices[i].write(ioStreamer);
// lInterface.write(mStateMatrices[i],ioStreamer);
}
ioStreamer.closeTag();
if(mDataSet.size() == 0) {
for(unsigned int i = 0; i < mVariableData.size(); ++i) {
ioStreamer.openTag("Data", false);
ioStreamer.insertAttribute("Name", mVariableName[i]);
ioStreamer.insertAttribute("usize", uint2str(mUncompressedSize[i]));
ioStreamer.insertStringContent(mVariableData[i]);
ioStreamer.closeTag();
}
} else {
for(std::map<unsigned int, double>::const_iterator lIter = mDataSet.begin(); lIter != mDataSet.end(); ++lIter) {
ioStreamer.openTag("DataSet", inIndent);
ioStreamer.insertAttribute("ID", uint2str(lIter->first));
ioStreamer.openTag("Obj", false);
ioStreamer.insertStringContent( dbl2str(lIter->second).c_str() );
ioStreamer.closeTag();
for(unsigned int i = 0; i < mVariableData.size(); ++i) {
if(lIter->first == mVariableDataSet[i]) {
ioStreamer.openTag("Data", false);
ioStreamer.insertAttribute("Name", mVariableName[i]);
ioStreamer.insertAttribute("usize", uint2str(mUncompressedSize[i]));
ioStreamer.insertStringContent(mVariableData[i]);
ioStreamer.closeTag();
}
}
ioStreamer.closeTag();
}
}
if(!mInfo.empty()) {
ioStreamer.openTag("Info", inIndent);
for(std::map<std::string,std::string>::const_iterator lIter = mInfo.begin(); lIter != mInfo.end(); ++lIter) {
ioStreamer.openTag(lIter->first, false);
ioStreamer.insertStringContent( lIter->second );
ioStreamer.closeTag();
}
ioStreamer.closeTag();
}
if(mBondGraph!=NULL) {
mBondGraph->write(ioStreamer,false);
}
if(mSimplifiedBondGraph!=NULL) {
ioStreamer.openTag("SimplifiedBondGraph", inIndent);
mSimplifiedBondGraph->write(ioStreamer,false);
ioStreamer.closeTag();
}
}
else ioStreamer.insertAttribute("valid", "no");
ioStreamer.closeTag();
// Beagle_StackTraceEndM("void LogFitness::write(PACC::XML::Streamer& ioStreamer, bool inIndent) const");
}