Examples of Visualiser


Examples of evaluation.Visualiser

    public void testWithRandomConstraints3() {
        //based on code sarah
        //Make Visualiser for chartcreation
        // Visualiser vis = new Visualiser("Percentage of failures with increasing number of clauses for SIMPLE constraints",
        //        "Number of clauses", "Percentage of failures");
        Visualiser visTime = new Visualiser("Mean calculation time with increasing number of clauses (max number of variables=max number of constraints",
                "Number of clauses", "Mean calculation time");
        Random rand = new Random(0);
        for (int i = 1; i <= 25; i++) {
            // for (int i = 1; i <= 96; i += 5) {
            System.out.println("klasse " + i);
            //i--> number of constraints (class from i to i+4)
            double sumBeam = 0, sumBasic = 0;
            for (int k = 1; k <=
                    100; k++) {
                //for each constraint class 100 cp cases
                int numberOfConstraints = i;//i + rand.nextInt(i + 3);
                int numberOfVariables = (i == 1 ? 1 : (1 + rand.nextInt(i - 1)));//rand.nextInt(i + 3);
                int numberOfVariablesPerClause = (i == 1 ? 1 : (1 + rand.nextInt(i - 1)));//rand.nextInt(i + 3);
                List<FuzzyLiteral> l = RandomProblemGenerator.getRandomSatisfiableConstraints3(numberOfConstraints, numberOfVariables, 0.5, numberOfVariablesPerClause);
                List<FuzzyClause> constraintslist = new ArrayList<FuzzyClause>(); //for beam version
                for (FuzzyLiteral f : l) {
                    constraintslist.add(new FuzzyClause(f));
                }

                List<FuzzyClause> constraintslist2 = new ArrayList<FuzzyClause>(); //for basic version
                for (FuzzyLiteral f : l) {
                    constraintslist2.add(new FuzzyClause(new FuzzyLiteral(f)));
                }
                //start beam
                double start = System.currentTimeMillis();
                CPBeamSolver beam = new CPBeamSolver(constraintslist, 1, 1, 1, 1, 200, 0.0001, 0.5, 100);
                beam.findFuzzyModel();
                double end = System.currentTimeMillis();
                sumBeam += (end - start);
                //start basic
                start = System.currentTimeMillis();
                CPBeamSolver basic = new CPBeamSolver(constraintslist2, 1, 1, 1, 1, 200, 0.0001, 0.5, 100);
                basic.findFuzzyModelTest();
                end = System.currentTimeMillis();
                sumBasic += (end - start);
            }
            visTime.setValue("Beam IP-1", 0.0 + i, sumBeam / 100);//((0.0 + i) / 4) + 1, sumBeam / 100);
            visTime.setValue("Basic", 0.0 + i, sumBasic / 100);//((0.0 + i) / 4) + 1, sumBasic / 100);
        }
        visTime.saveChart("FilesPat/BeamVersusBasic(NoTransformationToBasicConstraints)_NumberOfConstraints(maxVariables=maxConstraints)");
    }
View Full Code Here

Examples of statechum.analysis.learning.Visualiser

   * @param lowerGraph the graph to display below it
   */
  public void updateFrame(final DirectedSparseGraph g,final DirectedSparseGraph lowerGraph)
  {
    if (visFrame == null)
      visFrame = new Visualiser();
    visFrame.update(null, g);
    if (lowerGraph != null)
    {
      try {// I'm assuming here that Swing has only one queue of threads to run on the AWT thread, hence the
        // thread scheduled by invokeLater will be run to completion before the next one (below) runs and hence
        // I rely on the results of execution of the above thread below in order to position the window.
        SwingUtilities.invokeAndWait(new Runnable()
        {
          public void run()
          {
            Visualiser v=new Visualiser();v.update(null, lowerGraph);
            Point newLoc = visFrame.getLocation();newLoc.move(0, visFrame.getHeight());v.setLocation(newLoc);
          }
        });
      } catch (InterruptedException e) {
        // cannot do much about this
        e.printStackTrace();
View Full Code Here

Examples of statechum.analysis.learning.Visualiser

   * @param g the graph to display
   */
  public void updateFrame(DirectedSparseGraph g)
  {
    if (visFrame == null)
      visFrame = new Visualiser();
    visFrame.update(null, g);
  }
View Full Code Here

Examples of statechum.analysis.learning.Visualiser

    AbstractPersistence.loadGraph(args[0], grOrig,null);

    final LearnerGraph erlangGraph = new LearnerGraph(grOrig.config);
    AbstractLearnerGraph.interpretLabelsOnGraph(grOrig,erlangGraph,mod.behaviour.new ConverterErlToMod());
   
    Visualiser graphVisualiser = new ErlangOracleVisualiser();
    graphVisualiser.update(null,erlangGraph);Visualiser.waitForKey();
  }
View Full Code Here

Examples of statechum.analysis.learning.Visualiser

    AbstractPersistence.loadGraph(args[0], grOrig,null);

    final LearnerGraph erlangGraph = new LearnerGraph(grOrig.config);
    AbstractLearnerGraph.interpretLabelsOnGraph(grOrig,erlangGraph,mod.behaviour.new ConverterErlToMod());
   
    Visualiser graphVisualiser = new ErlangOracleVisualiser();
    graphVisualiser.update(null,erlangGraph);Visualiser.waitForKey();
  }
View Full Code Here

Examples of statechum.analysis.learning.Visualiser

   * @param g the graph to display
   * @param lowerGraph the graph to display below it
   */
  public static void updateFrame(final DirectedSparseGraph g,final DirectedSparseGraph lowerGraph)
  {
    final Visualiser v=new Visualiser();
    v.update(null, g);
    if (lowerGraph != null)
    {
      try {// I'm assuming here that Swing has only one queue of threads to run on the AWT thread, hence the
        // thread scheduled by invokeLater will be run to completion before the next one (below) runs and hence
        // I rely on the results of execution of the above thread below in order to position the window.
        SwingUtilities.invokeAndWait(new Runnable()
        {
          public void run()
          {
            Visualiser viz=new Visualiser();viz.update(null, lowerGraph);
            Point newLoc = viz.getLocation();newLoc.move(0, v.getHeight());v.setLocation(newLoc);
          }
        });
      } catch (InterruptedException e) {
        // cannot do much about this
        e.printStackTrace();
View Full Code Here

Examples of statechum.analysis.learning.Visualiser

   * @param g the graph to display
   * @param lowerGraph the graph to display below it
   */
  public static void updateFrame(final DirectedSparseGraph g,final DirectedSparseGraph lowerGraph)
  {
    final Visualiser v=new Visualiser();
    v.update(null, g);
    if (lowerGraph != null)
    {
      try {// I'm assuming here that Swing has only one queue of threads to run on the AWT thread, hence the
        // thread scheduled by invokeLater will be run to completion before the next one (below) runs and hence
        // I rely on the results of execution of the above thread below in order to position the window.
        SwingUtilities.invokeAndWait(new Runnable()
        {
          public void run()
          {
            Visualiser viz=new Visualiser();viz.update(null, lowerGraph);
            Point newLoc = viz.getLocation();newLoc.move(0, v.getHeight());v.setLocation(newLoc);
          }
        });
      } catch (InterruptedException e) {
        // cannot do much about this
        e.printStackTrace();
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.