Ejemplo n.º 1
0
 public HTMColumnsViewer(HTMRegionAgent region, HTMRegionViewerPropertyShowed propertyShowed, int width, int height)
 {
     InitializeComponent();
     _region = region;
     _activeColumnBrush = new SolidBrush(Color.Blue);
     _inactiveColumnBrush = new SolidBrush(Color.White);
     _backgroundColor = Color.White;
     this.Width = width;
     this.Height = height + statLabel.Height + statLabel.Top;
     _bitmap = new Bitmap(width, height);
     _g = Graphics.FromImage(_bitmap);
     _g1 = this.CreateGraphics();
     _lastMouseClick = new Point();
     _propertyShowed = propertyShowed;
     statLabel.Text = propertyShowed.ToString();
 }
Ejemplo n.º 2
0
 public HTMColumnsViewer(HTMRegionAgent region, HTMRegionViewerPropertyShowed propertyShowed, int width, int height)
 {
     InitializeComponent();
     _region              = region;
     _activeColumnBrush   = new SolidBrush(Color.Blue);
     _inactiveColumnBrush = new SolidBrush(Color.White);
     _backgroundColor     = Color.White;
     this.Width           = width;
     this.Height          = height + statLabel.Height + statLabel.Top;
     _bitmap              = new Bitmap(width, height);
     _g              = Graphics.FromImage(_bitmap);
     _g1             = this.CreateGraphics();
     _lastMouseClick = new Point();
     _propertyShowed = propertyShowed;
     statLabel.Text  = propertyShowed.ToString();
 }
Ejemplo n.º 3
0
        public StatInfo GetStatInfo(HTMRegionViewerPropertyShowed property)
        {
            StatInfo statInfo = new StatInfo();

            double max = double.MinValue;
            double min = double.MaxValue;
            double val;

            switch (property)
            {
            case HTMRegionViewerPropertyShowed.ColumnActivation:
                break;

            case HTMRegionViewerPropertyShowed.ColumnPermanence:
                foreach (HTMColumn col in _columns)
                {
                    val = col.GetAveragePermanence();
                    if (val > max)
                    {
                        max = val;
                    }
                    if (val < min)
                    {
                        min = val;
                    }
                }
                break;

            case HTMRegionViewerPropertyShowed.ColumnOverlap:
                foreach (HTMColumn col in _columns)
                {
                    if (col.Overlap > max)
                    {
                        max = col.Overlap;
                    }
                    if (col.Overlap < min)
                    {
                        min = col.Overlap;
                    }
                }
                break;

            case HTMRegionViewerPropertyShowed.ColumnBoost:
                foreach (HTMColumn col in _columns)
                {
                    if (col.Boost > max)
                    {
                        max = col.Boost;
                    }
                    if (col.Boost < min)
                    {
                        min = col.Boost;
                    }
                }
                break;

            case HTMRegionViewerPropertyShowed.DistalSegmentsCount:
                int count;
                foreach (HTMColumn col in _columns)
                {
                    count = 0;
                    foreach (HTMCell cls in col.Cells)
                    {
                        count += cls.DistalSegments.Count;
                    }
                    if (count > max)
                    {
                        max = count;
                    }
                    if (count < min)
                    {
                        min = count;
                    }
                }
                break;

            default:
                break;
            }
            statInfo.Min = min;
            statInfo.Max = max;
            return(statInfo);
        }
Ejemplo n.º 4
0
        public StatInfo GetStatInfo(HTMRegionViewerPropertyShowed property)
        {
            StatInfo statInfo = new StatInfo();

            double max = double.MinValue;
            double min = double.MaxValue;
            double val;
            switch (property)
            {
                case HTMRegionViewerPropertyShowed.ColumnActivation:
                    break;
                case HTMRegionViewerPropertyShowed.ColumnPermanence:
                    foreach (HTMColumn col in _columns)
                    {
                        val = col.GetAveragePermanence();
                        if (val > max)
                            max = val;
                        if (val < min)
                            min = val;
                    }
                    break;
                case HTMRegionViewerPropertyShowed.ColumnOverlap:
                    foreach (HTMColumn col in _columns)
                    {
                        if (col.Overlap > max)
                            max = col.Overlap;
                        if (col.Overlap < min)
                            min = col.Overlap;
                    }
                    break;
                case HTMRegionViewerPropertyShowed.ColumnBoost:
                    foreach (HTMColumn col in _columns)
                    {
                        if (col.Boost > max)
                            max = col.Boost;
                        if (col.Boost < min)
                            min = col.Boost;
                    }
                    break;
                case HTMRegionViewerPropertyShowed.DistalSegmentsCount:
                    int count;
                    foreach (HTMColumn col in _columns)
                    {
                        count = 0;
                        foreach (HTMCell cls in col.Cells)
                            count += cls.DistalSegments.Count;
                        if (count > max)
                            max = count;
                        if (count < min)
                            min = count;
                    }
                    break;
                default:
                    break;
            }
            statInfo.Min = min;
            statInfo.Max = max;
            return statInfo;
        }