/** * Get the eventbase. * @return The eventbase */ public REventbase getEventbase() { if(eventbase==null) { eventbase = new REventbase(getAgent(), null); } return eventbase; }
/** * Create a new message event. * @return The new message event. */ public IMessageEvent createMessageEvent(String type) { MMessageEvent mevent = getCapability().getMCapability().getResolvedMessageEvent(scope, type); return new RMessageEvent(mevent, getAgent(), null); }
/** * Dispatch an event. * @param event The event. */ public void dispatchInternalEvent(IInternalEvent event) { FindApplicableCandidatesAction fac = new FindApplicableCandidatesAction((RProcessableElement)event); getAgent().getComponentFeature(IExecutionFeature.class).scheduleStep(fac); }
/** * Send a message after some delay. * @param me The message event. * @return The filter to wait for an answer. */ public IFuture<Void> sendMessage(IMessageEvent me) { return getAgent().getComponentFeature(IMessageFeature.class).sendMessage((Map<String, Object>)me.getMessage(), me.getMessageType()); }
/** * Create a new intenal event. * @return The new intenal event. */ public IInternalEvent createInternalEvent(String type) { MInternalEvent mevent = getCapability().getMCapability().getResolvedInternalEvent(scope, type); return new RInternalEvent(mevent, getAgent(), null); }
/** * Get the event base. * @return The event base. */ public IEventbase getEventbase() { return scope!=null ? new REventbase(agent, scope) : capa.getEventbase(); }
/** * Create a reply to a message event. * @param event The received message event. * @param type The reply message event type. * @return The reply event. */ public IMessageEvent createReply(IMessageEvent event, String type) { if(event==null) throw new IllegalArgumentException("Event must not null"); MMessageEvent mevent = getCapability().getMCapability().getResolvedMessageEvent(scope, type); Map<String, Object> rep = event.getMessageType().createReply((Map<String, Object>)event.getMessage()); return new RMessageEvent(mevent, rep, SFipa.FIPA_MESSAGE_TYPE, getAgent()); }
fetcher.setValue("$goalbase", new RGoalbase(agent, scope)); fetcher.setValue("$planbase", new PlanbaseWrapper(capa.getPlanbase(), prefix)); fetcher.setValue("$eventbase", new REventbase(agent, scope)); fetcher.setValue("$expressionbase", new ExpressionbaseWrapper(capa.getExpressionbase(), prefix)); if(values!=null)