Package trackerModule.test

Source Code of trackerModule.test.Editing_test

package trackerModule.test;

import trackerModule.core.rulestructure.RDB;
import trackerModule.sim.map.MapFrame;
import trackerModule.sim.tracker.World;
import trackerModule.weka.WekaInterface;
import weka.classifiers.bayes.BayesNet;
import weka.core.Instances;
/**
* The Class Editing_test.
*/
public class Editing_test {
 
  /**
   * Instantiates a new editing_test.
   */
  public Editing_test(){
   
  }
 
  /**
   * Test_create_ new_ map.
   */
  public void test_create_New_Map(){
    World.This();
     new MapFrame("PROGNOS Simulator", "/maps/ArabianSea6000x3000withAreas.bmp");
  }
 
  /**
   * Test_create_ new_ map_by load.
   */
  public void test_create_New_Map_byLoad(){
    World.This().loadWorld()
     new MapFrame("PROGNOS Simulator", "/maps/ArabianSea6000x3000withAreas.bmp");
  }
 
  /**
   * Test_with_ships.
   */
  public void test_with_ships(){
    World.This().loadWorld();
    World.This().createShortestPath();
    World.This().initNearestFishingAreas();
    World.This().createShipsByScenario(20, "null");
    new MapFrame("PROGNOS Simulator", "/maps/ArabianSea6000x3000.bmp");
  }
 
  /**
   * Test_ learning_ route.
   */
  public void test_Learning_Route(){
    World.This().loadWorld();
    World.This().createShortestPath();
    World.This().initNearestFishingAreas();
    World.This().initRouteMap();
    World.This().createShipsByScenario(300, "null");
    World.This().start();
   
    while(World.This().isWorking()){}
    System.out.print("simulation end");
     World.This().saveWorld_Route();
  }
 
  /**
   * Test_with_ route.
   */
  public void test_with_Route(){
    World.This().loadWorld_Route();
    World.This().createShortestPath();
    World.This().initNearestFishingAreas();
    World.This().createShipsByScenario(50, "null");
    new MapFrame("PROGNOS Simulator", "/maps/ArabianSea6000x3000.bmp");
  }
 
  /**
   * Test_ b n_ learning.
   */
  public void test_BN_Learning(){
    World.This().loadWorld();
    World.This().createShipsForLearning(240);
    RDB.This().start();
    while(World.This().isWorking()){}
   
    System.out.print("simulation end");
    
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // convert TDB to weka
   
    //c.print();
    WekaInterface wekaInter = new WekaInterface();
    String[] pars = {"Location", "X", "Y", "Mission", "Meeting", "Route", "Type"};
    Instances data1 = wekaInter.getWekaDataFromUMatrix("Type", pars);
   
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // training
    wekaInter.saveWekaFile("world.arff", data1);
    BayesNet BN = wekaInter.trainBayesNet(data1);
    wekaInter.saveBIFFromFile("world.xml", BN);
  }
 
  /**
   * Test_ bn.
   */
  public void test_BN(){ 
    World.This().setWekaInterface();
    World.This().load("World_Route.map");
    World.This().createShipsByScenario(10, "Bombing", "IllicitCargo");
    new MapFrame("PROGNOS Simulator");
  }
 
  /**
   * The main method.
   *
   * @param args the arguments
   */
  public static void main(String[] args) {
    Editing_test T = new Editing_test();
    //T.test_BN_Learning();
    //T.test_BN();
    //T.test_create_New_Map();
    //T.test_create_New_Map_byLoad();
    //T.test_with_ships();
    //T.test_Learning_Route();
    T.test_with_Route();
  }
}
TOP

Related Classes of trackerModule.test.Editing_test

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.