/** * Get the string representation. * @return The string representation. */ public String toString() { String name = (String)state.getAttributeValue(handle, OAVBDIMetaModel.modelelement_has_name); return "OAVCapabilityModel("+name+")"; }
/** * */ public static boolean containsFact(IOAVState state, Object handle, Object fact) { // Convert wrapped basic values to desired class (e.g. Integer to Long). Object mbel = state.getAttributeValue(handle, OAVBDIRuntimeModel.element_has_model); Class clazz = (Class)state.getAttributeValue(mbel, OAVBDIMetaModel.typedelement_has_class); Object newfact = SReflect.convertWrappedValue(fact, clazz); Collection coll = state.getAttributeValues(handle, OAVBDIRuntimeModel.beliefset_has_facts); return coll!=null && coll.contains(newfact); }
/** * */ public static boolean isFinished(IOAVState state, Object handle) { String st = (String)state.getAttributeValue(handle, OAVBDIRuntimeModel.goal_has_lifecyclestate); return OAVBDIRuntimeModel.GOALLIFECYCLESTATE_DROPPED.equals(st); }
/** * Get the parameter set element. * @param name The name. * @return The param set. */ public static Object getParameterSet(IOAVState state, Object scope, Object handle, final String name) { Object paramset = state.getAttributeValue(handle, OAVBDIRuntimeModel.parameterelement_has_parametersets, name); return ParameterSetFlyweight.getParameterSetFlyweight(state, scope, paramset, name, handle); }
/** * Get the dispatched element, i.e. the element that caused * the current plan step being executed. * @return The dispatched element. */ public IElement getDispatchedElement() { Object elem = state.getAttributeValue(rplan, OAVBDIRuntimeModel.plan_has_dispatchedelement); return getFlyweight(elem); }
public void run() { bool = ((Boolean)getState().getAttributeValue(getHandle(), OAVBDIMetaModel.capability_has_abstract)).booleanValue(); } };
public void run() { bool = ((Boolean)getState().getAttributeValue(getHandle(), OAVBDIMetaModel.beliefset_has_argument)).booleanValue(); } };
public void run() { bool = ((Boolean)getState().getAttributeValue(getHandle(), OAVBDIMetaModel.beliefset_has_result)).booleanValue(); } };
public void run() { getState().getAttributeValue(getHandle(), OAVBDIMetaModel.processableelement_has_posttoall, posttoall? Boolean.TRUE: Boolean.FALSE); } };
public void run() { string = (String)getState().getAttributeValue(getHandle(), OAVBDIMetaModel.referenceableelement_has_exported); } };
/** * * @param state * @param handle * @param interpreter */ public static void modified(IOAVState state, Object handle, BDIInterpreter interpreter) { Object fact = state.getAttributeValue(handle, OAVBDIRuntimeModel.belief_has_fact); interpreter.getEventReificator().objectModified(handle, state.getType(handle), OAVBDIRuntimeModel.belief_has_fact, fact, fact); }
public void run() { Object handle = getState().getAttributeValue(getScope(), OAVBDIMetaModel.capability_has_expressions, name); if(handle==null) throw new RuntimeException("Expression not found: "+name); object = new MExpressionFlyweight(getState(), getScope(), handle); } };
public void run() { Object handle = getState().getAttributeValue(getScope(), OAVBDIMetaModel.capability_has_beliefrefs, name); if(handle==null) throw new RuntimeException("Belief reference not found: "+name); object = new MBeliefReferenceFlyweight(getState(), getScope(), handle); } };
public void run() { Object handle = getState().getAttributeValue(getScope(), OAVBDIMetaModel.capability_has_messageevents, name); if(handle==null) throw new RuntimeException("Event not found: "+name); object = new MInternalEventFlyweight(getState(), getScope(), handle); } };
public void run() { Object handle = getState().getAttributeValue(getScope(), OAVBDIMetaModel.capability_has_internaleventrefs, name); if(handle==null) throw new RuntimeException("InternalEvent reference not found: "+name); object = new MInternalEventReferenceFlyweight(getState(), getScope(), handle); } };
public void run() { Object handle = getState().getAttributeValue(getHandle(), OAVBDIMetaModel.goal_has_dropcondition); if(handle!=null) object = new MConditionFlyweight(getState(), getScope(), handle); } };
public void run() { Object handle = getState().getAttributeValue(getHandle(), OAVBDIMetaModel.goal_has_recurcondition); if(handle!=null) object = new MConditionFlyweight(getState(), getScope(), handle); } };
public void run() { Object handle = getState().getAttributeValue(getHandle(), OAVBDIMetaModel.parameter_has_bindingoptions); if(handle!=null) object = new MExpressionFlyweight(getState(), getScope(), handle); } };
public void run() { Object handle = getState().getAttributeValue(getHandle(), OAVBDIMetaModel.plan_has_precondition); if(handle!=null) object = new MExpressionFlyweight(getState(), getScope(), handle); } };
public void run() { Object handle = getState().getAttributeValue(getHandle(), OAVBDIMetaModel.plan_has_precondition); if(handle!=null) object = new MConditionFlyweight(getState(), getScope(), handle); } };