Package edu.gmu.seor.prognos.unbbayesplugin.cps.datastructure

Examples of edu.gmu.seor.prognos.unbbayesplugin.cps.datastructure.EDBUnit


   *
   * @param str the name
   * @return the eDB unit
   */
  public EDBUnit createNODE(String str){
    EDBUnit nodes   = EDB.This().get("ROOT.NODES");
    EDBUnit node   = nodes.create(str);
    EDBUnit info   = node.create("INFO");
    node.create("STATES_MEAN");
    node.create("STATES");
    node.create("PARENTS");
    node.create("CHILDREN");
    node.create("CPT");
    node.create("SCRIPT");
    node.create("EQUATION");
    node.create("OLD_BEL");
    node.create("BEL");  
    info.create("KIND");
    info.create("DESCRIPTION");
    info.create("TYPE")
    info.create("SEARCH_FLAG");
    return node;
  }
View Full Code Here


   * @param s the state
   * @param v the value
   * @return the eDB unit
   */
  public EDBUnit createSTATE(EDBUnit p, String s, String v){
    EDBUnit states   = p.get("STATES");
    EDBUnit st      = states.createNext(s);
    st.setData(v);
   
    //for the continuous states, we need to have mean number of the bin
    EDBUnit type   = p.get("INFO.TYPE");
    if( type.getData().equalsIgnoreCase("Continuous") ){
      EDBUnit statesMean   = p.get("STATES_MEAN");
      EDBUnit stMeanLast   = statesMean.getLastNext();
      EDBUnit stMean      = statesMean.createNext(s);
      stMean.setData(v);
     
      if( stMeanLast.getName().equalsIgnoreCase("NINF") ){
        dExtreamNINF = Double.valueOf(stMean.getName());
      }
     
      if( stMean.getName().equalsIgnoreCase("PINF") ){
        dExtreamPINF = Double.valueOf(stMeanLast.getName());
      }     
    }
   
    return st;
View Full Code Here

   * Delete all states.
   *
   * @param p the e unit
   */
  public void deletAllSTATES(EDBUnit p){
    EDBUnit states   = p.get("STATES");
    states.removeAllChildren();
  }
View Full Code Here

 
  /**
   * Removes the all evidences.
   */
  public void removeAllEvidences(){
    EDBUnit nodes = EDB.This().get("ROOT.NODES");
    EDBUnit ISA = nodes.getRel("ISA");
   
    for( String str : ISA.getMap().keySet() ){
      EDBUnit node = ISA.map.get(str)
      EDBUnit evidence = node.get("EVIDENCE");
      if( evidence != null )
        evidence.removeAllChildren();
    }
  }
View Full Code Here

   * @param p the e unit
   * @param s the name
   * @return the eDB unit
   */
  public EDBUnit createPARENT(EDBUnit p, String s){
    EDBUnit parents   = p.get("PARENTS");
    EDBUnit newParent  = parents.getNext(s);

    if( newParent != null )
      return newParent;
       
    newParent = parents.createNext(s);
   
    EDBUnit parent  = EDB.This().get("ROOT.NODES." + s);
    if( parent != null ){
      EDBUnit children = parent.get("CHILDREN");
     
      //if there is not same value
      EDBUnit c = children.getNext(p.getName());
      if( c == null )
        children.createNext(p.getName());
    }
   
    return newParent;
View Full Code Here

  public EDBUnit createParentStateOnCPT(EDBUnit CPT, EDBUnit nextNode){
    if( nextNode == null )
      return null;
   
    String str = nextNode.getName();
    EDBUnit parentState = EDB.This().get("ROOT.NODES."+str+".STATES");
    EDBUnit parentType = EDB.This().get("ROOT.NODES."+str+".INFO.TYPE");
    createSTATEonCPT(CPT, parentState.getNext(), str, parentType.getData());
   
    return createParentStateOnCPT(CPT, nextNode.getNext());
  }
View Full Code Here

    if( strParentType.equalsIgnoreCase("Continuous") && nextNode.getNext() == null ){
      return null;
    }
   
    EDBUnit newLast = lastCPT.create(nextNode.getName());   
    //add parent name on state of child
    newLast.setData(strData);
   
    return FindNextParentState(lastCPT, nextNode.getNext(), strData, strParentType);
  }
View Full Code Here

   * @param strParentName the parent name
   * @param strParentType the parent type
   */
  public void createSTATEonCPT(EDBUnit lastCPT, EDBUnit pStates, String strParentName, String strParentType){ 
    //finding last row of CPT                EX) ROOT.NODES.Child.CPT.5
    EDBUnit lastCPTISA = lastCPT.getRel("ISA");
    if(lastCPTISA != null && lastCPTISA.map.size() != 0 ){
      for( String str : lastCPTISA.map.keySet() ){
        EDBUnit t = lastCPTISA.map.get(str);
        createSTATEonCPT(t, pStates, strParentName, strParentType);
      }
    }
    else{//this is the last row
      FindNextParentState(lastCPT, pStates, strParentName, strParentType);
View Full Code Here

   * @param lastCPT the last cpt
   * @param curNode the cur node
   */
  public void createCurrentStatesOnLastOfCPT(EDBUnit lastCPT, EDBUnit curNode){ 
    //finding last row of CPT            EX) ROOT.NODES.Child.CPT.5.[DATA]:Number.high.[DATA]:Height.
    EDBUnit lastCPTISA = lastCPT.getRel("ISA");
     if(lastCPTISA != null && lastCPTISA.map.size() != 0 ){
      for( String str : lastCPTISA.map.keySet() ){
        EDBUnit t = lastCPTISA.map.get(str);
        createCurrentStatesOnLastOfCPT(t, curNode);
      }
    }
    else
    {   
      EDBUnit states = curNode.get("STATES");
      CreateNextState(lastCPT, states.getNext(), "0.0");
   
  }
View Full Code Here

  public EDBUnit CreateNextState(EDBUnit lastCPT, EDBUnit nextNode, String strData){
    if( nextNode == null )
      return null;
    //lastCPT.print("lastCPT: ");
    EDBUnit newLast = lastCPT.createNext(nextNode.getName());   
    //add parent name on state of child
    newLast.setData(strData);
   
    return CreateNextState(lastCPT, nextNode.getNext(), strData);
  }
View Full Code Here

TOP

Related Classes of edu.gmu.seor.prognos.unbbayesplugin.cps.datastructure.EDBUnit

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.