本文整理汇总了C++中ParameterList::front方法的典型用法代码示例。如果您正苦于以下问题:C++ ParameterList::front方法的具体用法?C++ ParameterList::front怎么用?C++ ParameterList::front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterList
的用法示例。
在下文中一共展示了ParameterList::front方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
ClsQStateArrayViewHex::ClsQStateArrayViewHex( QWidget *parent, ClsBaseTopology *_clsBaseTopologyGroup,
const char *_name, unsigned int _iSelectionMode ) :
ClsBaseQStateArrayView(parent, _clsBaseTopologyGroup, _name, _iSelectionMode) {
iCellSize = 20;
iNrCellsX = 10;
iNrCellsY = 10;
setBackgroundColor(yellow);
ParameterList parameterList = _clsBaseTopologyGroup->getListParameters();
while (parameterList.size()) {
string strParamName = parameterList.front()->getName();
string strParamValue = parameterList.front()->getValueAsString();
// cout << "ParamName: " << strParamName << ": " << strParamValue << endl;
if(!strParamName.compare(ClsTagLibrary::TopologyWidthTag())) {
iNrCellsX = iqrUtils::string2int(strParamValue);
}
else if(!strParamName.compare(ClsTagLibrary::TopologyHeightTag())) {
iNrCellsY = iqrUtils::string2int(strParamValue);
}
parameterList.pop_front();
}
iCellSize = iSizeMax / (iNrCellsX > iNrCellsY ? iNrCellsX : iNrCellsY);
vCells.resize(iNrCellsX+1);
for(int ii=0; ii<(iNrCellsX + 1);ii++){
vCells[ii].resize(iNrCellsY+1);
}
iXPosStart = iYPosStart = 0;
fValMin = 0;
fValMax = 1.0;
fScaleFactor = 255.0;
this->setFrameStyle( QFrame::WinPanel | QFrame::Raised );
setMinimumSize( iNrCellsX * iCellSize + 2 * BORDER , iNrCellsY * iCellSize + 2 * BORDER );
setMaximumSize( iNrCellsX * iCellSize + 2 * BORDER , iNrCellsY * iCellSize + 2 * BORDER );
clear();
createNullPixmap();
// resize( maxi * SCALE + 2 * BORDER , maxj * SCALE + 2 * BORDER );
// resize( iNrCellsX * iCellSize + 2 * BORDER , iNrCellsY * iCellSize + 2 * BORDER );
}
示例2: if
ClsQStateArrayViewRect::ClsQStateArrayViewRect( QWidget *parent, ClsBaseTopology *_clsBaseTopologyGroup,
const char *_name, unsigned int _iSelectionMode ) :
ClsBaseQStateArrayView(parent, _clsBaseTopologyGroup, _name, _iSelectionMode) {
#ifdef DEBUG_CLSQSTATEARRAYVIEWRECT
cout << "ClsQStateArrayViewRect( QWidget *parent, ClsBaseTopology *_clsBaseTopologyGroup, const char *_name, unsigned int _iSelectionMode ) " << endl;
#endif
iCellSize = 20;
iNrCellsX = 10;
iNrCellsY = 10;
ParameterList parameterList = _clsBaseTopologyGroup->getListParameters();
while (parameterList.size()) {
string strParamName = parameterList.front()->getName();
string strParamValue = parameterList.front()->getValueAsString();
if(!strParamName.compare(ClsTagLibrary::TopologyWidthTag())) {
iNrCellsX = iqrUtils::string2int(strParamValue);
}
else if(!strParamName.compare(ClsTagLibrary::TopologyHeightTag())) {
iNrCellsY = iqrUtils::string2int(strParamValue);
}
parameterList.pop_front();
}
iCellSize = iSizeMax / (iNrCellsX > iNrCellsY ? iNrCellsX : iNrCellsY);
if(iCellSize <=1){
iCellSize = 2;
}
vCells.resize(iNrCellsX+1);
for(int ii=0; ii<(iNrCellsX + 1);ii++){
vCells[ii].resize(iNrCellsY+1);
}
this->setFrameStyle( QFrame::WinPanel | QFrame::Raised );
setMinimumSize( iNrCellsX * iCellSize + 2 * BORDER , iNrCellsY * iCellSize + 2 * BORDER );
setMaximumSize( iNrCellsX * iCellSize + 2 * BORDER , iNrCellsY * iCellSize + 2 * BORDER );
clear();
createNullPixmap();
}
示例3: checkParamEqualCharacterCount
double checkParamEqualCharacterCount(const ParameterList & parameterList, predicateCallbackType predicateCallback, numericalFluentCallbackType numericalFluentCallback, int relaxed)
{
ROS_DEBUG("Calling %s module", __func__);
if(parameterList.empty())
return false;
Parameter p1 = parameterList.front();
// we care for the instance, not the name itself
int len = p1.value.length();
return (len % 2 == 0);
}
示例4: can_load
double can_load(const ParameterList & parameterList,
predicateCallbackType predicateCallback, numericalFluentCallbackType numericalFluentCallback, int )
{
ROS_DEBUG("Calling module %s", __func__);
static int count = 0;
count++;
//cout << "Count: " << count << endl;
if(DEBUG_MOD)
cout << parameterList << endl;
PredicateList* list = NULL;
predicateCallback(list);
if(list == NULL) {
exit(1);
return false;
}
if(DEBUG_MOD) {
cout << "Predicates are: " << endl;
cout << *list << endl;
}
string me = parameterList.front().value;
string pack = parameterList.back().value;
deque<string> packs_in_truck;
for(PredicateList::iterator it = list->begin(); it != list->end(); it++) {
Predicate p = *it;
if(!p.value)
continue;
if(p.name != "in")
continue;
if(p.parameters.back().value == me)
packs_in_truck.push_back(p.parameters.front().value);
}
if(DEBUG_MOD) {
for(deque<string>::iterator it = packs_in_truck.begin(); it != packs_in_truck.end(); it++) {
cout << *it << endl;
}
if(packs_in_truck.empty()) {
cout << "No packs in " << me << endl;
} else {
cout << packs_in_truck.size() << " packs i truck " << me << endl;
}
}
packs_in_truck.push_back(pack);
NumericalFluentList* nfl = new NumericalFluentList();
for(deque<string>::iterator it = packs_in_truck.begin(); it != packs_in_truck.end(); it++) {
ParameterList pl;
pl.push_back(Parameter("p", "package", *it));
nfl->push_back(NumericalFluent("package-size", pl));
}
ParameterList plt;
plt.push_back(Parameter("v", "vehicle", me));
nfl->push_back(NumericalFluent("capacity", plt));
if(!numericalFluentCallback(nfl)) {
exit(1);
return false;
}
if(DEBUG_MOD)
cout << *nfl << endl;
// ideally: get sizes 1 - n-2, size n-1 == package, size n == capcity
// 1..n-2 + n == full_load
deque<double> packs;
for(NumericalFluentList::iterator it = nfl->begin(); it != nfl->end(); it++) {
packs.push_back((*it).value);
}
double cap = packs.back();
packs.erase(packs.end() - 1);
double pSize = packs.back();
packs.erase(packs.end() - 1);
if(DEBUG_MOD)
cout << "Packs" << packs.size() <<endl;
double sumPacks = 0;
for(deque<double>::iterator it = packs.begin(); it != packs.end(); it++) {
if(DEBUG_MOD)
cout << *it << endl;
sumPacks += *it;
}
if(DEBUG_MOD) {
cout << "newpack " << pSize << endl;
cout << "cap " << cap << endl;
}
double loadCap = sumPacks + cap;
if(DEBUG_MOD) {
cout << "loadCap " << loadCap;
cout << endl;
}
packs.push_back(pSize);
//.........这里部分代码省略.........