Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
easea
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Arnaud Kress
easea
Commits
68e60f94
Commit
68e60f94
authored
Apr 08, 2014
by
Joseph Pallamidessi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an issue where the correct pressures for the offsprings and parents reduction were not used/set
parent
fca1c208
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
libeasea/CPopulation.cpp
libeasea/CPopulation.cpp
+5
-5
libeasea/include/CPopulation.h
libeasea/include/CPopulation.h
+2
-3
No files found.
libeasea/CPopulation.cpp
View file @
68e60f94
...
...
@@ -145,10 +145,10 @@ void CPopulation::optimiseOffspringPopulation(){
*/
void
CPopulation
::
reducePopulation
(
CIndividual
**
population
,
unsigned
populationSize
,
CIndividual
**
reducedPopulation
,
unsigned
obSize
,
CSelectionOperator
*
replacementOperator
){
CSelectionOperator
*
replacementOperator
,
int
pressure
){
replacementOperator
->
initialize
(
population
,
replacementP
ressure
,
populationSize
);
replacementOperator
->
initialize
(
population
,
p
ressure
,
populationSize
);
for
(
unsigned
i
=
0
;
i
<
obSize
;
i
++
){
...
...
@@ -177,7 +177,7 @@ CIndividual** CPopulation::reduceParentPopulation(unsigned obSize){
nextGeneration
=
new
CIndividual
*
[
obSize
];
reducePopulation
(
parents
,
actualParentPopulationSize
,
nextGeneration
,
obSize
,
CPopulation
::
parentReductionOperator
);
CPopulation
::
parentReductionOperator
,
parentReductionPressure
);
// free no longer needed CIndividuals
for
(
unsigned
i
=
0
;
i
<
actualParentPopulationSize
-
obSize
;
i
++
)
...
...
@@ -199,7 +199,7 @@ CIndividual** CPopulation::reduceOffspringPopulation(unsigned obSize){
CIndividual
**
nextGeneration
=
new
CIndividual
*
[
offspringPopulationSize
];
reducePopulation
(
offsprings
,
actualOffspringPopulationSize
,
nextGeneration
,
obSize
,
CPopulation
::
offspringReductionOperator
);
CPopulation
::
offspringReductionOperator
,
offspringReductionPressure
);
//printf("POPULATION SIZE %d\n",actualOffspringPopulationSize-obSize);
// free no longer needed CIndividuals
...
...
@@ -296,7 +296,7 @@ void CPopulation::reduceTotalPopulation(CIndividual** elitPop){
replacementOperator
->
initialize
(
globalPopulation
,
replacementPressure
,
actualGlobalSize
);
CPopulation
::
reducePopulation
(
globalPopulation
,
actualGlobalSize
,
params
->
elitSize
+
nextGeneration
,
parentPopulationSize
-
params
->
elitSize
,
replacementOperator
);
parentPopulationSize
-
params
->
elitSize
,
replacementOperator
,
replacementPressure
);
for
(
unsigned
int
i
=
0
;
i
<
((
int
)
actualGlobalSize
+
params
->
elitSize
)
-
(
int
)
parentPopulationSize
;
i
++
)
...
...
libeasea/include/CPopulation.h
View file @
68e60f94
...
...
@@ -78,8 +78,7 @@ public:
virtual
void
evaluateOffspringPopulation
();
virtual
void
optimiseOffspringPopulation
();
CIndividual
**
reducePopulations
(
CIndividual
**
population
,
unsigned
populationSize
,
CIndividual
**
reducedPopulation
,
unsigned
obSize
);
CIndividual
**
reducePopulations
(
CIndividual
**
population
,
unsigned
populationSize
,
CIndividual
**
reducedPopulation
,
unsigned
obSize
,
int
pressure
);
CIndividual
**
reduceParentPopulation
(
unsigned
obSize
);
CIndividual
**
reduceOffspringPopulation
(
unsigned
obSize
);
void
reduceTotalPopulation
(
CIndividual
**
elitPop
);
...
...
@@ -118,7 +117,7 @@ public:
static
void
reducePopulation
(
CIndividual
**
population
,
unsigned
populationSize
,
CIndividual
**
reducedPopulation
,
unsigned
obSize
,
CSelectionOperator
*
replacementOperator
);
CSelectionOperator
*
replacementOperator
,
int
pressure
);
void
syncOutVector
();
void
syncInVector
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment