Package statechum

Examples of statechum.StringLabel


  {
    Label result = null;
    switch(config.getLabelKind())
    {
    case LABEL_STRING:
      result = new StringLabel(label);
      break;
    case LABEL_ERLANG:
      result = ErlangLabel.erlangObjectToLabel(ErlangLabel.parseText(label),config);
      break;
    default:
View Full Code Here


  {
    Label result = null;
    switch(config.getLabelKind())
    {
    case LABEL_STRING:
      result = new StringLabel(Integer.toString(number));
      break;
    default:
      throw new IllegalArgumentException("No parser available for traces of type "+config.getLabelKind());
    }
    return result;
View Full Code Here

        AbstractLearnerGraph.interpretLabelsOnGraph(grFrom,grTo,new Transform.ConvertLabel(new ConvertALabel() {
       
        @Override
        public Label convertLabelToLabel(Label label) {
          ErlangLabel lbl = (ErlangLabel)label;
          return new StringLabel(lbl.function.getName()+"/"+lbl.function.getArity()+","+lbl.input+","+lbl.expectedOutput);
        }
      }));
    }
View Full Code Here

        AbstractLearnerGraph.interpretLabelsOnGraph(grFrom,grTo,new Transform.ConvertLabel(new ConvertALabel() {
       
        @Override
        public Label convertLabelToLabel(Label label) {
          ErlangLabel lbl = (ErlangLabel)label;
          return new StringLabel(lbl.function.getName()+"/"+lbl.function.getArity()+","+lbl.input+","+lbl.expectedOutput);
        }
      }));
    }
View Full Code Here

  @Test
  public void test_generateRandomWalk1a3()
  {
    RandomPathGenerator generator = new RandomPathGenerator(simpleGraph,new Random(0),0,simpleGraph.findVertex("B"));
    Assert.assertEquals(labelList(new String[]{"a","b"}), generator.generateRandomWalk(1,1, true,Arrays.asList(new Label[]{new StringLabel("a")})));
    Assert.assertEquals(labelList(new String[]{"a","b","c"}), generator.generateRandomWalk(2,2, true,Arrays.asList(new Label[]{new StringLabel("a")})));
  }
View Full Code Here

  /** Here an invalid element of an alphabet is used as a prefix for all sequences which does not matter because validity of paths is only considered elementwise rather than as whole sequences, hence the outcome is unaffected. */
  @Test
  public void test_generateRandomWalk1a4()
  {
    RandomPathGenerator generator = new RandomPathGenerator(simpleGraph,new Random(0),0,simpleGraph.findVertex("B"));
    Assert.assertEquals(labelList(new String[]{"z","b"}), generator.generateRandomWalk(1,1, true,Arrays.asList(new Label[]{new StringLabel("z")})));
    Assert.assertEquals(labelList(new String[]{"z","b","c"}), generator.generateRandomWalk(2,2, true,Arrays.asList(new Label[]{new StringLabel("z")})));
  }
View Full Code Here

  @Test
  public void test_generateRandomWalk7d()
  {
    LearnerGraph graph = buildLearnerGraph("A-a->B\nB-b->D-a->D-c->E-a->E","test_generateRandomWalk7",config,converter);
    RandomPathGenerator generator = new RandomPathGenerator(graph,new Random(0),0,graph.findVertex("D"));
    generateSeq(2,2,3,generator,Arrays.asList(new Label[]{new StringLabel("p"),new StringLabel("q")}),
        ArrayOperations.flatten(new Object[]{new Object[]{// the first Object[] means we are talking
            // of a sequence, the second Object[] means that the first sequence contains alternatives,
            // defined in the second Object, the two sequences below denote these alternatives.
            new Object[]{"p","q","a","b"},
            new Object[]{"p","q","c",new String[]{"b","c"}}
View Full Code Here

        AbstractLearnerGraph.interpretLabelsOnGraph(grFrom,grTo,new Transform.ConvertLabel(new ConvertALabel() {
       
        @Override
        public Label convertLabelToLabel(Label label) {
          ErlangLabel lbl = (ErlangLabel)label;
          return new StringLabel(lbl.function.getName()+"/"+lbl.function.getArity()+","+lbl.input+","+lbl.expectedOutput);
        }
      }));
    }
View Full Code Here

TOP

Related Classes of statechum.StringLabel

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.