Package edu.gmu.seor.prognos.unbbayesplugin.jt.prs.bn

Examples of edu.gmu.seor.prognos.unbbayesplugin.jt.prs.bn.ProbabilisticNetwork


   * saving it in a file and loading again as another network.
   * @param network
   * @return
   */
  protected ProbabilisticNetwork clonePN(ProbabilisticNetwork network) {
    ProbabilisticNetwork clone = null;
   
  /*  XMLBIFIO io = new XMLBIFIO();
    try {
      // TODO ROMMEL - change this name to a default one but that will not cause concurrent problems.
      File file = new File("clone.xml");
View Full Code Here


   
    createEdgeOfUDB( rede, node, nextParent.getNext() );
  }
 
  public void run(String strArg){
    ProbabilisticNetwork rede = new ProbabilisticNetwork("Network Name");
  
  /*  ArrayList<String> tempList = new ArrayList<String>();
   
    tempList.add("C");
    tempList.add("B");
    tempList.add("A");
    tempList.add("Z");
    tempList.add("W");
    tempList.add("Y");
    tempList.add("X");
    tempList.add("U");
   
    EDBUnit nodes = EDB.This().get("ROOT.NODES");
    EDBUnit ISA = nodes.getRel("ISA");
    for( String str : tempList ){
      EDBUnit node = ISA.map.get(str);
      createUDBfromSDB( rede, node );
    }
    */
 
    //step 1. create new uNodes from sNodes
    EDBUnit nodes = EDB.This().get("ROOT.ENGINES.JT.NODES")
    EDBUnit ISA = nodes.getRel("ISA");
    for( String str : ISA.getMap().keySet() ){
      EDBUnit node = ISA.map.get(str);
      createUDBfromSDB( rede, node );
    }
     
    //step 2. create new edges between sNodes 
    for( String str : ISA.getMap().keySet() ){
      EDBUnit node = ISA.map.get(str);
      EDBUnit parents = node.get("PARENTS");
      createEdgeOfUDB( rede, node, parents.getNext() );
    }
   
    //step 3. set states 
    for( String str : ISA.getMap().keySet() ){
      EDBUnit node = ISA.map.get(str);
      EDBUnit type = node.get("INFO.TYPE");
      EDBUnit description = node.get("INFO.DESCRIPTION");
      EDBUnit evidence = node.get("EVIDENCE");
      EDBUnit parents = node.get("PARENTS");
      EDBUnit children = node.get("CHILDREN");
      EDBUnit cpt = node.getCopied("CPT");
      EDBUnit eq = node.getCopied("EQUATION");
      EDBUnit bel = node.get("BEL");
      setStatesOfUDB( rede, node );
    }
   
    //step 4. set evidences
     for( String str : ISA.getMap().keySet() ){
      EDBUnit node = ISA.map.get(str);
      EDBUnit evidence = node.get("EVIDENCE");
      EDBUnit type = node.get("INFO.TYPE");
      Node uNode = rede.getNode(str);
           
      if( evidence != null ){
        if( type.getData().equalsIgnoreCase("Discrete") ){
          rede.setDescreteEvidence((ProbabilisticNode)uNode, uNode.getState(evidence.getData()));
         
        }else
        if( type.getData().equalsIgnoreCase("Continuous") ){
          rede.setContinuousEvidence((ContinuousNode)uNode, evidence.getDataByDouble());
        }
      } 
     }
    
        try {
      rede.compile();
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
   
    
View Full Code Here

TOP

Related Classes of edu.gmu.seor.prognos.unbbayesplugin.jt.prs.bn.ProbabilisticNetwork

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.