/** * Create a plan instance. */ public IPlan createPlan(MPlan mplan) { return RPlan.createRPlan(mplan, null, null, getAgent(), null, null); }
/** * Get the plan instance. * @return The plan instance. */ public IInternalPlan getPlan() { // if(rplan!=null) // System.out.println("access: "+this); if(rplan==null) rplan = RPlan.createRPlan((MPlan)getModelElement(), this, element, agent, null, null); return rplan; }
/** * Get the plan instance. * @return The plan instance. */ public IInternalPlan getPlan() { // if(rplan!=null) // System.out.println("access"); if(rplan==null) rplan = RPlan.createRPlan((MPlan)getModelElement(), this, element, agent, mplaninfo.getBinding(), null); return rplan; }
public IFuture<Void> execute(IEvent event, IRule<Void> rule, Object context, Object condresult) { RPlan rplan = RPlan.createRPlan(mplan, mplan, new ChangeEvent(event), getInternalAccess()); RPlan.executePlan(rplan, getInternalAccess(), null); return IFuture.DONE; } };
RPlan rplan = RPlan.createRPlan(mplan, cand, element, ia); RPlan.executePlan(rplan, ia, null); ret.setResult(null); RPlan rplan = RPlan.createRPlan(mplan, cand, element, ia); RPlan.executePlan(rplan, ia, null); ret.setResult(null);
/** * Dispatch a goal wait for its result. * @param plan The pojo plan or plan name. * @param args The plan arguments. * @return The plan result. */ public <T, E> IFuture<E> adoptPlan(T plan, Object... args) { final Future<E> ret = new Future<E>(); MPlan mplan = bdimodel.getCapability().getPlan(plan instanceof String? (String)plan: plan.getClass().getName()); if(mplan==null) throw new RuntimeException("Plan model not found for: "+plan); ICandidateInfo ci = plan instanceof String? new CandidateInfoMPlan(new MPlanInfo(mplan, null), null, component): new CandidateInfoPojoPlan(plan, null, component); final RPlan rplan = RPlan.createRPlan(mplan, ci, new ChangeEvent(null, null, args, null), getComponent(), null, null); rplan.addListener(new DelegationResultListener(ret)); RPlan.executePlan(rplan, getComponent()); return ret; }
throw new RuntimeException("Plan model not found for: "+plan); final RPlan rplan = RPlan.createRPlan(mplan, plan, null, ip.getInternalAccess()); rplan.addPlanListener(new IPlanListener<E>()
if(!Modifier.isStatic(m.getModifiers())) RPlan rp = RPlan.createRPlan(mplan, mplan, element, ia); final Object agent = ia instanceof IPojoMicroAgent? ((IPojoMicroAgent)ia).getPojoAgent(): ia; pojo = rp.getBody().getBody(agent);
MPlan mplan = mcapa.getPlan(cand.getClass().getName()); CandidateInfoPojoPlan ci = new CandidateInfoPojoPlan(cand, element, ia); RPlan rplan = RPlan.createRPlan(mplan, ci, element, ia, null, null); ci.rplan = rplan;
if(!Modifier.isStatic(m.getModifiers())) RPlan rp = RPlan.createRPlan(mplan, cand, element, ia, mplaninfo.getBinding(), null); pojo = rp.getBody().getBody();
RPlan rplan = RPlan.createRPlan(mplan, new CandidateInfoMPlan(new MPlanInfo(mplan, binding), null, component), null, component, null, cplan); barrier.addFuture(RPlan.executePlan(rplan, component)); RPlan rplan = RPlan.createRPlan(mplan, new CandidateInfoMPlan(new MPlanInfo(mplan, null), null, component), null, component, null, cplan); barrier.addFuture(RPlan.executePlan(rplan, component));
RPlan rplan = RPlan.createRPlan(mplan, mplan, null, getInternalAccess()); RPlan.executePlan(rplan, getInternalAccess(), null);