Package statechum

Examples of statechum.Label


    PTASequenceEngine.Node currentNode = init;if (!currentNode.isAccept()) throw new IllegalArgumentException("untested on empty graphs");
    Iterator<Label> seqIt = inputSequence.iterator();
    while(seqIt.hasNext() && currentNode.isAccept())
    {
      Map<Label,PTASequenceEngine.Node> row = pta.get(currentNode);
      Label input = seqIt.next();
      if (row.containsKey(input))
        currentNode = row.get(input);
      else
        return null;// no transition with the current input
    }
View Full Code Here


    PTASequenceEngine.Node currentNode = init;
    Iterator<Label> seqIt = inputSequence.iterator();
    while(seqIt.hasNext() && currentNode.isAccept())
    {
      Map<Label,PTASequenceEngine.Node> row = pta.get(currentNode);
      Label input = seqIt.next();
      if (row.containsKey(input))
        currentNode = row.get(input);
      else
        // no transition with the current input, if this is a leaf node the current sequence will extend it.
        return currentNode != init && row.isEmpty();
View Full Code Here

    if (startPos >= path.size())
      return startState.isAccept();
    if (!startState.isAccept())
      return false;// we are only considering prefix-closed paths here, hence if we hit a reject state on the way, reject a path.
   
    Label label=path.get(startPos);
    Map<Label, TARGET_TYPE> existingTrans = graph.transitionMatrix.get(current);
    TARGET_TYPE collectionOfTargets = existingTrans != null?existingTrans.get(label):null;
    if (collectionOfTargets == null)
      // cannot make a move
      return false;
View Full Code Here

    if (startPos >= path.size())
      return startState.isAccept();
    if (!startState.isAccept())
      return false;// we are only considering prefix-closed paths here, hence if we hit a reject state on the way, reject a path.
   
    Label label=path.get(startPos);
    Map<Label, TARGET_TYPE> existingTrans = graph.transitionMatrix.get(current);
    TARGET_TYPE collectionOfTargets = existingTrans != null?existingTrans.get(label):null;
    if (collectionOfTargets == null)
      // cannot make a move
      return false;
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

    List<List<Label>> uniqueSequences = new LinkedList<List<Label>>();
    for(Label l1:ptaClassifier.graph.getCache().getAlphabet())
    {
      boolean nonUnique = false;
      Label unique = null;
      for(Label lbl:ptaClassifier.graph.getCache().getAlphabet())
      {
        if (ptaClassifier.model.predictionsMatrix.containsKey(new Trace(Arrays.asList(new Label[]{l1,lbl}),true)))
        {
          if (unique == null)
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

    {
      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

   */
  @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

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.