Package statechum

Examples of statechum.Label


        LearnerGraph initPTA = new LearnerGraph(initConfiguration.config);initPTA.paths.augmentPTA(collectionOfTraces.get(UAVAllSeeds).tracesForUAVandFrame.get(UAVAllSeeds).get(frame));
        Transform.augmentFromIfThenAutomaton(initPTA, null, ifthenAutomata, initConfiguration.config.getHowManyStatesToAddFromIFTHEN());// we only need  to augment our PTA once (refer to the explanation above).
        System.out.println("total states : "+initPTA.getStateNumber()+", "+initPTA.getAcceptStateNumber()+" accept-states");

        final Set<Label> alphabetForIfThen = referenceGraph.pathroutines.computeAlphabet();
        Label uniqueLabel = AbstractLearnerGraph.generateNewLabel("Waypoint_Selected", initConfiguration.config,initConfiguration.getLabelConverter());

        /*
        for(int i=0;i<classifiers.length;++i)
        {
          {
View Full Code Here


   * @param config determines which label to generate.
   * @param conv converter to intern labels, ignored if null.
   */
  public static Label generateNewLabel(String label, Configuration config, ConvertALabel conv)
  {
    Label result = null;
    switch(config.getLabelKind())
    {
    case LABEL_STRING:
      result = new StringLabel(label);
      break;
View Full Code Here

   * Could be more elaborate than just a number: for Erlang, this could generated trees. In addition, this one does not
   * really assign numbers to labels, hence the outcome cannot be used where {@link ConvertibleToInt#toInt()} is used.
   */
  public static Label generateNewLabel(int number, Configuration config, ConvertALabel conv)
  {
    Label result = null;
    switch(config.getLabelKind())
    {
    case LABEL_STRING:
      result = new StringLabel("L"+Integer.toString(number));// this is necessary if I subsequently choose to use these labels in regular expressions, in which case I would not know whether "1" means "anything" or "label 1".
      break;
View Full Code Here

           
            @SuppressWarnings("rawtypes")
          Map transitions = (Map)Inverse_Graph.transitionMatrix.get(e.currentState);
            for(Object lblObj:transitions.keySet())         
            {
              Label lbl = (Label)lblObj;
              for(Object targetObj:Inverse_Graph.getTargets(transitions.get(lbl)))
              {
                CmpVertex target = (CmpVertex)targetObj;
                pathToNewState=new ArrayList<Label>();
                pathToNewState.addAll(e.pathToFrontLine);
View Full Code Here

  @Test
  public final void testCreateLabelIntern1()
  {
    final Configuration conf = config.copy();conf.setLabelKind(LABELKIND.LABEL_STRING);
    final statechum.analysis.learning.rpnicore.Transform.InternStringLabel intern = null;
    final Label lbl = AbstractLearnerGraph.generateNewLabel("A", conf,intern);
    Helper.checkForCorrectException(new whatToRun() { public @Override void run() {
      lbl.toInt();
    }},UnsupportedOperationException.class,"string labels");
  }
View Full Code Here

  @Test
  public final void testCreateLabelIntern3()
  {
    final Configuration conf = config.copy();conf.setLabelKind(LABELKIND.LABEL_STRING);
    final statechum.analysis.learning.rpnicore.Transform.InternStringLabel intern = new statechum.analysis.learning.rpnicore.Transform.InternStringLabel();
    final Label lbl1 = intern.convertLabelToLabel(AbstractLearnerGraph.generateNewLabel("A", conf,intern));
    final Label lbl2 = intern.convertLabelToLabel(AbstractLearnerGraph.generateNewLabel("A", conf,intern));
    assertEquals(0,lbl1.toInt());
    assertEquals(0,lbl2.toInt());
    final Label lbl3 = intern.convertLabelToLabel(AbstractLearnerGraph.generateNewLabel("B", conf,intern));
    assertEquals(1,lbl3.toInt());   
  }
View Full Code Here

   */
  @Test
  public final void testVertexOrdering()
  {
    LearnerGraph gr = new LearnerGraph(config);
    Label a=AbstractLearnerGraph.generateNewLabel("a", config,getLabelConverter()),b=AbstractLearnerGraph.generateNewLabel("b", config,getLabelConverter());
    gr.paths.augmentPTA(Arrays.asList(new Label[]{a,a}),true,false,null);
    gr.paths.augmentPTA(Arrays.asList(new Label[]{a,b}),true,false,null);
    gr.paths.augmentPTA(Arrays.asList(new Label[]{b}),true,false,null);
   
    CmpVertex A=gr.paths.getVertex(Arrays.asList(new Label[]{})),
View Full Code Here

    List<List<Label>> uniqueSequences = new LinkedList<List<Label>>();
    for(Label l1:graph.getCache().getAlphabet())
    {
      boolean nonUnique = false;
      Label unique = null;
      for(Label lbl:graph.getCache().getAlphabet())
      {
        if (MarkovMatrix.containsKey(new Trace(Arrays.asList(new Label[]{l1,lbl}),true)))
        {
          if (unique == null)
View Full Code Here

    {
      final int alphabet = states;
      LearnerGraph referenceGraph = null;
      ThreadResult outcome = new ThreadResult();
      WekaDataCollector dataCollector = createDataCollector(ifDepth);
      Label uniqueFromInitial = null;
      Timer timerToDetectLongRunningAutomata = new Timer("timer_to_detect_lengthy_tasks");
      MachineGenerator mg = new MachineGenerator(states, 400 , (int)Math.round((double)states/5));mg.setGenerateConnected(true);
      do
      {
        referenceGraph = mg.nextMachine(alphabet,seed, config, converter).pathroutines.buildDeterministicGraph();// reference graph has no reject-states, because we assume that undefined transitions lead to reject states.
View Full Code Here

    public ThreadResult call() throws Exception
    {
      final int alphabet = 2*states;
      LearnerGraph referenceGraph = null;
      ThreadResult outcome = new ThreadResult();
      Label uniqueFromInitial = null;
      MachineGenerator mg = new MachineGenerator(states, 400 , (int)Math.round((double)states/5));mg.setGenerateConnected(true);
      do
      {
        referenceGraph = mg.nextMachine(alphabet,seed, config, converter).pathroutines.buildDeterministicGraph();// reference graph has no reject-states, because we assume that undefined transitions lead to reject states.
        if (pickUniqueFromInitial)
View Full Code Here

TOP

Related Classes of statechum.Label

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.