/** * Build a function extractor for a function call. * @param fc The function call. * @return The function call. */ public IValueExtractor buildFunctionExtractor(int tupleindex, FunctionCall fc, int subindex, BuildContext context) { List pcs = fc.getParameterSources(); IValueExtractor[] fex = new IValueExtractor[pcs.size()]; for(int i=0; i<pcs.size(); i++) { Object tmp = pcs.get(i); fex[i] = createValueExtractor(tupleindex, tmp, subindex, context, false); // if(tmp instanceof Variable) // { // fex[i] = buildVariableExtractor((Variable)tmp, context); // } // else if(tmp instanceof FunctionCall) // { // fex[i] = buildFunctionExtractor((FunctionCall)tmp, context); // } // else // { // fex[i] = new ConstantExtractor(tmp); // } } return new FunctionExtractor(fc.getFunction(), fex); }
/** * Get the variables. * @return The declared variables. */ public List getVariables() { return funcall.getVariables(); }
if(rcapcon==null) throw new RuntimeException("Capability condition required to build IBelief constraint."); ret = new Object[]{OAVBDIRuntimeModel.belief_type, new FunctionCall(new IFunction() if(rcapcon==null) throw new RuntimeException("Capability condition required to build IBeliefSet constraint."); ret = new Object[]{OAVBDIRuntimeModel.beliefset_type, new FunctionCall(new IFunction() if(rcapcon==null) throw new RuntimeException("Capability condition required to build IPlan constraint."); ret = new Object[]{OAVBDIRuntimeModel.plan_type, new FunctionCall(new IFunction() if(rcapcon==null) throw new RuntimeException("Capability condition required to build IMessageEvent constraint."); ret = new Object[]{OAVBDIRuntimeModel.messageevent_type, new FunctionCall(new IFunction() if(rcapcon==null) throw new RuntimeException("Capability condition required to build IInternalEvent constraint."); ret = new Object[]{OAVBDIRuntimeModel.internalevent_type, new FunctionCall(new IFunction() if(rcapcon==null) throw new RuntimeException("Capability condition required to build IGoal constraint."); ret = new Object[]{OAVBDIRuntimeModel.goal_type, new FunctionCall(new IFunction()
argtypes[i] = funcall.getFunction().getReturnType();
fc = new FunctionCall(func, exps);
argtypes[i] = funcall.getFunction().getReturnType();
fc = new FunctionCall(func, exps);
/** * Build a function extractor for a function call. * @param fc The function call. * @return The function call. */ public IValueExtractor buildFunctionExtractor(int tupleindex, FunctionCall fc, int subindex, BuildContext context) { List pcs = fc.getParameterSources(); IValueExtractor[] fex = new IValueExtractor[pcs.size()]; for(int i=0; i<pcs.size(); i++) { Object tmp = pcs.get(i); fex[i] = createValueExtractor(tupleindex, tmp, subindex, context, false); // if(tmp instanceof Variable) // { // fex[i] = buildVariableExtractor((Variable)tmp, context); // } // else if(tmp instanceof FunctionCall) // { // fex[i] = buildFunctionExtractor((FunctionCall)tmp, context); // } // else // { // fex[i] = new ConstantExtractor(tmp); // } } return new FunctionExtractor(fc.getFunction(), fex); }
/** * Get the variables. * @return The declared variables. */ public List getVariables() { return funcall.getVariables(); }
ret = tmodel.getJavaType(((FunctionCall)valuesource).getFunction().getReturnType());
TestCondition testcon = new TestCondition(new PredicateConstraint(new FunctionCall( new OperatorFunction(op), new Object[]{((VariableExpression)left).getVariable(), rightsource})));
if(func.getFunction() instanceof OperatorFunction && ((OperatorFunction)func.getFunction()).getOperator().equals(IOperator.EQUAL)) List ps = func.getParameterSources(); if(ps.get(0) instanceof Variable)
/** * Get the variables. * @return The declared variables. */ public List getVariables() { return funcall.getVariables(); }
ret = tmodel.getJavaType(((FunctionCall)valuesource).getFunction().getReturnType());
TestCondition testcon = new TestCondition(new PredicateConstraint(new FunctionCall( new OperatorFunction(op), new Object[]{((VariableExpression)left).getVariable(), rightsource})));
if(func.getFunction() instanceof OperatorFunction && ((OperatorFunction)func.getFunction()).getOperator().equals(IOperator.EQUAL)) List ps = func.getParameterSources(); if(ps.get(0) instanceof Variable)
/** * Get the variables. * @return The declared variables. */ public List getVariables() { return funcall.getVariables(); }
/** * * @param tmodel * @param valuesource * @return */ protected static OAVObjectType getValueSourceType(OAVTypeModel tmodel, Object valuesource) { OAVObjectType ret = null; if(valuesource instanceof OAVAttributeType) { ret = ((OAVAttributeType)valuesource).getType(); } else if(valuesource instanceof MethodCall) { Class rettype = ((MethodCall)valuesource).getMethod().getReturnType(); if(rettype!=null) ret = tmodel.getJavaType(rettype); } else if(valuesource instanceof FunctionCall) { Class rettype = ((FunctionCall)valuesource).getFunction().getReturnType(); if(rettype!=null) ret = tmodel.getJavaType(rettype); } return ret; }
ret = new Variable(name, state.getTypeModel().getJavaType(clazz), false, true); Variable belvar = new Variable(name+"_bel", OAVBDIRuntimeModel.beliefset_type, false, true); Object valuesource = new FunctionCall(new SetToArray(clazz), new Object[]{OAVBDIRuntimeModel.beliefset_has_facts}); context.createObjectCondition(OAVBDIRuntimeModel.beliefset_type, new IConstraint[]{ new LiteralConstraint(OAVBDIRuntimeModel.element_has_model, mbel), new BoundConstraint(null, belcapvar), new BoundConstraint(OAVBDIRuntimeModel.capability_has_beliefs, belvar, IOperator.CONTAINS), new LiteralReturnValueConstraint(Boolean.TRUE, new FunctionCall(new ResolvesTo(), new Object[]{capvar, new Constant(ref), belvar, belcapvar}))}); ret = new Variable(name, state.getTypeModel().getJavaType(clazz), false, true); Variable belvar = new Variable(name+"_bel", OAVBDIRuntimeModel.beliefset_type, false, true); Object valuesource = new FunctionCall(new SetToArray(clazz), new Object[]{OAVBDIRuntimeModel.beliefset_has_facts}); context.createObjectCondition(OAVBDIRuntimeModel.beliefset_type, new IConstraint[]{ new LiteralConstraint(OAVBDIRuntimeModel.element_has_model, mbel), new BoundConstraint(null, belcapvar), new BoundConstraint(OAVBDIRuntimeModel.capability_has_beliefsets, belvar, IOperator.CONTAINS), new LiteralReturnValueConstraint(Boolean.TRUE, new FunctionCall(new ResolvesTo(), new Object[]{capvar, new Constant(ref), belvar, belcapvar}))}); ret = new Variable(name, state.getTypeModel().getJavaType(clazz), false, true); Variable parvar = new Variable(context.generateVariableName(), OAVBDIRuntimeModel.parameterset_type, true, true); Object valuesource = new FunctionCall(new SetToArray(clazz), new Object[]{OAVBDIRuntimeModel.parameterset_has_values}); context.createObjectCondition(OAVBDIRuntimeModel.parameterset_type, new IConstraint[]{ new LiteralConstraint(OAVBDIRuntimeModel.parameterset_has_name, parname), ret = new Variable(name, state.getTypeModel().getJavaType(clazz), false, true); Variable parvar = new Variable(context.generateVariableName(), OAVBDIRuntimeModel.parameterset_type, true, true); Object valuesource = new FunctionCall(new SetToArray(clazz), new Object[]{OAVBDIRuntimeModel.parameterset_has_values});
if(func.getFunction() instanceof OperatorFunction && ((OperatorFunction)func.getFunction()).getOperator().equals(IOperator.EQUAL)) List ps = func.getParameterSources(); if(ps.get(0) instanceof Variable)