Example #1
0
        private void PaintNeuron(Neuron neuron, Graphics g, int top, int left)
        {
            _neuralPosition.Add(neuron, new Point(left, top));

            Brush brush = _neuralBrush;

            if (neuron is TresholdNeuron)
            {
                brush = _treshHoldNeuralBrush;
            }

            if (neuron is OutputNeuron)
            {
                var n = neuron as OutputNeuron;
                brush = n.DesiredValue < 1.0 ? _outputNeuralBrush : _outputHighBruh;
                g.FillEllipse(brush, left, top, 15, 15);
                g.DrawString(n.ToString(), _fontForNeuralValue, brush, (float)left + 10, (float)top + 20);
            }

            else
            {
                g.FillEllipse(brush, left, top, 15, 15);
                g.DrawString(neuron.ToString(), _fontForNeuralValue, _neuralValueBrush, (float)left + 10, (float)top + 20);
            }

            // g.DrawString(neuron.Index.ToString(), _font, _neuralBrush, (float)left + 10, (float)top + 32);
        }