GetActive() public méthode

public GetActive ( int t ) : bool
t int
Résultat bool
Exemple #1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            _g.Clear(_backgroundColor);

            if (_region == null)
            {
                return;
            }

            int x1, y1, x2, y2;
            int width  = _bitmap.Width;
            int height = _bitmap.Height;

            _colSize = Math.Max(Math.Min(width / _region.Width, height / _region.Height) - 2, 2);

            foreach (HTMColumn col in _region.Columns)
            {
                x1 = (int)(col.X * (width - _colSize - 1));
                x2 = (int)(col.X * (width - _colSize - 1)) + _colSize;
                y1 = (int)(col.Y * (height - _colSize - 1));
                y2 = (int)(col.Y * (height - _colSize - 1)) + _colSize;

                HTMCell cell = col.Cells[_indexInColumn];
                if (cell.GetPredicting(0))
                {
                    //_g.FillEllipse(_predictiveCellBrush, x1, y1, x2 - x1, y2 - y1);
                    //_g.DrawEllipse(new Pen(new SolidBrush(Color.Black), 2), x1, y1, x2 - x1, y2 - y1);

                    _g.FillRectangle(_predictiveCellBrush, x1, y1, x2 - x1, y2 - y1);
                    _g.DrawRectangle(new Pen(new SolidBrush(Color.Black), 2), x1, y1, x2 - x1, y2 - y1);
                }
                else if (cell.GetLearning(0))
                {
                    //_g.FillEllipse(_learningCellBrush, x1, y1, x2 - x1, y2 - y1);
                    //_g.DrawEllipse(new Pen(new SolidBrush(Color.Black), 2), x1, y1, x2 - x1, y2 - y1);

                    _g.FillRectangle(_learningCellBrush, x1, y1, x2 - x1, y2 - y1);
                    _g.DrawRectangle(new Pen(new SolidBrush(Color.Black), 2), x1, y1, x2 - x1, y2 - y1);
                }
                else if (cell.GetActive(0))
                {
                    //    _g.DrawEllipse(new Pen(new SolidBrush(Color.Black), 2), x1, y1, x2 - x1, y2 - y1);

                    _g.DrawRectangle(new Pen(new SolidBrush(Color.Black), 2), x1, y1, x2 - x1, y2 - y1);
                }
                else
                {
                    //_g.DrawEllipse(new Pen(new SolidBrush(Color.Black)), x1, y1, x2 - x1, y2 - y1);

                    _g.DrawRectangle(new Pen(new SolidBrush(Color.Black)), x1, y1, x2 - x1, y2 - y1);
                }
            }
            _g1.DrawImageUnscaled(_bitmap, 0, layerLabel.Height + layerLabel.Top);

            // TO DO : move in other method!
            foreach (HTMCellViewer cellViewer in _cellViewers)
            {
                cellViewer.UpdateView();
            }
        }
Exemple #2
0
 // Return the active state at time t.
 public bool GetActive(int t, bool learning, bool connectedOnly)
 {
     return(_inputCell.GetActive(t) && (_inputCell.GetLearning(t) || !learning) && (GetConnected() || !connectedOnly));
 }