* @return The minimum set of propositions that must be true before execution
*/
public List<Proposition> getPlanPreconditions(List<String> plan, DomainDescription description) {
// XXX This variable has been placed here to give us a slight speed up and to ease debug
// XXX But this might not be a good idea if we try and change the singleton at runtime
OperatorFactory operatorFactory = OperatorFactory.getInstance();
for(Iterator<Operator> iter = description.getOperators().iterator(); iter.hasNext(); ) {
try {
//OperatorFactory.getInstance().addOperatorTemplate(iter.next());
operatorFactory.addOperatorTemplate(iter.next());
} catch (OperatorFactoryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Operator concreteOperators[] = new Operator[plan.size()];
//First, get operator instances corresponing to the operator invocations
//in the parameter
for (int i = 0; i < concreteOperators.length; i++) {
try {
//concreteOperators[i] = OperatorFactory.getInstance().getOperator(plan.get(i));
concreteOperators[i] = operatorFactory.getOperator(plan.get(i));
} catch (OperatorFactoryException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}