Exemplo n.º 1
0
 public bool Equals(StateWordPair pair)
 {
     if (this.automatState.Equals(pair.automatState) && this.word.Equals(pair.word))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
        // casov slozitost je O(A^2), kde A je pocet pojmenovanych asociaci v modelu
        private HashSet <AutomatState> sideFunction(HashSet <AutomatState> currentNodes, HashSet <String> readedLeftSides, String attributeValue)
        {
            HashSet <AutomatState> sideFunction = new HashSet <AutomatState>();

            foreach (AutomatState node in currentNodes)
            {
                foreach (String leftSide in readedLeftSides)
                {
                    StateWordPair stateWordPair = new StateWordPair(node.AutomatStateWithoutDepth, leftSide);
                    if (forestStatesTransitions.ContainsKey(stateWordPair))
                    {
                        // maximalne 2 iterace - pokud existuje nepojmenovana rekurze
                        foreach (AutomatEdge edge in forestStatesTransitions[stateWordPair])
                        {
                            if (!sideFunction.Contains(new AutomatState(node, edge), automatStateComparer) && matchType(edge.AttributeType, attributeValue))
                            {
                                sideFunction.Add(new AutomatState(node, edge));
                            }
                        }
                    }
                }
            }
            return(sideFunction);
        }