GENEIAL  0.2=/
 All Classes Pages
BaseReplacementSettings.h
1 #pragma once
2 
3 #include <geneial/namespaces.h>
4 
5 geneial_private_namespace(geneial)
6 {
7 geneial_private_namespace(operation)
8 {
9 geneial_private_namespace(replacement)
10 {
11 
12 geneial_export_namespace
13 {
14 class BaseReplacementSettings
15 {
16 
17 public:
23  typedef enum
24  {
25  REPLACE_ALL_OFFSPRING, REPLACE_FIXED_NUMBER
26  } replace_offspring_mode;
27 
28  static const BaseReplacementSettings::replace_offspring_mode DEFAULT_REPLACEMENT_MODE = BaseReplacementSettings::REPLACE_ALL_OFFSPRING;
29  static const unsigned int DEFAULT_AMOUNT_TO_REPLACE = 0;
30  static const unsigned int DEFAULT_AMOUNT_ELTISIM = 1;
31 
32  BaseReplacementSettings():
33  _mode(DEFAULT_REPLACEMENT_MODE),
34  _amountToReplace(DEFAULT_AMOUNT_TO_REPLACE),
35  _amountElitism(DEFAULT_AMOUNT_ELTISIM)
36  {
37  }
38 
39 
40  explicit BaseReplacementSettings(const replace_offspring_mode mode, const unsigned int amountToReplace = 0, const unsigned int amountElitism =
41  0) :
42  _mode(mode), _amountToReplace(amountToReplace), _amountElitism(amountElitism)
43  {
44  }
45 
46  unsigned int getAmountToReplace() const
47  {
48  return _amountToReplace;
49  }
50 
51  void setAmountToReplace(const unsigned int amountToReplace)
52  {
53  _amountToReplace = amountToReplace;
54  }
55 
56  replace_offspring_mode getMode() const
57  {
58  return _mode;
59  }
60 
61  void setMode(const replace_offspring_mode mode)
62  {
63  _mode = mode;
64  }
65 
66  unsigned int getAmountElitism() const
67  {
68  return _amountElitism;
69  }
70 
71  void setAmountElitism(const unsigned int amountElitism)
72  {
73  _amountElitism = amountElitism;
74  }
75 private:
76  replace_offspring_mode _mode;
77  unsigned int _amountToReplace;
78  unsigned int _amountElitism;
79 
80 };
81 
82 } /* geneial_export_namespace */
83 } /* private namespace replacement */
84 } /* private namespace operation */
85 } /* private namespace geneial */