本文整理汇总了C++中Task::_setResultFile方法的典型用法代码示例。如果您正苦于以下问题:C++ Task::_setResultFile方法的具体用法?C++ Task::_setResultFile怎么用?C++ Task::_setResultFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::_setResultFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[]) //this main function should return error value, 0 = OK
{
/* check for program parameters */
if((getParams(argc, argv) < 0)) {help(); return -1;}
QCoreApplication a(argc, argv);
// Task parented to the application so that it will be deleted by the application.
Task *task = new Task(&a);
// Initialize the network
task->_init(static_cast<FG::pdfType>(pdfType), nStates, vRange, extRatio, gVar);
// train or load jpd?
if(jpdName.isNull() || jpdName.isEmpty()) //then train jpd
{
if(datasetName.isNull() || datasetName.isEmpty())
{
printf("Cannot train jpd! Missing dataset file!!!\n"); return -1;
} else
{
if(!task->_trainJPD(datasetName))
{
printf("Error during training jpd!\n"); return -1;
}
else
{
resultFileName = datasetName;
resultFileName.append(".res");
}
}
}
else
{
if(!task->_loadJPD(jpdName))
{
printf("Error during loading the jpd file!\n"); return -1;
}
else
{
resultFileName = jpdName;
resultFileName.replace(".jpd",".res");
}
}
task->_setResultFile(resultFileName); //this filename will be used during run()
task->_setInferMode(datasetInference);
/* print parameter information */
qDebug() << QString("Dataset name: %1").arg(datasetName);
qDebug() << QString("JPD name: %1").arg(jpdName);
qDebug() << QString("Result filename: %1").arg(resultFileName);
// This will cause the application to exit when the task signals finished.
QObject::connect(task, SIGNAL(finished()), &a, SLOT(quit()));
// This will run the task from the application event loop.
QTimer::singleShot(0, task, SLOT(run()));
return a.exec();
}