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

Examples of edu.gmu.seor.prognos.unbbayesplugin.cps.CPSCompilerMain


      else
        sizeOfFalse++;
    }
    
    //for hasAgressiveBehavior == true
    CPSCompilerMain cpsCompiler = new CPSCompilerMain();
        cpsCompiler.InitCompiler();
        cpsCompiler.compile( AggressiveBehavior_net +
                   "defineEvidence( hasAggressiveBehavior, True );"+
                   "run(LW, " + sizeOfTrue + ");" );
       
      int i = 0;
     for (ShipEntity ship : se){
      if (ship.hasAggressiveBehaviorState()){
        Map<String, String> mapSample = LikelihoodWeighting.This().sampleList.get(i++);
       
        for (String key : mapSample.keySet()){
          String value = mapSample.get(key);
          if (key.equalsIgnoreCase("speedChange"))
            ship.setSpeedChange(Float.valueOf(value));
          else
          if (key.equalsIgnoreCase("turnRate"))
            ship.setTurnRate(Float.valueOf(value));
          else
          if (key.equalsIgnoreCase("propellerTurnCount"))
            ship.setPropellerTurnCount(Float.valueOf(value))
          else
          if (key.equalsIgnoreCase("shipRCSchange"))
            ship.setShipRCSChange(Float.valueOf(value));
          else
          if (key.equalsIgnoreCase("cavitation"))
            ship.setCavitation(Float.valueOf(value));  
        }
       
        //System.out.println(ship.toString());
      }
    }   

        //for hasAgressiveBehavior == false
      LikelihoodWeighting.This().sampleList.clear();
        cpsCompiler.InitCompiler();
        cpsCompiler.compile( AggressiveBehavior_net +
                   "defineEvidence( hasAggressiveBehavior, False );"+
                   "run(LW, " + sizeOfFalse + ");" );
       
        i = 0;
     for (ShipEntity ship : se){
View Full Code Here


    "p( W | A, X, Y ) = if( A == a1  ){ X - 0.5*Y + NormalDist( 2, 1 ); } " +
    "else if( A == a2  ){ X+Y + NormalDist( -1, 0.5 ); } " +
    "}" );

  public void test1() {
    CPSCompilerMain cpsCompiler = new CPSCompilerMain();
        cpsCompiler.InitCompiler();
        cpsCompiler.compile( mk_hybridTest_1d2c_bnet +
                  //"setSampleSize(1000);"+
                  "createCPT( X, Y, W );"
                  );
        
    }
View Full Code Here

  
  public Continuous_Test() {}
  
  public void test1()
  {
    CPSCompilerMain cpsCompiler = new CPSCompilerMain();
        cpsCompiler.InitCompiler();
       
        cpsCompiler.compile(
            "defineNode(P1, Number);"+
        "{ defineState(Continuous, 1, 2, 3, 4, 5, 6);" +
        "  p(P1) = NormalDist( 3, 2 ); }" 
       );
    
View Full Code Here

     EDB.This().printSet(true);
  }
  
  //*** This works well at 6/16/2011 ***
  public void test1() {
    CPSCompilerMain cpsCompiler = new CPSCompilerMain();
        cpsCompiler.InitCompiler();
    cpsCompiler.compile(
        "defineNode(C1, DescriptionC0);"+
        "{defineState(Continuous, 1, 2, 3, 4, 5, 6, 7 ,8, 9);" +
        "p( C1 ) = NormalDist( 5,1 );"+
        "}"    +
        "createCPT( C1 );"
View Full Code Here

      EDB.This().print("ROOT");
    }
 
  //*** This works well at 6/16/2011 ***
  public void test2() {
    CPSCompilerMain cpsCompiler = new CPSCompilerMain();
        cpsCompiler.InitCompiler();
    cpsCompiler.compile(
        "defineNode(C0, DescriptionC0);"+
        "{defineState(Discrete, 7, 8 );" +
        "p( C0 ) = PoissonDist( 2 );"+
        "}"+
       
View Full Code Here

       
      EDB.This().print("ROOT");
    }
  //*** This works well at 6/16/2011 ***
  public void test3() {
    CPSCompilerMain cpsCompiler = new CPSCompilerMain();
        cpsCompiler.InitCompiler();
    cpsCompiler.compile(
        "defineNode(C0, DescriptionC0);"+
        "{defineState(Discrete, 1, 2, 3, 4, 5, 6, 7, 8 );" +
        "p( C0 ) = PoissonDist( 2 );"+
        "}"+
       
View Full Code Here

      EDB.This().print("ROOT.NODES.C2");
    }
 
  //*** This works well at 6/16/2011 ***
  public void test4() {
    CPSCompilerMain cpsCompiler = new CPSCompilerMain();
        cpsCompiler.InitCompiler();
    cpsCompiler.compile(
        "defineNode(C0, DescriptionC0);"+
        "{defineState(Continuous, 1, 3,4,6 );" +
        "p( C0 ) = NormalDist( 4,1 );"+
        "}"+
         
View Full Code Here

      //"p( X | Y, U ) = Root(Exp(Y, e), 2) - U + NormalDist(0, 0.1); }"
      "p( X | Y, U ) = 1*Y + 1* U + NormalDist(0, 0.1); }"
  );
  public void test1() {
    CPSCompilerMain cpsCompiler = new CPSCompilerMain();
        cpsCompiler.InitCompiler();
        cpsCompiler.compile( testNet +
            "defineNode(E, DescriptionE);"+
          "{ defineState(Continuous);" +
          "p( E | X ) =  3 * X - 2; }"
        );
           
View Full Code Here

        EquationOperator e = new EquationOperator();
        e.convert( EDB.This().get("ROOT.NODES.E.EQUATION"), "X" );
  }
 
  public void test2() {
    CPSCompilerMain cpsCompiler = new CPSCompilerMain();
        cpsCompiler.InitCompiler();
        cpsCompiler.compile( testNet +
            "defineNode(E, DescriptionE);"+
          "{ defineState(Continuous);" +
          "p( E | X ) =  Root( X, 2 ) + 6; }"
        );
           
View Full Code Here

        EquationOperator e = new EquationOperator();
        e.convert( EDB.This().get("ROOT.NODES.E.EQUATION"), "X" );
  }
 
  public void test3() {
    CPSCompilerMain cpsCompiler = new CPSCompilerMain();
        cpsCompiler.InitCompiler();
        cpsCompiler.compile( testNet +
            "defineNode(E, DescriptionE);"+
          "{ defineState(Continuous);" +
          "p( E | X ) =  Exp( Root( X, 3 ), e ); }"
        );
           
View Full Code Here

TOP

Related Classes of edu.gmu.seor.prognos.unbbayesplugin.cps.CPSCompilerMain

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.