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

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


                   "run(DMP);" );
       
        EDB.This().get("ROOT").print("");
        EquationOperator e = new EquationOperator();
       
        EDBUnit r = e.convert( EDB.This().get("ROOT.NODES.X.EQUATION"), "U", "X" );
        r.print("Inv ");
  }
View Full Code Here


   * @return true, if successful
   */
  public boolean hasTreeNode( EDBUnit sTree, String str )
  {   
    //iteration 
    EDBUnit ISA = sTree.getRel("ISA");
    if( ISA != null )
    for( String str1 : ISA.getMap().keySet() ){
      EDBUnit child = ISA.map.get(str1);
     
      if( hasTreeNode( child, str ) )
        return true;
    }  

View Full Code Here

   */
  public void copyTreeToETree( EDBUnit dNode, EDBUnit sTree )
  {
    // dNode.print("dNode ");
    // sTree.print("sTree ");
    EDBUnit n = dNode.createDummy(sTree.getData());
     //n.print("n ");
     //dNode.print("dNode ");
  //  System.out.println(dNode.getRel("ISA").strList.toString());
   
    //iteration 
    EDBUnit ISA = sTree.getRel("ISA");
    if( ISA != null )
    for( String str1 : ISA.getMap().keySet() ){
      EDBUnit child = ISA.map.get(str1);
     
      copyTreeToETree( n, child )
    }   
  }
View Full Code Here

   * @return the string from inverse iteration
   */
  public String getStringFromInvInteration( EDBUnit sTree, String str ){
   
    //iteration 
    EDBUnit ISA = sTree.getRel("ISA");
    if( ISA != null )
    for( String str1 : ISA.getMap().keySet() ){
      EDBUnit child = ISA.map.get(str1);
     
      str += getStringFromInvInteration( child, str )
   
   
    str += sTree.getData();
View Full Code Here

   * @param X the x
   * @param Y the y
   * @return the eDB unit
   */
  public EDBUnit convert( EDBUnit sTree, String X, String Y ){
    EDBUnit r = convert( sTree, X );
    r.resetAllData( X, Y );
       
    return r;
  }
View Full Code Here

   * @param sTree the s tree
   * @param X the x
   * @return the eDB unit
   */
  public EDBUnit convert( EDBUnit sTree, String X ){
    EDBUnit dTree = new EDBUnit();
    dTree.removeAllChildren();
    dTree.setName(X);
    dTree.setData(X);
   
    EDBUnit r = convertOperation( sTree.getOne().getOne(), dTree, X );
       
    return r;
  }
View Full Code Here

   * @return the eDB unit
   */
  public EDBUnit convertOperation( EDBUnit sNode, EDBUnit dNode, String X ){
    String strCurrent = sNode.getData();
    //System.out.println( strCurrent );
    EDBUnit cExcept = null;
    EDBUnit c0 = null;
    EDBUnit c1 = null
   
    //iteration
    int i = 0;
    EDBUnit ISA = sNode.getRel("ISA");
    //ISA.print("sNode ");
    if( ISA != null )
    for( String str1 : ISA.getMap().keySet() ){
      EDBUnit child = ISA.map.get(str1);
     
      if( i == 0 )
        c0 = child;
      else
        c1 = child;
      i++;
   
   
    //for nodes
    //System.out.println( strCurrent );
    String str = getComplementaryOperater(strCurrent);
    //System.out.println( str );
    if( str != null  ){
      dNode = dNode.createParent(str);
      
      if( !hasTreeNode(c0, X) ){
        copyTreeToETree(dNode, c0)
        cExcept = c0;
      }else
      if( !hasTreeNode(c1, X) ){
        copyTreeToETree(dNode, c1);
        cExcept = c1;
     
      //dNode.print("dNode ");
    }else{
      return dNode;
    }
         
    //iteration
    i = 0;
    ISA = sNode.getRel("ISA");
    if( ISA != null )
    for( String str1 : ISA.getMap().keySet() ){
      EDBUnit child = ISA.map.get(str1);
     
      //child.print("Child ");
      //cExcept.print("cExcept ");
     
      //if( !cExcept.getData().equalsIgnoreCase(child.getData()) ){
      if( !cExcept.isSameData(child) ){
        EDBUnit r = convertOperation( child, dNode, X );
        if( r != null )
          return r;
      }
    }     
    
View Full Code Here

   * @param curDNCombination the discrete node combination
   * @param listDiscreteNodeCombination the list discrete node combination
   */
  public void convertFromCPTToCombinationList(EDBUnit cpt, DiscreteNodesCombination curDNCombination, ArrayList<DiscreteNodesCombination> listDiscreteNodeCombination){
    //iteration  
    EDBUnit ISA = cpt.getRel("ISA");
    if( ISA != null ){
      for( String str : ISA.getMap().keySet() ){
        EDBUnit child = ISA.map.get(str);
        DiscreteNodesCombination childDNCombination = new DiscreteNodesCombination();
        if( curDNCombination != null )
          childDNCombination.copy(curDNCombination);
        childDNCombination.mapValuesForAssingnment.put(child.getData(), str);
        convertFromCPTToCombinationList(child, childDNCombination, listDiscreteNodeCombination)
      }
    }else{
      if( curDNCombination != null )
        listDiscreteNodeCombination.add(curDNCombination);
View Full Code Here

    if( strCurrent.equals("SLIST") ){
       if( newListCombination == null || newListCombination.isEmpty() ){  // in "p(x) = {A:0.4; B:0.6;}" this case, there is SLIST, but there is no IFSTATE.
         return;
      }
        
      EDBUnit ISA = eq.getRel("ISA");
      EDBUnit eqTemp = eq;
      if( ISA.getMap().size() == )
        eqTemp = eq.get();
     
      if( strParent.equals("EXP") ){
        for( DiscreteNodesCombination ds : newListCombination ){
          ds.setEquation(eqTemp);
        }
      }else
      if( strParent.equals("if") ){
        for( DiscreteNodesCombination ds : oriListCombination ){
          if( !ds.EQ.hasChildren() )
            ds.setEquation(eqTemp);
        }
      }
    }
    
    //iteration  
    EDBUnit ISA = eq.getRel("ISA");
    if( ISA != null )
    for( String str : ISA.getMap().keySet() ){
      EDBUnit childEq = ISA.map.get(str);
      get_DiscreteNode_combination2(oriListCombination, childEq)
   
  } 
View Full Code Here

   *
   * @param t2 the e unit
   * @return true, if successful
   */
  public boolean IsCPTEUnit(EDBUnit t2){
    EDBUnit t1 = EDB.This().get("ROOT.NODES."+strCurrentNode+".CPT");
   
    if( t1 == t2 ) return true;
   
    return false;
  }
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.