Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aevol-eukaryotes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LUISELLI Juliette
aevol-eukaryotes
Commits
38942439
Commit
38942439
authored
2 years ago
by
David Parsons
Browse files
Options
Downloads
Patches
Plain Diff
move fn defs to .cpp
parent
0c9fbdf3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libaevol/7/fuzzy/FuzzyFactory_7.cpp
+30
-0
30 additions, 0 deletions
src/libaevol/7/fuzzy/FuzzyFactory_7.cpp
src/libaevol/7/fuzzy/FuzzyFactory_7.h
+6
-30
6 additions, 30 deletions
src/libaevol/7/fuzzy/FuzzyFactory_7.h
with
36 additions
and
30 deletions
src/libaevol/7/fuzzy/FuzzyFactory_7.cpp
+
30
−
0
View file @
38942439
...
@@ -31,6 +31,29 @@
...
@@ -31,6 +31,29 @@
#include
"Vector_Fuzzy.h"
#include
"Vector_Fuzzy.h"
#include
"Discrete_Double_Fuzzy.h"
#include
"Discrete_Double_Fuzzy.h"
namespace
aevol
{
namespace
aevol
{
FuzzyFactory_7
::
FuzzyFactory_7
(
FuzzyFlavor
flavor
,
int
pool_size
,
int
sampling
,
int
pop_size
)
{
flavor_
=
flavor
;
pool_size_
=
pool_size
;
if
(
flavor_
==
FuzzyFlavor
::
DISCRETE_DOUBLE_TABLE
)
{
PHENOTYPE_VECTOR_SIZE
=
sampling
;
D_PHENOTYPE_VECTOR_SIZE
=
((
double
)
sampling
);
}
init
(
pop_size
);
}
FuzzyFactory_7
::~
FuzzyFactory_7
()
{
for
(
auto
&&
it_fuzzy
:
list_unused_fuzzy_
)
{
delete
it_fuzzy
;
}
for
(
int
i
=
0
;
i
<
nb_local_pool
;
i
++
)
for
(
auto
&&
it_fuzzy
:
local_list_unused_fuzzy_
[
i
])
{
delete
it_fuzzy
;
}
list_unused_fuzzy_
.
clear
();
}
AbstractFuzzy_7
*
FuzzyFactory_7
::
createFuzzy
()
{
AbstractFuzzy_7
*
FuzzyFactory_7
::
createFuzzy
()
{
AbstractFuzzy_7
*
fuzz
=
nullptr
;
AbstractFuzzy_7
*
fuzz
=
nullptr
;
switch
(
flavor_
)
switch
(
flavor_
)
...
@@ -77,6 +100,13 @@ namespace aevol {
...
@@ -77,6 +100,13 @@ namespace aevol {
}
}
}
}
void
FuzzyFactory_7
::
stats
()
{
int
total_length_
=
((
flavor_
==
FuzzyFlavor
::
DISCRETE_DOUBLE_TABLE
)
?
PHENOTYPE_VECTOR_SIZE
:
1
)
*
list_unused_fuzzy_
.
size
();
printf
(
"FUZZY_FACTORY_STATS -- Number of Fuzzys %ld - Combined size %d elements
\n
"
,
list_unused_fuzzy_
.
size
(),
total_length_
);
}
AbstractFuzzy_7
*
FuzzyFactory_7
::
get_fuzzy
()
{
AbstractFuzzy_7
*
FuzzyFactory_7
::
get_fuzzy
()
{
AbstractFuzzy_7
*
pop
=
nullptr
;
AbstractFuzzy_7
*
pop
=
nullptr
;
...
...
This diff is collapsed.
Click to expand it.
src/libaevol/7/fuzzy/FuzzyFactory_7.h
+
6
−
30
View file @
38942439
...
@@ -55,40 +55,16 @@ std::string to_string(const FuzzyFlavor& ff) {
...
@@ -55,40 +55,16 @@ std::string to_string(const FuzzyFlavor& ff) {
class
FuzzyFactory_7
{
class
FuzzyFactory_7
{
public:
public:
FuzzyFactory_7
(
FuzzyFlavor
flavor
,
int
pool_size
,
int
sampling
,
int
pop_size
=
-
1
)
{
FuzzyFactory_7
(
FuzzyFlavor
flavor
,
int
pool_size
,
int
sampling
,
int
pop_size
=
-
1
);
flavor_
=
flavor
;
~
FuzzyFactory_7
();
// printf("FuzzyFactory %d\ n",flavor_);
pool_size_
=
pool_size
;
void
stats
();
if
(
flavor_
==
FuzzyFlavor
::
DISCRETE_DOUBLE_TABLE
)
{
PHENOTYPE_VECTOR_SIZE
=
sampling
;
D_PHENOTYPE_VECTOR_SIZE
=
((
double
)
sampling
);
// printf("SAMPLING %d :: %d\n",sampling,PHENOTYPE_VECTOR_SIZE);
}
init
(
pop_size
);
}
~
FuzzyFactory_7
()
{
for
(
auto
&&
it_fuzzy
:
list_unused_fuzzy_
)
{
delete
it_fuzzy
;
}
for
(
int
i
=
0
;
i
<
nb_local_pool
;
i
++
)
for
(
auto
&&
it_fuzzy
:
local_list_unused_fuzzy_
[
i
])
{
delete
it_fuzzy
;
}
list_unused_fuzzy_
.
clear
();
}
void
init
(
int
pop_size
);
void
init
(
int
pop_size
);
void
stats
()
{
int
total_length_
=
((
flavor_
==
FuzzyFlavor
::
DISCRETE_DOUBLE_TABLE
)
?
PHENOTYPE_VECTOR_SIZE
:
1
)
*
list_unused_fuzzy_
.
size
();
printf
(
"FUZZY_FACTORY_STATS -- Number of Fuzzys %ld - Combined size %d elements
\n
"
,
list_unused_fuzzy_
.
size
(),
total_length_
);
}
AbstractFuzzy_7
*
get_fuzzy
();
AbstractFuzzy_7
*
get_fuzzy
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment