Examples of UbfIO


Examples of unbbayes.io.mebn.UbfIO

        TextModeRunner textModeRunner = new TextModeRunner();
       
        // load ubf/owl
       
        File mebnFile = new File("resources/mebn/prognos.ubf");
        UbfIO ubf = UbfIO.getInstance();
        MultiEntityBayesianNetwork mebn = ubf.loadMebn(mebnFile);
 
       
        // initialize kb
       
        KnowledgeBase knowledgeBase = PowerLoomKB.getNewInstanceKB();
View Full Code Here

Examples of unbbayes.io.mebn.UbfIO

   * @throws IOMebnException the iO mebn exception
   * @throws IOException Signals that an I/O exception has occurred.
   */
  private void loadMebn() throws IOMebnException, IOException {
    File mebnFile = null;
    UbfIO ubf = null;
     
    if (this.isContinuousCase()) {
      // continuous MEBN case
      // the old file is uc3-v7-with-ContinuousNode.ubf. Revert to it in case you need.
      try {
        mebnFile = new File(getClass()
            .getResource("/mebn/uc3-v10-withContinuousNode_MEBN_1.ubf").getFile());
      } catch (NullPointerException e) {
        // try other places
      }
      if (mebnFile == null || !mebnFile.exists()) {
        mebnFile = new File("/mebn/uc3-v10-withContinuousNode_MEBN_1.ubf");
      }
      if (mebnFile == null || !mebnFile.exists()) {
        mebnFile = new File("mebn/uc3-v10-withContinuousNode_MEBN_1.ubf");
      }
      ubf = ContinuousUBFIO.getInstance();
    } else {
      // discrete MEBN case
      // the old file is uc3-v7.ubf. Revert to it in case you need.
      try {
        mebnFile = new File(getClass()
            .getResource("/mebn/uc3-v10-MEBN_1.ubf").getFile());
      } catch (Exception e) {
        // try other places
      }
      if (mebnFile == null || !mebnFile.exists()) {
        mebnFile = new File("/mebn/uc3-v10-MEBN_1.ubf");
      }
      if (mebnFile == null || !mebnFile.exists()) {
        mebnFile = new File("mebn/uc3-v10-MEBN_1.ubf");
      }
      ubf = UbfIO.getInstance();
    }
    System.out.println("[" + new Date() + "] loading file " + mebnFile.getPath());
    mebn = ubf.loadMebn(mebnFile);
   
    try {
      // this method forces hasTerroristCrew to be a chain of nodes instead of a node with too many parents.
      ((ResidentNode) mebn.getNode("hasTerroristCrew")).setToLimitQuantityOfParentsInstances(true);
    } catch (Exception e) {
View Full Code Here

Examples of unbbayes.io.mebn.UbfIO

    if (mebnFile == null || !mebnFile.exists()) {
      System.out.println("File " + mebnFile + " does not exist");
      mebnFile = new File("/mebn/uc3-v7.ubf");
    }
    System.out.println("Opening File = " + mebnFile.getAbsolutePath());
    UbfIO ubf = UbfIO.getInstance();
    mebn = ubf.loadMebn(mebnFile);
  }
View Full Code Here

Examples of unbbayes.io.mebn.UbfIO

  protected void setUp() throws Exception {
    super.setUp();
    Debug.setDebug(false);
   
    UbfIO ubfIO = ContinuousUBFIO.getInstance();
   
    System.out.println("-----Load file test-----");
   
    try{
      mebn = ubfIO.loadMebn(new File("src/test/resources/mebn/VehicleIdentification.ubf"));
      Debug.println("LOAD COMPLETE");
    }
    catch (IOMebnException e){
      e.printStackTrace();
      fail("ERROR IO PROWL!!!!!!!!!");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.