Ejemplo n.º 1
0
        public AfaStreamable(IStreamable <TKey, TPayload> source, Afa <TPayload, TRegister, TAccumulator> afa, long maxDuration)
            : base(source, source.Properties.Afa <TKey, TPayload, TRegister>())
        {
            Contract.Requires(source != null);

            afa.Seal();
            this.afa         = afa.Compile();
            this.MaxDuration = maxDuration;

            Initialize();
        }
Ejemplo n.º 2
0
 private static void EpsilonClosureHelper <TPayload, TRegister, TAccumulator>(CompiledAfa <TPayload, TRegister, TAccumulator> afa, int node, List <int> accumulator)
 {
     if (afa.epsilonStateMap[node] != null)
     {
         for (int i = 0; i < afa.epsilonStateMap[node].Length; i++)
         {
             var epsilonReachableNode = afa.epsilonStateMap[node][i];
             accumulator.Add(epsilonReachableNode);
             EpsilonClosureHelper(afa, epsilonReachableNode, accumulator);
         }
     }
     return;
 }
Ejemplo n.º 3
0
        protected static List <int> EpsilonClosure <TPayload, TRegister, TAccumulator>(CompiledAfa <TPayload, TRegister, TAccumulator> afa, int node)
        {
            var result = new List <int> {
                node,
            };

            if (afa.epsilonStateMap != null)
            {
                EpsilonClosureHelper(afa, node, result);
            }
            return(result);
        }