本文整理汇总了C++中ParameterList::getValueInt方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterList::getValueInt方法的具体用法?C++ ParameterList::getValueInt怎么用?C++ ParameterList::getValueInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterList
的用法示例。
在下文中一共展示了ParameterList::getValueInt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: performPairSpectra
// -------------------------------------------------------------------------
bool performPairSpectra(ParameterList & ip,
PeptideSpectrumMatchSet &peptideResults,
SpecSet &specSet,
bool gridExecutionFlag)
{
DEBUG_TRACE;
DEBUG_VAR(peptideResults.size());
DEBUG_VAR(specSet.size());
ExecPairSpectra modulePairSpectra(ip,
&peptideResults,
&specSet);
DEBUG_TRACE;
string errorString;
bool isValid = modulePairSpectra.validateParams(errorString);
DEBUG_VAR(isValid);
if (!isValid)
{
ERROR_MSG(errorString);
return false;
}
bool returnStatus;
if (!modulePairSpectra.loadInputData())
{
return false;
}
if (!ip.exists("GRID_NUMNODES") || ip.getValueInt("GRID_NUMNODES") <= 0)
{
returnStatus = modulePairSpectra.invoke();
}
else
{
DEBUG_MSG("Grid execution not supported for ExecPairSpectra");
returnStatus = modulePairSpectra.invoke();
}
// Test for return status
DEBUG_VAR( returnStatus);
if (!returnStatus)
{
ERROR_MSG("invoking modulePairSpectra exited in error.");
return false;
}
DEBUG_TRACE;
modulePairSpectra.saveOutputData();
return true;
}
示例2: main
// -------------------------------------------------------------------------
int main(int argc, char ** argv)
{
Logger::setDefaultLogger(Logger::getLogger(0));
if (argc < 3)
{
cerr << "Usage: main_execmodule moduleName parametersFileName [options]" << endl;
return -1;
}
// Parse the command line parameters
vector<CommandLineParser::Option> listOptions;
listOptions.push_back(CommandLineParser::Option("t", "NUM_THREADS", true));
listOptions.push_back(CommandLineParser::Option("lf", "LOG_FILE_NAME", true));
listOptions.push_back(CommandLineParser::Option("ll", "LOG_LEVEL", true));
// Command line parameters for ExecSpectraExtraction for CCMS Workflows
listOptions.push_back(CommandLineParser::Option("ccms_output_library", "OUTPUT_MGF", true));
listOptions.push_back(CommandLineParser::Option("ccms_input_library", "EXISTING_LIBRARY_MGF", true));
listOptions.push_back(CommandLineParser::Option("ccms_input_spectradir", "SPECTRA_DIR", true));
listOptions.push_back(CommandLineParser::Option("ccms_results_dir", "RESULTS_DIR", true));
listOptions.push_back(CommandLineParser::Option("ccms_newresults_dir", "NEWLIBRARYRESULTS_DIR", true));
listOptions.push_back(CommandLineParser::Option("ccms_input_spectradatafile", "INPUTSPECTRA_DATAFILE", true));
listOptions.push_back(CommandLineParser::Option("ccms", "CCMS", true));
CommandLineParser clp(argc, argv, 2, listOptions);
string parser_error;
if (!clp.validate(parser_error))
{
ERROR_MSG(parser_error);
return -2;
}
ParameterList commandLineParams;
clp.getOptionsAsParameterList(commandLineParams);
// Load the parameter file
ParameterList ip;
std::string paramsFileName = argv[2];
std::string::size_type idx = paramsFileName.rfind(".");
if( idx != std::string::npos &&
paramsFileName.substr(idx + 1) == "xml"){
if (!ip.readFromProteosafeXMLFile(argv[2]))
{
ERROR_MSG("Can not read parameter file [" << argv[2] << "].");
return -3;
}
}
else{
if (!ip.readFromFile(argv[2]))
{
ERROR_MSG("Can not read parameter file [" << argv[2] << "].");
return -3;
}
}
// Combine the command line parameters to the file ones
// Command line parameters take precedence (hence the overwrite flag set)
ip.addList(commandLineParams, true);
int logLevel = ip.getValueInt("LOG_LEVEL", 0);
if (ip.exists("LOG_FILE_NAME"))
{
string logFileName = ip.getValue("LOG_FILE_NAME");
Logger::setDefaultLogger(Logger::getLogger(logFileName, logLevel));
}
else
{
Logger::setDefaultLogger(Logger::getLogger(logLevel));
}
DEBUG_TRACE;
// Fill the factory with all known module types
ExecModuleFactoryLP::RegisterAllModules();
DEBUG_TRACE;
// Get the exemplar from the factory
ExecBase * moduleExemplar = ExecModuleFactoryLP::getModule(argv[1]);
if (moduleExemplar == 0)
{
ERROR_MSG("Module name [" << argv[1] << "] not found in factory.");
ExecModuleFactoryLP::cleanup();
return -4;
}
DEBUG_TRACE;
// Clone the exemplar and create a real module with the desired parameters
ExecBase * moduleReal = moduleExemplar->clone(ip);
string jobDoneFile(moduleReal->getName());
jobDoneFile += "_";
string numNode = moduleReal->m_params.getValue("NUM_SPLIT");
jobDoneFile += numNode;
jobDoneFile += "_results.param";
DEBUG_VAR(jobDoneFile);
// Validate all the parameters before invoking
//.........这里部分代码省略.........
示例3: main
// -------------------------------------------------------------------------
int main(int argc, char ** argv)
{
int logLevel = 5;
Logger::setDefaultLogger(Logger::getLogger(logLevel));
string initialStageString("");
string finalStageString("");
string statusFileName("status.txt");
bool resumeFlag = false;
bool gridExecutionFlag = false;
bool runGenoMSFlag = false;
bool runMergedFlag = false;
bool showHelp = false;
for (size_t i = 0; i < argc; i++)
{
string arg(argv[i]);
if (arg.compare("--help") == 0)
{
showHelp = true;
}
}
if (argc < 2 || showHelp)
{
if (showHelp)
{
cout << "Usage: main_flr [PARAM FILE] [OPTION]..." << endl << endl;
cout << "Optional arguments are listed below " << endl;
cout << " -i <intialstage> begin processing at specified stage:"
<< endl;
cout << " begin,pairspectra,lpsolver,flr" << endl;
cout
<< " -f <finalstage> end processing after completing specified stage:"
<< endl;
cout << " lpsolver,flr" << endl;
cout << " -g execution is on a grid" << endl;
cout << " -lf <filename> name of log file for output" << endl;
cout << " -ll <loglevel> log level for debug/warn/error output:"
<< endl;
cout << " 9 for errors only" << endl;
cout << " 5 for warnings and errors" << endl;
cout << " 0 for all debug output" << endl;
cout << " -s execute a single step then exit" << endl;
}
else
{
cerr << "main_specnets: insufficient arguments" << endl;
cerr << "Try \'main_specnets --help\' for more information." << endl
<< endl;
}
cout << PROGRAM_NAME << endl;
cout << "main_specnets 3.0." << XSTR(SPS_VERSION) << endl;
cout << endl;
cout << COPYRIGHT1 << endl;
cout << COPYRIGHT2 << endl;
cout << endl;
return -1;
}
// Parse the command line parameters
vector<CommandLineParser::Option> listOptions;
listOptions.push_back(CommandLineParser::Option("i", "INITIAL_STAGE", 1));
listOptions.push_back(CommandLineParser::Option("f", "FINAL_STAGE", 1));
listOptions.push_back(CommandLineParser::Option("g", "GRID_EXECUTION", 0));
listOptions.push_back(CommandLineParser::Option("lf", "LOG_FILE_NAME", 1));
listOptions.push_back(CommandLineParser::Option("ll", "LOG_LEVEL", 1));
listOptions.push_back(CommandLineParser::Option("s", "SINGLE_STEP", 0));
CommandLineParser clp(argc, argv, 1, listOptions);
string parser_error;
if (!clp.validate(parser_error))
{
ERROR_MSG(parser_error);
return -2;
}
ParameterList commandLineParams;
clp.getOptionsAsParameterList(commandLineParams);
ParameterList ip;
ip.readFromFile(argv[1]);
ip.writeToFile("debug_sps.params");
// Combine the command line parameters to the file ones
// Command line parameters take precedence (hence the overwrite flag set)
ip.addList(commandLineParams, true);
ip.writeToFile("debug_wcommand.params");
logLevel = ip.getValueInt("LOG_LEVEL", 5);
if (ip.exists("LOG_FILE_NAME"))
{
string logFileName = ip.getValue("LOG_FILE_NAME");
Logger::setDefaultLogger(Logger::getLogger(logFileName, logLevel));
}
//.........这里部分代码省略.........
示例4: performFlr
// -------------------------------------------------------------------------
bool performFlr(ParameterList & ip, bool gridExecutionFlag)
{
DEBUG_TRACE;
ExecFlr moduleFlr(ip);
DEBUG_TRACE;
string errorString;
bool isValid = moduleFlr.validateParams(errorString);
DEBUG_VAR(isValid);
if (!isValid)
{
ERROR_MSG(errorString);
return false;
}
isValid = moduleFlr.loadInputData();
DEBUG_VAR(isValid);
if (!isValid)
{
ERROR_MSG(errorString);
return false;
}
bool returnStatus;
if (!ip.exists("GRID_NUMNODES") || ip.getValueInt("GRID_NUMNODES") <= 0)
{
returnStatus = moduleFlr.invoke();
}
else
{
DEBUG_TRACE;
int numNodes = ip.getValueInt("GRID_NUMNODES");
string gridType = ip.getValue("GRID_TYPE");
if (gridType == "pbs")
{
ParallelPbsExecution exec(&moduleFlr,
gridExecutionFlag,
!gridExecutionFlag,
false);
returnStatus = exec.invoke(numNodes);
}
else if (gridType == "sge")
{
ParallelSgeExecution exec(&moduleFlr,
gridExecutionFlag,
!gridExecutionFlag,
false);
returnStatus = exec.invoke(numNodes);
}
}
// Test for return status
DEBUG_VAR( returnStatus);
if (!returnStatus)
{
ERROR_MSG("invoking moduleFlr exited in error.");
return false;
}
DEBUG_TRACE;
moduleFlr.saveOutputData();
return true;
}