Package edu.gmu.seor.prognos.simulation.integration.util

Examples of edu.gmu.seor.prognos.simulation.integration.util.MebnUtil


      // load kb

      // loadKBFile();

      mebnUtil = new MebnUtil(mebn);

      populateKBManually();

      // query and parameters
      askQuery();
View Full Code Here


    } catch (Exception e) {
      throw new RuntimeException("Failed to load MEBN", e);
    }

    // reload utility
    mebnUtil = new MebnUtil(mebn);
    if (knowledgeBase != null) {
      // set mebnUtil to use the same knowledge base
      mebnUtil.setKnowledgeBase(knowledgeBase);
    }
   
View Full Code Here

        // load kb
       
  //      File kbFile = new File(getClass().getResource("/mebn/prognos.plm").getFile());
  //      knowledgeBase.loadModule(kbFile, true);
       
        MebnUtil mebnUtil = new MebnUtil(mebn);
       
        mebnUtil.removeAllEntityInstances();
       
        ObjectEntity entity = mebn.getObjectEntityContainer().getObjectEntityByName("Ship");
        mebnUtil.createEntityIntance(entity, "ship1");
        mebnUtil.createEntityIntance(entity, "ship2");
        mebnUtil.createEntityIntance(entity, "ship3");
       
        entity = mebn.getObjectEntityContainer().getObjectEntityByName("Person");
        mebnUtil.createEntityIntance(entity, "person1");
       
        entity = mebn.getObjectEntityContainer().getObjectEntityByName("Organization");
        mebnUtil.createEntityIntance(entity, "org1");
       
        ResidentNode residentNode = mebn.getDomainResidentNode("IsWithinRadarRange");
        ObjectEntityInstance[] arguments = new ObjectEntityInstance[2];
        arguments[0] = mebn.getObjectEntityContainer().getEntityInstanceByName("ship1");
        arguments[1] = mebn.getObjectEntityContainer().getEntityInstanceByName("ship2");
        Entity state = mebn.getBooleanStatesEntityContainer().getTrueStateEntity();
        mebnUtil.createRandomVariableFinding(residentNode, arguments, state);
       
        residentNode = mebn.getDomainResidentNode("UnusualRoute");
        arguments = new ObjectEntityInstance[1];
        arguments[0] = mebn.getObjectEntityContainer().getEntityInstanceByName("ship1");
        state = mebn.getBooleanStatesEntityContainer().getTrueStateEntity();
        mebnUtil.createRandomVariableFinding(residentNode, arguments, state);
       
        residentNode = mebn.getDomainResidentNode("AreMeeting");
        arguments = new ObjectEntityInstance[2];
        arguments[0] = mebn.getObjectEntityContainer().getEntityInstanceByName("ship1");
        arguments[1] = mebn.getObjectEntityContainer().getEntityInstanceByName("ship3");
        state = mebn.getBooleanStatesEntityContainer().getTrueStateEntity();
        mebnUtil.createRandomVariableFinding(residentNode, arguments, state);
       
        residentNode = mebn.getDomainResidentNode("IsMemberOfOrganization");
        arguments = new ObjectEntityInstance[2];
        arguments[0] = mebn.getObjectEntityContainer().getEntityInstanceByName("person1");
        arguments[1] = mebn.getObjectEntityContainer().getEntityInstanceByName("org1");
        state = mebn.getBooleanStatesEntityContainer().getTrueStateEntity();
        mebnUtil.createRandomVariableFinding(residentNode, arguments, state);
       
        residentNode = mebn.getDomainResidentNode("IsTerroristOrganization");
        arguments = new ObjectEntityInstance[1];
        arguments[0] = mebn.getObjectEntityContainer().getEntityInstanceByName("org1");
        state = mebn.getBooleanStatesEntityContainer().getTrueStateEntity();
        mebnUtil.createRandomVariableFinding(residentNode, arguments, state);
       
        residentNode = mebn.getDomainResidentNode("ResponsiveAIS");
        arguments = new ObjectEntityInstance[1];
        arguments[0] = mebn.getObjectEntityContainer().getEntityInstanceByName("ship1");
        state = mebn.getBooleanStatesEntityContainer().getFalseStateEntity();
        mebnUtil.createRandomVariableFinding(residentNode, arguments, state);
       
        residentNode = mebn.getDomainResidentNode("ResponsiveRadar");
        arguments = new ObjectEntityInstance[1];
        arguments[0] = mebn.getObjectEntityContainer().getEntityInstanceByName("ship1");
        state = mebn.getBooleanStatesEntityContainer().getFalseStateEntity();
        mebnUtil.createRandomVariableFinding(residentNode, arguments, state);
       
        residentNode = mebn.getDomainResidentNode("IsCrewMember");
        arguments = new ObjectEntityInstance[2];
        arguments[0] = mebn.getObjectEntityContainer().getEntityInstanceByName("person1");
        arguments[1] = mebn.getObjectEntityContainer().getEntityInstanceByName("ship1");
        state = mebn.getBooleanStatesEntityContainer().getTrueStateEntity();
        mebnUtil.createRandomVariableFinding(residentNode, arguments, state);
       
        residentNode = mebn.getDomainResidentNode("DetectedECM");
        arguments = new ObjectEntityInstance[1];
        arguments[0] = mebn.getObjectEntityContainer().getEntityInstanceByName("ship2");
        state = mebn.getBooleanStatesEntityContainer().getFalseStateEntity();
        mebnUtil.createRandomVariableFinding(residentNode, arguments, state);
       
        knowledgeBase = textModeRunner.fillFindings(mebn,knowledgeBase);
     
        new PrognosFrame("PROGNOS", mebn);
      } catch (Exception e) {
View Full Code Here

TOP

Related Classes of edu.gmu.seor.prognos.simulation.integration.util.MebnUtil

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.