Package heart

Examples of heart.StateElement


          state.setName(stateElement.getAttribute(NAME));
        }
       
        //Get a list of state elements frm this element
        NodeList stateElements = stateElement.getChildNodes();
        StateElement stateElementObject = null;
        for(int se = 0; se < stateElements.getLength(); se++){
          Node finalStateNode  = stateElements.item(se);
          if (finalStateNode.getNodeType() == Node.ELEMENT_NODE) {
            Element finalStateElement = (Element) finalStateNode;
            if(finalStateElement.getNodeName().equals(ATTREF)){
              stateElementObject = new StateElement();
              String attrId = finalStateElement.getAttribute(REF);
              attr = model.getAttributeById(attrId);
              stateElementObject.setAttributeName(attr.getName());
            }else if(finalStateElement.getNodeName().equals(SET)){
              Type corresponginType = attr.getType();
              ArrayList<Value> values = parseValues(finalStateElement, corresponginType.getBase());
              if(values.size() > 1){
                stateElementObject.setValue(new SetValue(values));
              }else{
                stateElementObject.setValue(values.get(0));
              }
              state.addStateElement(stateElementObject);
            }
          }
        }
View Full Code Here


     
     
    }
   
   
    StateElement weatherE = new StateElement();
      StateElement activityE = new StateElement();
      StateElement userProfileE = new StateElement();
     
      weatherE.setAttributeName("weather");
      Value rainy = new SimpleSymbolic("rainy", null, 0.6f);
      weatherE.setValue(rainy);
     
      userProfileE.setAttributeName("user_profile");
      SetValue profile = new SetValue();
      Value[] prifleElements  = {
          new SimpleSymbolic("eating",null,0.6f),
          new SimpleSymbolic("culture",null,0.2f),
          new SimpleSymbolic("entertainment", null, 0.8f),
          new SimpleSymbolic("sightseeing",null,0.2f)
          };
      profile.setValues(Arrays.asList(prifleElements));
      userProfileE.setValue(profile);
     
      activityE.setAttributeName("activity");
      SimpleSymbolic walking = new SimpleSymbolic("walking",null,0.8f);
      activityE.setValue(walking);
     
View Full Code Here

         
         
        }
       
       
        StateElement hourE = new StateElement();
          StateElement dayE = new StateElement();
          StateElement locationE = new StateElement();
          StateElement activityE = new StateElement();
         
          hourE.setAttributeName("hour");
          hourE.setValue(new SimpleNumeric(16d));
         
          dayE.setAttributeName("day");
          dayE.setValue(new SimpleSymbolic("mon",1));
         
          locationE.setAttributeName("location");
          locationE.setValue(new SimpleSymbolic("work"));
         
          activityE.setAttributeName("activity");
          activityE.setValue(new SimpleSymbolic("walking"));
         
         
          State XTTstate = new State();
          XTTstate.addStateElement(hourE);
          XTTstate.addStateElement(dayE);
View Full Code Here

TOP

Related Classes of heart.StateElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.