本文整理汇总了C++中ParametersLoader::exists方法的典型用法代码示例。如果您正苦于以下问题:C++ ParametersLoader::exists方法的具体用法?C++ ParametersLoader::exists怎么用?C++ ParametersLoader::exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParametersLoader
的用法示例。
在下文中一共展示了ParametersLoader::exists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initVariables
void initVariables()
{ trial.init(parameters);
// module factor: 0 -> 1 -> 2
module.init(1,false);
module.addFactor("Phase",str2num<int>(parameters.find("Phase"),","));
block = module.getNext();
if ( parameters.exists("StimulusDensity") )
stimulusDensity = str2num<double>(parameters.find("StimulusDensity"));
else
cerr << "Stimulus density parameters not found, set to 0.025..." << endl;
adaptStimHeight = str2num<double>(parameters.find("AdaptStimulusHeight"));
adaptStimRadius = str2num<double>(parameters.find("AdaptStimulusRadius"));
// crea la lista degli offset in adaptation dati start, end e numero steps
int nTrials = str2num<int>(parameters.find("AdaptTrials"));
double adaptOffsetStart = str2num<double>(parameters.find("AdaptOffsetStart"));
double adaptOffsetEnd = str2num<double>(parameters.find("AdaptOffsetEnd"));
int adaptOffsetNSteps = str2num<int>(parameters.find("AdaptOffsetSteps"));
if ( adaptOffsetNSteps > nTrials )
{ cerr << "too much steps, they must be at max " << nTrials << endl;
cin.ignore(1e6,'\n');
exit(0);
}
double adaptOffsetDelta = (adaptOffsetEnd - adaptOffsetStart)/adaptOffsetNSteps;
for (int i=0; i<= adaptOffsetNSteps ; i++)
adaptOffsets.push_back(i*adaptOffsetDelta+adaptOffsetStart);
while ( adaptOffsets.size() != nTrials+2 ) //+2 così non rogna nel markersFile
adaptOffsets.push_back(adaptOffsetEnd );
testStimHeight = str2num<double>(parameters.find("TestStimulusHeight"));
ballRadius = str2num<double>(parameters.find("BallRadius"));
initStimulus(adaptStimHeight,adaptStimRadius*2,adaptStimRadius*2);
hapticRodCenter = Vector3d(0,0,focalDistance);
indexInside[0]=indexInside[1]=false;
globalTimer.start();
frameTimer.start();
//trial.print(cerr);
}