GENEIAL  0.2=/
 All Classes Pages
MultiValueChromosomeNPointCrossoverSettings.h
1 #pragma once
2 
3 #include <geneial/namespaces.h>
4 
5 #include <cassert>
6 
7 geneial_private_namespace(geneial)
8 {
9 geneial_private_namespace(operation)
10 {
11 geneial_private_namespace(crossover)
12 {
13 using ::geneial::population::Population;
14 using ::geneial::population::chromosome::MultiValueChromosome;
15 using ::geneial::operation::coupling::BaseCouplingOperation;
16 
17 geneial_export_namespace
18 {
19 class MultiValueChromosomeNPointCrossoverSettings
20 {
21 public:
22 
55  typedef enum
56  {
57  RANDOM_WIDTH, RANDOM_MIN_WIDTH, EQUIDISTANT_WIDTH
58  } width_settings;
59 
60  MultiValueChromosomeNPointCrossoverSettings(const unsigned int crossOverPoints, const width_settings width_setting,
61  const unsigned int min_width = 1) :
62  _crossOverPoints(crossOverPoints), _width_setting(width_setting), _min_width(min_width)
63  {
64  assert(crossOverPoints > 0);
65  assert(width_setting != RANDOM_MIN_WIDTH || min_width > 1);
66  }
67 
68  virtual ~MultiValueChromosomeNPointCrossoverSettings()
69  {
70  }
71 
72  unsigned int getCrossOverPoints() const
73  {
74  return _crossOverPoints;
75  }
76 
77  void setCrossOverPoints(const unsigned int crossOverPoints)
78  {
79  _crossOverPoints = crossOverPoints;
80  }
81 
82  unsigned int getMinWidth() const
83  {
84  return _min_width;
85  }
86 
87  void setMinWidth(const unsigned int minWidth)
88  {
89  _min_width = minWidth;
90  }
91 
92  width_settings getWidthSetting() const
93  {
94  return _width_setting;
95  }
96 
97  void setWidthSetting(const width_settings widthSetting)
98  {
99  _width_setting = widthSetting;
100  }
101 
102 private:
103  unsigned int _crossOverPoints;
104  width_settings _width_setting;
105  unsigned int _min_width;
106 
107 };
108 
109 } /* geneial_export_namespace */
110 } /* private namespace crossover */
111 } /* private namespace operation */
112 } /* private namespace geneial */