Ejemplo n.º 1
0
        protected int FindMinimizedDFATransformation()
        {
            int lSmallestTranslationSize    = Int32.MaxValue;
            int lMinimizedDFATransformation = 0;

            for (int t = 0; t < 8; t++)
            {
                DFAPattern lDFAPattern = new DFAPattern(Pattern, t);

                if (lDFAPattern.VariationCount < lSmallestTranslationSize)
                {
                    lSmallestTranslationSize    = lDFAPattern.VariationCount;
                    lMinimizedDFATransformation = t;
                }
            }

            return(lMinimizedDFATransformation);
        }
        public void Add(Pattern pattern)
        {
            if (!pattern.IsOk())
            {
                return;
            }

            List <string> lPatternSignatures = new List <string>(8);

            for (int lTransform = 0; lTransform < 8; lTransform++)
            {
                string lSignature = DFAPattern.ToDFA(pattern, lTransform) + "\t" + DFAPattern.ToVariableDFA(pattern, lTransform);

                if (!lPatternSignatures.Contains(lSignature))
                {
                    DFAMatrixes.Push(new DFAMatrix(new PatternKey(pattern, lTransform)));
                    lPatternSignatures.Add(lSignature);
                }
            }
        }
Ejemplo n.º 3
0
        protected int FindMinimizedDFATransformation()
        {
            int lSmallestTranslationSize = Int32.MaxValue;
            int lMinimizedDFATransformation = 0;

            for (int t = 0; t < 8; t++)
            {
                DFAPattern lDFAPattern = new DFAPattern(Pattern, t);

                if (lDFAPattern.VariationCount < lSmallestTranslationSize)
                {
                    lSmallestTranslationSize = lDFAPattern.VariationCount;
                    lMinimizedDFATransformation = t;
                }
            }

            return lMinimizedDFATransformation;
        }