Beispiel #1
0
        public Neuron(ProcessorContainer pc)
        {
            if (pc == null)
            {
                throw new ArgumentNullException();
            }
            if (pc.Count > char.MaxValue)
            {
                throw new ArgumentException();
            }

            _procNames = new Dictionary <char, char>(pc.Count);
            ProcessorHandler ph = new ProcessorHandler();
            StringBuilder    sb = new StringBuilder(pc.Count);

            for (char k = char.MinValue; k < pc.Count; ++k)
            {
                if (!ph.Add(ProcessorHandler.RenameProcessor(pc[k], new string(k, 1))))
                {
                    continue;
                }
                char c = char.ToUpper(pc[k].Tag[0]);
                _procNames[c] = k;
                sb.Append(c);
            }

            _processorContainer = ph.Processors;
            _workReflex         = new Reflex(_processorContainer);
            _stringQuery        = sb.ToString();
        }
Beispiel #2
0
 public Processor this[int index]
 {
     get
     {
         Processor p = _processorContainer[index];
         return(ProcessorHandler.RenameProcessor(p, _stringQuery[p.Tag[0]].ToString()));
     }
 }
Beispiel #3
0
 IEnumerable <Processor> GetNewProcessors(Reflex start, Reflex finish)
 {
     if (start == null)
     {
         throw new ArgumentNullException();
     }
     if (finish == null)
     {
         throw new ArgumentNullException();
     }
     for (int k = start.Count; k < finish.Count; ++k)
     {
         Processor p = finish[k];
         yield return(ProcessorHandler.RenameProcessor(p, _stringQuery[p.Tag[0]].ToString()));
     }
 }