当前位置: 首页>>代码示例>>C++>>正文


C++ RunLog类代码示例

本文整理汇总了C++中RunLog的典型用法代码示例。如果您正苦于以下问题:C++ RunLog类的具体用法?C++ RunLog怎么用?C++ RunLog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RunLog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: startARunLog

	/**@brief A function to start a runLog in the named directory
	 * @param dirName The name of the directory to start the runLog, runLog name
	 *will be runLog_[NAME_OF_PROGRAM]
	 *
	 */
	void startARunLog(const std::string &dirName) {
		rLog_.setFilenameAndOpen(
				files::make_path(dirName,"runLog_"
						+ replaceString(replaceString(commands_.getProgramName(), "./", ""),
								" ", "-")+ "_" + getCurrentDate() + ".txt").string(), timer_.start_);
		rLog_.startRunLog(commands_);
	}
开发者ID:umass-bib,项目名称:bibcpp,代码行数:12,代码来源:programSetUp.hpp

示例2: SaveFeatureFile

void  FeatureFileIO::SaveFeatureFile (const KKStr&          _fileName, 
                                      FeatureNumListConst&  _selFeatures,
                                      FeatureVectorList&    _examples,
                                      kkuint32&             _numExamplesWritten,
                                      VolConstBool&         _cancelFlag,
                                      bool&                 _successful,
                                      RunLog&               _log
                                     )
{
  _log.Level (10) << "FeatureFileIO::SaveFeatureFile - File[" << _fileName << "]." << endl;

  ofstream  out (_fileName.Str ());
  if  (!out.is_open())
  {
    _log.Level (-1) << "***ERROR***, SaveFeatureFile, Opening File[" << _fileName << "]" << endl;
    _successful = false;
  }

  out.precision (9);

  KKStr  errorMessage;
  SaveFile (_examples, _fileName, _selFeatures, out, _numExamplesWritten, _cancelFlag, _successful, errorMessage, _log);

  out.close ();
}  /* SaveFeatureFile */
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:25,代码来源:FeatureFileIO.cpp

示例3: in

FeatureVectorListPtr  FeatureFileIO::LoadFeatureFile 
                                      (const KKStr&   _fileName,
                                       MLClassList&   _mlClasses,
                                       OptionUInt32   _maxCount,
                                       VolConstBool&  _cancelFlag,    // will be monitored,  if set to True  Load will terminate.
                                       bool&          _successful,
                                       bool&          _changesMade,
                                       RunLog&        _log
                                      )
{
  _log.Level (10) << "LoadFeatureFile  File[" << _fileName << "]  FileFormat[" << driverName << "]" << endl;
  
  _changesMade = false;

  kkint32  estimatedNumOfDataItems = -1;
  
  _successful = true;

  ifstream  in (_fileName.Str (), ios_base::in);
  if  (!in.is_open ())
  {
    _log.Level (-1) << "LoadFeatureFile   ***ERROR***      Error Opening File[" << _fileName << "]." << endl;
    _successful = false;
    return  NULL;
  }

  KKStr  errorMessage;
  
  FileDescConstPtr  fileDescFromFile = GetFileDesc (_fileName, in, &_mlClasses, estimatedNumOfDataItems, errorMessage, _log);
  if  (fileDescFromFile == NULL)
  {
    _log.Level (-1) << endl << endl 
                   << "FeatureFileIO::LoadFeatureFile    ***ERROR***     Loading Feature File[" << _fileName << "]" << endl
                   << endl;
    _successful = false;
    return NULL;
  }

  FileDescConstPtr fileDesc = FileDesc::GetExistingFileDesc (fileDescFromFile);

  in.clear ();
  in.seekg (0, ios::beg);

  FeatureVectorListPtr  examples = LoadFile (_fileName, fileDesc, _mlClasses, in, _maxCount, _cancelFlag, _changesMade, errorMessage, _log);
  if  (examples == NULL)
  {
    _successful = false;
  }
  else
  {
    _successful = true;
  }

  in.close ();

  return  examples;
}  /* LoadFeatureFile */
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:57,代码来源:FeatureFileIO.cpp

示例4: SaveFile

void  FeatureFileIO::SaveFile (FeatureVectorList&    _data,
                               const KKStr&          _fileName,
                               FeatureNumListConst&  _selFeatures,
                               std::ostream&         _out,
                               kkuint32&             _numExamplesWritten,
                               VolConstBool&         _cancelFlag,
                               bool&                 _successful,
                               KKStr&                _errorMessage,
                               RunLog&               _log
                              )
{
   _errorMessage = "Driver: '" + this->DriverName () + "' does not implement 'SaveFile' method.";
   _log.Level (-1) << endl
      << "FeatureFileIO::SaveFile    ***ERROR***   " << _errorMessage << endl
      << "     _data.size   : " << _data.size () << endl
      << "     _fileName    : " << _fileName << endl
      << "     _selFeatures : " << _selFeatures.ToCommaDelStr () << endl
      << "     _out.fail    : " << _out.fail () << endl
      << "     _cancelFlag  : " << _cancelFlag << endl
      << endl;
      
  _successful = false;
  _numExamplesWritten = 0;
  return;
}
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:25,代码来源:FeatureFileIO.cpp

示例5: LoadFile

FeatureVectorListPtr  FeatureFileIO::LoadFile (const KKStr&      _fileName,
                                               FileDescConstPtr  _fileDesc,
                                               MLClassList&      _classes, 
                                               istream&          _in,
                                               OptionUInt32      _maxCount,    // Maximum # images to load.
                                               VolConstBool&     _cancelFlag,
                                               bool&             _changesMade,
                                               KKStr&            _errorMessage,
                                               RunLog&           _log
                                              )
{
  _errorMessage = "Driver '" + DriverName () + "' does not implemenet  'LoadFile'  method.";
  _log.Level (10) << endl
      << "FeatureFileIO::LoadFile   ***ERROR***   " << _errorMessage << endl
      << "    _fileName   : " << _fileName << endl
      << "    _fileDesc   : " << _fileDesc->NumOfFields () << endl
      << "    _classes    : " << _classes.ToCommaDelimitedStr () << endl
      << "    _in.flags   : " << _in.flags () << endl
      << "    _maxCount   : " << _maxCount << endl
      << "    _cancelFlag : " << _cancelFlag << endl
      << "    _changesMade: " << _changesMade << endl
      << endl;

  _errorMessage = "ROBERTS read functionality not implemented.";
  return NULL;
}
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:26,代码来源:FeatureFileIO.cpp

示例6: ComputeFeatureVectorFromImage

ImageFeaturesPtr  PicesFVProducer::ComputeFeatureVectorFromImage (const KKStr&      fileName,
                                                                  const MLClassPtr  knownClass,
                                                                  RasterListPtr     intermediateImages,
                                                                  RunLog&           runLog
                                                                 )
{
  ImageFeaturesPtr  fv = NULL;

  bool  validFile = false;
  RasterSipperPtr  i = new RasterSipper (fileName, validFile);
  if  (!validFile)
  {
    delete i;
    i = NULL;
  }

  if  (i == NULL)
  {
    runLog.Level (-1) << "PicesFVProducer::ComputeFeatureVectorFromImage   ***ERROR***   Error loading ImageFile: " << fileName << endl << endl;
  }
  else
  {
    fv = ComputeFeatureVector (*i, knownClass, intermediateImages, 1.0f, runLog);
    delete  i;
    i = NULL;
  }

  return  fv;
}  /* ComputeFeatureVectorFromImage */
开发者ID:KurtKramer,项目名称:Pices,代码行数:29,代码来源:PicesFVProducer.cpp

示例7: CheckFileDescCopasetic

void  CrossValidationMxN::CheckFileDescCopasetic (RunLog&  log)
{
  if  (config->FileDesc () != orderings->FileDesc ())
  {
    // The Configuration 'fileDesc' is different than the orderings 'FileDesc'.
    // This is a VERY VERY bad situation. Processing needs to stop NOW NOW NOW.
    KKStr errMsg = "CrossValidationMxN     ***ERROR***    File Description between config and orderings don't match.";
    log.Level (-1) << endl << errMsg << endl << endl;
    throw KKException (errMsg);
  }
}  /* CheckFileDescCopesetic */
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:11,代码来源:CrossValidationMxN.cpp

示例8: ReportError

void  ReportError (RunLog&       log,
                   const KKStr&  fileName,
                   const KKStr&  funcName,
                   kkint32       lineCount,
                   const KKStr&  errorDesc
                  )
{
  log.Level (-1) << endl
                 << funcName << "     *** ERROR ***" << endl
                 << "           File     [" << fileName      << "]" << endl
                 << "           LineCount[" << lineCount     << "]" << endl
                 << "           Error    [" << errorDesc     << "]" << endl
                 << endl;
}  /* ReportError */
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:14,代码来源:FeatureFileIO.cpp

示例9: out

void   FeatureFileIO::AppendToFile (const KKStr&          _fileName,
                                    FeatureNumListConst&  _selFeatures,
                                    FeatureVectorList&    _examples,
                                    kkuint32&             _numExamplesWritten,
                                    VolConstBool&         _cancelFlag,
                                    bool&                 _successful,
                                    RunLog&               _log
                                   )
{
  _log.Level (10) << "FeatureFileIO::AppendToFile - File[" << _fileName << "]." << endl;

  _successful = true;

  ofstream out (_fileName.Str (), ios::app);

  if  (!out.is_open())
  {
    KKStr  err;
    err << "AppendToFile  Error Opening File[" << _fileName << "]";
    _log.Level (-1)  << endl
                     << "FeatureFileIO::AppendToFile    ***ERROR***"  << endl
                     << endl
                     << "                   " << err  << endl
                     << endl;
    osDisplayWarning (err);
    _successful = false;
    return;
  }

  KKStr  errorMessage;
  SaveFile (_examples, _fileName,  _selFeatures, out, _numExamplesWritten, _cancelFlag, _successful, errorMessage, _log);

  out.close ();

  return;
}  /* AppendToFile */
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:36,代码来源:FeatureFileIO.cpp

示例10: GetFileDesc

FileDescConstPtr  FeatureFileIO::GetFileDesc (const KKStr&    _fileName,
                                              istream&        _in,
                                              MLClassListPtr  _classes,
                                              kkint32&        _estSize,
                                              KKStr&          _errorMessage,
                                              RunLog&         _log
                                             )
{
  _errorMessage = "Driver '" + DriverName () + "' does not implemenet  'GetFileDesc'  method.";
  _log.Level (10) << endl 
      << "FeatureFileIO::GetFileDesc   ***ERROR***    " << _errorMessage << endl
      << "    _fileName: " << _fileName << endl
      << "    _in.flags: " << _in.flags () << endl
      << "    _classes : " << _classes->ToCommaDelimitedStr () << endl
      << "    _estSize : " << _estSize << endl
      << endl;
  _errorMessage = "ROBERTS read_estSize, functionality not implemented.";
  return NULL; 
}
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:19,代码来源:FeatureFileIO.cpp

示例11: ComputeFeatureVector

ImageFeaturesPtr  PicesFVProducer::ComputeFeatureVector (const Raster&     srcImage,
                                                         const MLClassPtr  knownClass,
                                                         RasterListPtr     intermediateImages,
                                                         float             priorReductionFactor,
                                                         RunLog&           runLog
                                                        )
{
  ImageFeaturesPtr  fv = NULL;
  RasterSipperListPtr  sipperRasterIntermediateImages = NULL;
  if  (intermediateImages)
    sipperRasterIntermediateImages = new RasterSipperList (false);

  if  (typeid (srcImage) != typeid (MLL::RasterSipper))
  {
    runLog.Level (-1) << endl
      << "PicesFVProducer::ComputeFeatureVector   ***ERROR***   'srcImage' not a 'RasterSipper' derived class." << endl
      << "   ExampleFileName[" << srcImage.FileName () << "]" << endl
      << endl;

    RasterSipperPtr sipperRaster = new RasterSipper (srcImage);
    fv = new ImageFeatures (*sipperRaster, knownClass, sipperRasterIntermediateImages, runLog);
    delete  sipperRaster;
    sipperRaster = NULL;
  }
  else
  {
    MLL::RasterSipperPtr  sipperImage = dynamic_cast<MLL::RasterSipperPtr> (&(Raster&)srcImage);
    fv = new ImageFeatures (*sipperImage, knownClass, sipperRasterIntermediateImages, runLog);
  }

  if  (sipperRasterIntermediateImages)
  {
    for  (auto intermdiateIDX: *sipperRasterIntermediateImages)
      intermediateImages->PushOnBack (intermdiateIDX);
    sipperRasterIntermediateImages->Owner (false);
  }

  delete  sipperRasterIntermediateImages;
  sipperRasterIntermediateImages = NULL;

  return fv;
}  /* ComputeFeatureVector */
开发者ID:KurtKramer,项目名称:Pices,代码行数:42,代码来源:PicesFVProducer.cpp

示例12: RemoveEntriesWithMissingFeatures

void  FeatureVectorList::RemoveEntriesWithMissingFeatures (RunLog&  log)
{
  log.Level (50) << "FeatureVectorList::RemoveEntriesWithMissingFeatures" << endl;

  vector<FeatureVectorPtr>  entriesToBeDeleted;

  for  (iterator idx = begin ();  idx != end ();  idx++)
  {
    FeatureVectorPtr example = *idx;
    if  (example->MissingData ())
      entriesToBeDeleted.push_back (example);
  }

  for  (kkint32 x = 0;  x < (kkint32)entriesToBeDeleted.size ();  x++)
  {
    FeatureVectorPtr example = entriesToBeDeleted[x];
    DeleteEntry (example);
    if  (Owner ())
      delete  example;
  }

}  /* RemoveEntriesWithMissingFeatures */
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:22,代码来源:FeatureVector.cpp

示例13: CreateNewList

RandomSampleJobListPtr  RandomSampleJobList::CreateNewList (RunLog&                   _log,
                                                            TrainingConfigurationPtr  _config,
                                                            OrderingsPtr              _orderings,
                                                            int                       _numExamplesToKeep,
                                                            const KKStr&             _fileName
                                                            )
{

  _log.Level (10) << endl << endl << endl;
  _log << "RandomSampleJobList::CreateNewList" << endl;
  _log << "            fileName         [" << _fileName          << "]" << endl;
  _log << "            numExamplesToKeep[" << _numExamplesToKeep << "]" << endl;          

  RandomSampleJobListPtr  list = NULL;

  if  (osFileExists (_fileName))
  {
    _log << "Ordering Files already Exists." << endl;
    list = new RandomSampleJobList (_log, _config, _orderings, _numExamplesToKeep, _fileName);
  }
  else
  {
    _log << "Ordering Files DID NOT exists" << endl;
    list = new RandomSampleJobList (_log);

    int  orderingNum = 0;

    for  (orderingNum = 0;  orderingNum < (int)_orderings->NumOfOrderings ();  orderingNum++)
    {
      RandomSampleJobPtr  j = new RandomSampleJob (_config, _orderings, orderingNum, orderingNum, _numExamplesToKeep);
      list->PushOnBack (j);
    }

    list->Save (_fileName);
  }

  return  list;
}  /* CreateNewList */
开发者ID:jizhihang,项目名称:Pices-XXX-,代码行数:38,代码来源:RandomSampleJob.cpp

示例14: ReadXML

void  FeatureNumList::ReadXML (XmlStream&      s,
                               XmlTagConstPtr  tag,
                               VolConstBool&   cancelFlag,
                               RunLog&         log
                             )
{
  maxFeatureNum = (IntType)tag->AttributeValueInt32 ("MaxFeatureNum");
  auto expectedNumOfFeatures = (IntType)tag->AttributeValueInt32 ("NumOfFeatures");
  numOfFeatures = 0;

  XmlTokenPtr  t = s.GetNextToken (cancelFlag, log);
  while  (t  &&  (!cancelFlag))
  {
    if  (typeid (*t) == typeid(XmlContent))
    {
      XmlContentPtr c = dynamic_cast<XmlContentPtr> (t);
      if  (c  &&  (c->Content ()))
      {
        bool  valid = false;
        ParseToString (*(c->Content ()), valid);
      }
    }

    delete  t;
    t = s.GetNextToken (cancelFlag, log);
  }

  delete  t;
  t = NULL;

  if  (expectedNumOfFeatures != numOfFeatures)
  {
    log.Level (-1) << endl
      << "FeatureNumList::ReadXML   ***ERROR***   expectedNumOfFeatures["  << expectedNumOfFeatures << "]  not equal  numOfFeatures[" << numOfFeatures << "]" << endl
      << endl;
  }
}  /* ReadXML */
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:37,代码来源:FeatureNumList.cpp

示例15: ImportGPSDataGPGGA

void  ImportGPSDataGPGGA (const KKStr&  fileName)
{
  RunLog  log;

  DataBasePtr  dbConn = new DataBase (log);

  ifstream  i (fileName.Str ());
  if  (!i.is_open ())
  {
    log.Level (-1) << endl << endl 
       << "ImpotrtGPSData  Could not open file[" << fileName << "]" << endl
       << endl;
    return;
  }
  log.Level (10) << endl << endl << endl << endl << endl
    << "ImpotrtGPSData   FileName[" << fileName << "]" << endl << endl
    << endl;

  char  buff[20480];
  bool  firstPass = true;

  int  lastMinute = 0;
  int  linesRead = 0;

  KKStr  ln (256);

  DateTime  lastDateTime;
  while  (i.getline (buff, sizeof (buff)))
  {
    linesRead++;
    ln = buff;
    ln.TrimLeft ();
     
    if  (!ln.LocateStr ("GPGGA"))
      continue;

    VectorKKStr  fields = ln.Parse (",");
    if  (fields.size () < 8)
      continue;

    if  (!fields[2].EqualIgnoreCase ("$GPGGA"))
      continue;


    /*
    0           1             2        3         4      5       6       7   8  
06/01/2010, 23:59:59.818,  $GPGGA,  235958,  2840.927,  N,  08828.458,  W,  2,  09,22.10,0,M,,,14,0000*12
06/02/2010, 00:00:10.818,  $GPGGA,  000009,  2840.931,  N,  08828.482,  W,  1,  09,0.89,0,M,,,,*2D
06/02/2010, 00:00:21.802,  $GPGGA,  000020,  2840.929,  N,  08828.505,  W,  1,  09,0.89,0,M,,,,*21
06/02/2010, 00:00:31.818,  $GPGGA,  000030,  2840.924,  N,  08828.526,  W,  1,  09,0.89,0,M,,,,*2C
06/02/2010, 00:00:42.818,  $GPGGA,  000041,  2840.917,  N,  08828.547,  W,  1,  09,0.89,0,M,,,,*2D
06/02/2010, 00:00:53.802,  $GPGGA,  000052,  2840.906,  N,  08828.568,  W,  1,  09,1.00,0,M,,,,*22
06/02/2010, 00:01:03.802,  $GPGGA,  000102,  2840.895,  N,  08828.585,  W,  1,  09,0.89,0,M,,,,*2E
06/02/2010, 00:01:13.818,  $GPGGA,  000112,  2840.883,  N,  08828.600,  W,  1,  09,0.89,0,M,,,,*26
   */


    KKStr  dateStr = fields[0];
    KKStr  timeStr = fields[1];

    KKStr  latStr = fields[4];
    KKStr  logStr = fields[6];

    auto  x = latStr.LocateCharacter ('.');
    if  (!x) 
      continue;

    KKStr latMinStr = latStr.SubStrPart (x - 2);
    KKStr latDegStr = latStr.SubStrSeg (0, x - 2);

    double latitude = latDegStr.ToDouble () + latMinStr.ToDouble () / 60.0;
    if  (fields[5].EqualIgnoreCase ("S"))
      latitude = 0.0 - latitude;

    x = logStr.LocateCharacter ('.');
    if  (!x) 
      continue;

    KKStr logMinStr = logStr.SubStrPart (x - 2);
    KKStr logDegStr = logStr.SubStrSeg (0, x - 2);

    double longitude = logDegStr.ToDouble () + logMinStr.ToDouble () / 60.0;
    if  (fields[7].EqualIgnoreCase ("W"))
      longitude = 0.0 - longitude;

    DateType  gmtDate (dateStr);
    TimeType  gmtTime (timeStr);

    DateTime  gmtDateTime (gmtDate, gmtTime);
    DateTime  localTime = gmtDateTime;
    localTime.HoursAdd (-4);

    DateTime  startDT = localTime;
    DateTime  endDT   = localTime;

    if  (firstPass)
    {
      firstPass = false;
      startDT.SecondsAdd (-180);
    }
//.........这里部分代码省略.........
开发者ID:KurtKramer,项目名称:Pices,代码行数:101,代码来源:MergeFeatureFiles.cpp


注:本文中的RunLog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。