Skip to content

Commit

Permalink
Corrected instantiation bug in Events
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekLong101 committed Nov 25, 2014
1 parent afdf3dd commit 6bcc07a
Show file tree
Hide file tree
Showing 4 changed files with 329 additions and 327 deletions.
Binary file modified bin/tan/tan.exe
Binary file not shown.
Binary file modified bin/validate/validate.exe
Binary file not shown.
16 changes: 9 additions & 7 deletions src/Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ const vector<const_symbol_list*> getParametersDiscreteFinal(goal * g,operator_ *

const vector<const_symbol_list*> getParametersCtsFinal(goal * g,operator_ * op,Validator * v)
{
const vector<const_symbol_list*> listOfParameters0 = getParametersCts(g,op,v);
const vector<const_symbol_list*> listOfParameters0 = getParametersCts(g,op,v,false,false);
const vector<const_symbol_list*> listOfParameters00 = removeRepeatedParameters(listOfParameters0);
const set<var_symbol*> svs = getVariables(op);
return defineUndefinedParameters(listOfParameters00,op,v,svs);
Expand Down Expand Up @@ -1066,7 +1066,7 @@ const vector<const_symbol_list*> getParametersCts(goal * g,operator_ * op,Valida
//Negation
if(dynamic_cast<const neg_goal *>(g))
{
return getParametersCts(const_cast<goal*>(dynamic_cast<const neg_goal *>(g)->getGoal()),op,v,!neg);
return getParametersCts(const_cast<goal*>(dynamic_cast<const neg_goal *>(g)->getGoal()),op,v,!neg,atAPoint);
};

//Others
Expand Down Expand Up @@ -1102,10 +1102,10 @@ const vector<const_symbol_list*> getParameters(goal * g,operator_ * op,Validator
if(discrete) someParameters = getParametersDiscrete(*i,op,v->getState(),neg);
else someParameters = getParametersCts(*i,op,v,neg,atAPoint);


//whittle down the list of parameters depending if they satisfy the rest of the conjunction
vector<const_symbol_list*> alistOfparameters;
if(!someParameters.empty()) alistOfparameters = getParametersList(g,op,v,someParameters,neg,discrete,atAPoint);

deleteParameters(someParameters);

for(vector<const_symbol_list*>::const_iterator l = alistOfparameters.begin(); l != alistOfparameters.end(); ++l)
Expand Down Expand Up @@ -1329,7 +1329,9 @@ const vector<const_symbol_list*> getParametersList(goal * g,operator_ * op,Valid
if(i->second && (i->first->getPropName() == literalName))
{
if(i->first->checkParametersConstantsMatch(sg->getProp()->args))
{
addToListOfParameters(listOfparameters,lop,i->first->getConstants(op->parameters,sg->getProp()->args,v));
}
};
};
}
Expand All @@ -1345,7 +1347,6 @@ const vector<const_symbol_list*> getParametersList(goal * g,operator_ * op,Valid
listOfparameters = defineUndefinedParametersPropVar(someParameters,op,v,g,isDerivedPred,neg,svs);

};

return listOfparameters;
};

Expand Down Expand Up @@ -1611,7 +1612,7 @@ void addToListOfParameters(vector<const_symbol_list*> & vcsl,const vector<const_
{
if((*j))
{
if(!(*k))
if(!(*k))
*l = *j;
else if(*l != *j)
satisfied = false; //the literal(or other) is not satisfied by previously defined parameters so not add to list of parameters
Expand All @@ -1629,7 +1630,7 @@ void addToListOfParameters(vector<const_symbol_list*> & vcsl,const vector<const_
delete csl;

//test
/* cout << " results\n";
/* cout << " results\n";
for(vector<const_symbol_list*>::const_iterator k = vcsl.begin(); k != vcsl.end() ; ++k)
{
for(const_symbol_list::iterator l = (*k)->begin(); l != (*k)->end(); ++l)
Expand All @@ -1638,7 +1639,8 @@ void addToListOfParameters(vector<const_symbol_list*> & vcsl,const vector<const_
};
cout <<"\n";
}; */ //end test
}; */
//end test


};
Expand Down
Loading

0 comments on commit 6bcc07a

Please sign in to comment.