Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/DriftDetection/SequentialADWIN.cs @ 17479

Last change on this file since 17479 was 17479, checked in by kyang, 4 years ago

#3057

  1. upload the latest version of ALPS with SMS-EMOA
  2. upload the related dynamic test problems (dynamic, single-objective symbolic regression), written by David Daninel.
File size: 1.1 KB
Line 
1using HEAL.Attic;
2using System;
3using System.Collections.Generic;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7
8namespace HeuristicLab.Algorithms.OESRALPS.DriftDetection
9{
10    [StorableType("714CA0E4-A88F-44D1-A2D0-92F4D8251C04")]
11    public class SequentialADWIN : ADWIN
12    {
13        public SequentialADWIN() { }
14
15        public SequentialADWIN(double delta, int minKeepSize = 100, int minCutSize = 100)
16            : base(delta, minKeepSize, minCutSize)
17        {
18        }
19
20        public override bool Execute(ref Histogram histogram)
21        {
22            bool tryToFindCut = true;
23            bool cutFound = false;
24            while (tryToFindCut)
25            {
26                tryToFindCut = false;           
27                if (CheckHistogramForCut(histogram, histogram.GetEnumerator(), histogram.NumBuckets - 1))
28                {
29                    histogram.RemoveBuckets(1);
30                    tryToFindCut = true;
31                    cutFound = true;
32                }
33            }
34            return cutFound;
35        }
36
37        public override void Terminate()
38        {
39        }
40    }
41}
Note: See TracBrowser for help on using the repository browser.