Package statechum.analysis.learning.rpnicore.WMethod

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


    fsm.pairscores.computePairCompatibilityScore_general(null,Arrays.asList(new StatePair[]{
        new StatePair(fsm.findVertex("I"),fsm.findVertex("A1")),new StatePair(fsm.findVertex("I"),fsm.findVertex("B1")),new StatePair(fsm.findVertex("I"),fsm.findVertex("C1"))
        }), verticesToMerge);
    LearnerGraph mergeOutcome =  MergeStates.mergeCollectionOfVertices(fsm, null, verticesToMerge);
    LearnerGraph expected = FsmParser.buildLearnerGraph("I-b->I-c->I / I-a->I", "testPairCompatible_general_Fb",config,getLabelConverter());
    DifferentFSMException diffEx = WMethod.checkM(expected, mergeOutcome);
    if (diffEx != null)
      throw diffEx;
  }
View Full Code Here


    fsm.pairscores.computePairCompatibilityScore_general(null,Arrays.asList(new StatePair[]{
        new StatePair(fsm.findVertex("I"),fsm.findVertex("A1")),new StatePair(fsm.findVertex("I"),fsm.findVertex("B1")),new StatePair(fsm.findVertex("I"),fsm.findVertex("C1"))
        }), verticesToMerge);
    LearnerGraph mergeOutcome =  MergeStates.mergeCollectionOfVertices(fsm, null, verticesToMerge);
    LearnerGraph expected = FsmParser.buildLearnerGraph("I-d->I-b->I-c->I / I-a->B2-b->B3-c->C1 / I-e->B2", "testPairCompatible_general_Gb",config,getLabelConverter());
    DifferentFSMException diffEx = WMethod.checkM(expected, mergeOutcome);
    if (diffEx != null)
      throw diffEx;
  }
View Full Code Here

    fsm.pairscores.computePairCompatibilityScore_general(null,Arrays.asList(new StatePair[]{
        new StatePair(fsm.findVertex("I"),fsm.findVertex("A1")),new StatePair(fsm.findVertex("I"),fsm.findVertex("B1")),new StatePair(fsm.findVertex("I"),fsm.findVertex("C1"))
        }), verticesToMerge);
    LearnerGraph mergeOutcome =  MergeStates.mergeCollectionOfVertices(fsm, null, verticesToMerge);
    LearnerGraph expected = FsmParser.buildLearnerGraph("I-b->I-c->I / I-a->I-d->I", "testPairCompatible_general_Hb",config,getLabelConverter());
    DifferentFSMException diffEx = WMethod.checkM(expected, mergeOutcome);
    if (diffEx != null)
      throw diffEx;
  }
View Full Code Here

      MachineGenerator mg = new MachineGenerator(states, 400 , (int)Math.round((double)states/5));mg.setGenerateConnected(true);
      LearnerGraph graph = mg.nextMachine(alphabet,-states, config, converter).pathroutines.buildDeterministicGraph();
           
      LearnerGraph parsedOutcome = new LearnerGraph(config);
      StatechumProcess.parseStatemachine(StatechumProcess.constructFSM(graph), parsedOutcome, converter,true);
      DifferentFSMException diffException = WMethod.checkM(graph, parsedOutcome);
      Assert.assertNull(diffException);

      Map<VertID,VertID> map = new TreeMap<VertID,VertID>();
      for(int i=0;i<20;++i) map.put(graph.pathroutines.pickRandomState(rnd),graph.pathroutines.pickRandomState(rnd));
      Map<VertID,VertID> mapOutcome = StatechumProcess.parseMap(StatechumProcess.mapToObject(map));
View Full Code Here

      MachineGenerator mg = new MachineGenerator(states, 400 , (int)Math.round((double)states/5));mg.setGenerateConnected(true);
      LearnerGraphND graph = mg.nextMachine(alphabet,-states, config, converter);
     
      LearnerGraphND parsedOutcome = new LearnerGraphND(config);
      StatechumProcess.parseStatemachine(StatechumProcess.constructFSM(graph), parsedOutcome, converter,true);
      DifferentFSMException diffException = WMethod.checkM(graph, parsedOutcome);
      Assert.assertNull(diffException);

      Map<VertID,VertID> map = new TreeMap<VertID,VertID>();
      for(int i=0;i<20;++i) map.put(graph.pathroutines.pickRandomState(rnd),graph.pathroutines.pickRandomState(rnd));
      Map<VertID,VertID> mapOutcome = StatechumProcess.parseMap(StatechumProcess.mapToObject(map));
      Assert.assertEquals(map,mapOutcome);
     
      if (previous != null)
      {
        LearnerGraphND shouldBeLikePrevious = new LearnerGraphND(graph,config);
        OtpErlangObject difference = DifferenceVisualiser.ChangesToGraph.computeGD(graph, previous, config);
        DifferenceVisualiser.ChangesToGraph.load(difference).applyDiff(shouldBeLikePrevious, config);
        DifferentFSMException ex = WMethod.checkM(previous, shouldBeLikePrevious);
        Assert.assertNull(ex);
      }
      previous = graph;
    }
  }
View Full Code Here

                                               "['N1000','P1002'],"+
                                                "[{'P1000','N1000'},{'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(shouldBeLikePrevious.getStateNumber(),grB.getStateNumber());
   
    DirectedSparseGraph gr = DifferenceVisualiser.ChangesToGraph.computeVisualisationParameters(grAerlang, difference);
    Map<String,String> edgeToColours = new TreeMap<String,String>();
    for(Object edgeObj:gr.getEdges())
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

    OtpErlangObject difference = DifferenceVisualiser.ChangesToGraph.computeGD(grA, grB, config);
    Assert.assertEquals("{'statemachinedifference',[{'P1000','a','P1001'}],[{'P1000','a','P1000'}],['N1001','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

    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

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.