Free cookie consent management tool by TermsFeed Policy Generator

source: branches/ichiriac/HeuristicLab.Algorithms.GDE3/SolutionSet.cs @ 15838

Last change on this file since 15838 was 13849, checked in by ichiriac, 9 years ago

Constrained test function

Check for constrained test function and evaluated the constraints violations
Add to dominance comparator also constraints violations

File size: 1.5 KB
RevLine 
[13749]1using System;
2using System.Linq;
3using System.Collections.Generic;
4using HeuristicLab.Encodings.RealVectorEncoding;
5
6namespace HeuristicLab.Algoritms.GDE3
7{
8    public class SolutionSet
9    {
10        private RealVector population;
11        private double[] quality;
12        private double crowdingDistance;
13        private double rank;
[13849]14        private double overallConstrainViolation;
15        public int populationSize;
[13749]16
[13849]17        //constructor set size equal with population size
18        public SolutionSet(int populationSize)
19        {
20            this.populationSize = populationSize;
21        }
22
[13749]23        public double CrowdingDistance
24        {
25            get { return crowdingDistance; }
26            set { crowdingDistance = value; }
27        }
28
29        public double Rank
30        {
31            get { return rank; }
32            set { rank = value; }
33        }
34
35        public RealVector Population
36        {
37            get { return population; }
38            set { population = value; }
39        }
40
41        public double[] Quality
42        {
43            get { return quality; }
44            set { quality = value; }
45        }
46
[13849]47        public double OverallConstrainViolation
48        {
49            get { return overallConstrainViolation; }
50            set { overallConstrainViolation = value; }
[13749]51        }
52
53        public SolutionSet createSolution(double[] v)
54        {
55            this.population = new RealVector(v);
56            return this;
57        }
58    }
59}
Note: See TracBrowser for help on using the repository browser.