Package statechum.analysis.learning.rpnicore.WMethod

Examples of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException


    final LearnerGraph expected = new LearnerGraph(FsmParser.buildGraph("A-edit->A-save->A-load->A-close->A / R-exit->P-edit-#R1 / P-save-#R2 / P-load-#R3 / P-exit-#R4 / P-close-#R5 / A==THEN==R","testInterpretLabelsOnGraph7b"),config);
    Set<String> alphabet = new TreeSet<String>();alphabet.addAll(Arrays.asList(new String[]{"load","save","edit","close","exit"}));
    final LearnerGraph outcome = graph.transform.interpretLabelsOnGraph(alphabet);
    expected.addTransition(expected.transitionMatrix.get(expected.findVertex(VertexID.parseID("A"))), "to_R",expected.findVertex(VertexID.parseID("R")));
    outcome.addTransition(outcome.transitionMatrix.get(outcome.findVertex(VertexID.parseID("A"))), "to_R",outcome.findVertex(VertexID.parseID("R")));
    DifferentFSMException ex= WMethod.checkM_and_colours(expected, outcome, VERTEX_COMPARISON_KIND.NONE);
    Assert.assertNull(ex==null?"":ex.toString(),ex);
  }
View Full Code Here


   */
  protected final boolean compareInDepth;

  protected void checkGraphEquality(LearnerGraph what, LearnerGraph with)
  {
    DifferentFSMException ex = null;
    if (compareInDepth)
    {
      //if (!what.equals(with))
      //  ex = new DifferentFSMException("machines differ");
      ex = WMethod.checkM_and_colours(what,with,VERTEX_COMPARISON_KIND.DEEP);
View Full Code Here

    OtpErlangObject difference = DifferenceVisualiser.ChangesToGraph.computeGD(grA, grB, config);
    Assert.assertEquals("{'statemachinedifference',[],[],['N1001','P1003'],['N1000','P1002'],[{'P1000','P1001'},{'P1003','P1000'}],'P1000'}",ErlangLabel.dumpErlangObject(difference));

    LearnerGraphND shouldBeLikePrevious = new LearnerGraphND(grA,config);
    DifferenceVisualiser.ChangesToGraph.load(difference).applyDiff(shouldBeLikePrevious, config);
    DifferentFSMException ex = WMethod.checkM(grB, shouldBeLikePrevious);
    Assert.assertNull(ex);Assert.assertEquals(grB.getStateNumber(),shouldBeLikePrevious.getStateNumber());
  }
View Full Code Here

    OtpErlangObject difference = DifferenceVisualiser.ChangesToGraph.computeGD(grA, grB, config);
    Assert.assertEquals("{'statemachinedifference',[],[],['N1001','P1003'],['N1000','P1002'],[{'P1000','P1001'},{'P1003','P1000'}],'P1003'}",ErlangLabel.dumpErlangObject(difference));

    LearnerGraphND shouldBeLikePrevious = new LearnerGraphND(grA,config);
    DifferenceVisualiser.ChangesToGraph.load(difference).applyDiff(shouldBeLikePrevious, config);
    DifferentFSMException ex = WMethod.checkM(grB, shouldBeLikePrevious);
    Assert.assertNull(ex);Assert.assertEquals(grB.getStateNumber(),shouldBeLikePrevious.getStateNumber());
  }
View Full Code Here

    OtpErlangObject difference = DifferenceVisualiser.ChangesToGraph.computeGD(grA, grB, config);
    Assert.assertEquals("{'statemachinedifference',[{'P1000','a','P1001'}],[{'P1000','a','P1000'}],['N1000','P1001'],['P1002'],[],'P1000'}",ErlangLabel.dumpErlangObject(difference));

    LearnerGraphND shouldBeLikePrevious = new LearnerGraphND(grA,config);
    DifferenceVisualiser.ChangesToGraph.load(difference).applyDiff(shouldBeLikePrevious, config);
    DifferentFSMException ex = WMethod.checkM(grB, shouldBeLikePrevious);
    Assert.assertNull(ex);Assert.assertEquals(grB.getStateNumber(),shouldBeLikePrevious.getStateNumber());
  }
View Full Code Here

    OtpErlangObject difference = DifferenceVisualiser.ChangesToGraph.computeGD(grA, grB, config);
    Assert.assertEquals("{'statemachinedifference',[{'P1000','a','P1001'}],[{'P1000','a','P1000'}],['P1001'],['N1000','P1002'],[],'P1000'}",ErlangLabel.dumpErlangObject(difference));

    LearnerGraphND shouldBeLikePrevious = new LearnerGraphND(grA,config);
    DifferenceVisualiser.ChangesToGraph.load(difference).applyDiff(shouldBeLikePrevious, config);
    DifferentFSMException ex = WMethod.checkM(grB, shouldBeLikePrevious);
    Assert.assertNull(ex);Assert.assertEquals(grB.getStateNumber(),shouldBeLikePrevious.getStateNumber());
  }
View Full Code Here

      ChangesRecorder patcher = new ChangesRecorder(null);
      gd.computeGD(grA, grB, threadNumber, patcher,config);
      ChangesRecorder.applyGD_WithRelabelling(graph, patcher.writeGD(TestGD.createDoc()),outcome);
      Assert.assertNull(testDetails(),WMethod.checkM(grB,graph));
      Assert.assertEquals(testDetails(),grB.getStateNumber(),graph.getStateNumber());
      DifferentFSMException ex= WMethod.checkM_and_colours(grB,outcome,VERTEX_COMPARISON_KIND.DEEP);
      Assert.assertNull(testDetails()+ex,WMethod.checkM_and_colours(grB,outcome,VERTEX_COMPARISON_KIND.DEEP));Assert.assertEquals(grB.getStateNumber(),graph.getStateNumber());
      Assert.assertEquals(grB,outcome);
    }
    catch(IOException ex)
    {
View Full Code Here

   
    Assert.assertSame(MarkovOutcome.positive, newTransitions.get(graph.findVertex("B")).get(lblB));

    final LearnerGraph expected = FsmParser.buildLearnerGraph("A-a->B-b->C / T-b->T-u->T","testConstructExtendedGraph4b",config, converter);
    LearnerGraph actual = cl.constructMarkovTentative();
    DifferentFSMException ex = WMethod.checkM(expected, actual);
    if (ex != null)
      throw ex;
    Assert.assertNotSame(graph, actual);
  }
View Full Code Here

   
    Assert.assertSame(MarkovOutcome.positive,newTransitions.get(graph.findVertex("B")).get(lblB));

    final LearnerGraph expected = FsmParser.buildLearnerGraph("A-a->B-b->C / A-w->M-c->B / T-b->T-u->T","testConstructExtendedGraph5b",config, converter);
    LearnerGraph actual = cl.constructMarkovTentative();
    DifferentFSMException ex = WMethod.checkM(expected, actual);
    if (ex != null)
      throw ex;
    Assert.assertNotSame(graph, actual);
  }
View Full Code Here

   
    Assert.assertSame(MarkovOutcome.positive, newTransitions.get(graph.findVertex("B")).get(lblB));

    final LearnerGraph expected = FsmParser.buildLearnerGraph("A-a->B / A-c->B / B-b->C / T-b->T-u->T","testConstructExtendedGraph6b",config, converter);
    LearnerGraph actual = cl.constructMarkovTentative();
    DifferentFSMException ex = WMethod.checkM(expected, actual);
    if (ex != null)
      throw ex;
    Assert.assertNotSame(graph, actual);
  }
View Full Code Here

TOP

Related Classes of statechum.analysis.learning.rpnicore.WMethod.DifferentFSMException

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.