params[j] = new Constant(val); paramtypes[j] = val!=null ? val.getClass() : null;
Constant c = new Constant(((LiteralExpression)prim).getValue()); valuesource = new FunctionCall(new Identity(), new Object[]{c}); if(c.getValue()!=null) type = context.getTypeModel().getJavaType(c.getValue().getClass()); else type = OAVJavaType.java_object_type; paramsources.add(0, new Constant(null)); // first param is object to be invoked (use null for static method). valuesource = new FunctionCall(new MethodCallFunction(mc.getMethod()), paramsources); type = context.getTypeModel().getJavaType(mc.getMethod().getReturnType()); indexsource = new Constant(((LiteralExpression)index).getValue()); right = new Constant(((LiteralExpression)right).getValue()); Constant c = new Constant(((LiteralExpression)value).getValue()); valuesource = new FunctionCall(new Identity(), new Object[]{c}); context.pushCondition(context.getDummyCondition()); first = new Constant(((LiteralExpression)first).getValue()); second = new Constant(((LiteralExpression)second).getValue()); paramsources.add(0, new Constant(null)); // first param is object to be invoked (use null for static method). valuesource = new FunctionCall(new MethodCallFunction(mc.getMethod()), paramsources);
params[j] = new Constant(val); paramtypes[j] = val!=null ? val.getClass() : null;
Constant c = new Constant(((LiteralExpression)prim).getValue()); valuesource = new FunctionCall(new Identity(), new Object[]{c}); if(c.getValue()!=null) type = context.getTypeModel().getJavaType(c.getValue().getClass()); else type = OAVJavaType.java_object_type; paramsources.add(0, new Constant(null)); // first param is object to be invoked (use null for static method). valuesource = new FunctionCall(new MethodCallFunction(mc.getMethod()), paramsources); type = context.getTypeModel().getJavaType(mc.getMethod().getReturnType()); indexsource = new Constant(((LiteralExpression)index).getValue()); right = new Constant(((LiteralExpression)right).getValue()); Constant c = new Constant(((LiteralExpression)value).getValue()); valuesource = new FunctionCall(new Identity(), new Object[]{c}); context.pushCondition(context.getDummyCondition()); first = new Constant(((LiteralExpression)first).getValue()); second = new Constant(((LiteralExpression)second).getValue()); paramsources.add(0, new Constant(null)); // first param is object to be invoked (use null for static method). valuesource = new FunctionCall(new MethodCallFunction(mc.getMethod()), paramsources);
/** * Create the plan creation rule. * @param usercond The ADF part of the target condition. * @param mplan The plan model element. */ public static Object[] createPlanCreationUserRule(Object mplan) { Variable ragent = new Variable("?ragent", OAVBDIRuntimeModel.agent_type); Variable mplanvar = new Variable("?mplan", OAVBDIMetaModel.plan_type); Variable rcapa = new Variable("?rcapa", OAVBDIRuntimeModel.capability_type); ObjectCondition ragentcon = new ObjectCondition(OAVBDIRuntimeModel.agent_type); ragentcon.addConstraint(new BoundConstraint(null, ragent)); ragentcon.addConstraint(new LiteralConstraint(OAVBDIRuntimeModel.agent_has_state, OAVBDIRuntimeModel.AGENTLIFECYCLESTATE_ALIVE)); ObjectCondition rcapacon = new ObjectCondition(OAVBDIRuntimeModel.capability_type); rcapacon.addConstraint(new BoundConstraint(null, rcapa)); rcapacon.addConstraint(new LiteralConstraint(new OAVAttributeType[]{OAVBDIRuntimeModel.element_has_model, OAVBDIMetaModel.capability_has_plans}, mplan, IOperator.CONTAINS)); // Hack??? How to pass mplan to action!? rcapacon.addConstraint(new BoundConstraint(new Constant(mplan), mplanvar)); return new Object[]{ new AndCondition(new ICondition[]{ragentcon, rcapacon}), PLAN_CREATION}; }
state._fsp--; val = new Constant(tmp1);
state._fsp--; val = new Constant(tmp1);
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}))}); 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}))});
if(MethodCallFunction.class.equals(clazz)) String clazzname = (String)((Constant)exps.remove(0)).getValue(); String methodname = (String)((Constant)exps.remove(0)).getValue(); clazz = SReflect.findClass0(clazzname, imports, tmodel.getClassLoader()); Method[] methods = SReflect.getMethods(clazz, methodname);
capcon.addConstraint(new BoundConstraint(null, rcapa)); capcon.addConstraint(new BoundConstraint(OAVBDIRuntimeModel.capability_has_goals, rgoal, IOperator.CONTAINS)); capcon.addConstraint(new LiteralReturnValueConstraint(Boolean.TRUE, new FunctionCall(new ResolvesTo(), new Object[]{rcapa, new Constant(ref), refgoal, refcapa})));
if(MethodCallFunction.class.equals(clazz)) String clazzname = (String)((Constant)exps.remove(0)).getValue(); String methodname = (String)((Constant)exps.remove(0)).getValue(); clazz = SReflect.findClass0(clazzname, imports, tmodel.getClassLoader()); Method[] methods = SReflect.getMethods(clazz, methodname);
capcon.addConstraint(new BoundConstraint(null, rcapa)); capcon.addConstraint(new BoundConstraint(OAVBDIRuntimeModel.capability_has_goals, rgoal, IOperator.CONTAINS)); capcon.addConstraint(new LiteralReturnValueConstraint(Boolean.TRUE, new FunctionCall(new ResolvesTo(), new Object[]{rcapa, new Constant(ref), refgoal, refcapa})));
ret = new ConstantExtractor(((Constant)valuesource).getValue());
right = new Constant(((LiteralExpression)right).getValue());
ret = new ConstantExtractor(((Constant)valuesource).getValue());
? new Constant(((LiteralExpression)right).getValue()) : ((VariableExpression)right).getVariable();