本文整理汇总了C++中Predicate::getParameters方法的典型用法代码示例。如果您正苦于以下问题:C++ Predicate::getParameters方法的具体用法?C++ Predicate::getParameters怎么用?C++ Predicate::getParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Predicate
的用法示例。
在下文中一共展示了Predicate::getParameters方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initSchemes
void Database::initSchemes(vector<Predicate> schemes){
for(int i = 0; i < (int)schemes.size(); i++){
Predicate r = schemes[i];
Relation r1(r.getID());
for(int j = 0; j < (int)r.getParameters().size(); j++)
r1.addParam(r.getParameters()[j].getValue());
relations.push_back(r1);
}
}
示例2: initFacts
void Database::initFacts(vector<Predicate> facts){
for(int i = 0; i < (int)facts.size(); i++){
Predicate r = facts[i];
string name = r.getID();
Tuple t;
for(int j = 0; j < (int)r.getParameters().size(); j++)
t.push_back(r.getParameters()[j].getValue());
addTuple(name, t);
}
}
示例3: performRename
Relation Database::performRename(Predicate query, Relation r){
vector<int> indexes = performSearch(query, r);
for(int i = 0; i < (int)indexes.size(); i++)
r = r.rename(i, query.getParameters()[indexes[i]].getValue());
return r;
}
示例4: performSelect
Relation Database::performSelect(Predicate query, Relation r){
vector<Parameter> params = query.getParameters();
for(int j = 0; j < (int)params.size(); j++){
if(params[j].getType() == "ID")
for(int k = j + 1; k < (int)params.size(); k++)
if(params[j].getValue() == params[k].getValue())
r = r.select(j, k);
if(params[j].getType() == "STRING")
r = r.select(j, params[j].getValue());
}
return r;
}
示例5:
vector<int> Database::performSearch(Predicate query, Relation r){
vector<int> indexes = vector<int>();
vector<Parameter> params = query.getParameters();
for(int j = 0; j < (int)params.size(); j++){
bool next = true;
if(params[j].getType() == "ID"){
next = false;
for(int k = 0; k < j; k++)
if(params[j].getValue() == params[k].getValue())
next = true;
}
if(!next)
indexes.push_back(j);
}
return indexes;
}
示例6: addQuery
void DatalogProgram::addQuery(Predicate newQuery){
queries.push_back(newQuery);
addDomain(newQuery.getParameters());
}
示例7: addFact
void DatalogProgram::addFact(Predicate newFact){
facts.push_back(newFact);
addDomain(newFact.getParameters());
}
示例8: headPredicate
Rule::Rule(Predicate _headPredicate, vector<Predicate> _predicateList) : headPredicate(_headPredicate.getFirstString(), _headPredicate.getSecondString(), _headPredicate.getParameters())
{
predicateList = _predicateList;
headPredicate = _headPredicate;
}