Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EI Jeux Evolutionnaires
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Santos Garcia Carlos
EI Jeux Evolutionnaires
Commits
adef402c
Commit
adef402c
authored
5 years ago
by
Muller Sacha
Browse files
Options
Downloads
Patches
Plain Diff
Comparaisons en odg sur le brin de 8000
parent
b2ee982f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
algogenetique.py
+17
-22
17 additions, 22 deletions
algogenetique.py
population.py
+0
-8
0 additions, 8 deletions
population.py
with
17 additions
and
30 deletions
algogenetique.py
+
17
−
22
View file @
adef402c
...
...
@@ -8,7 +8,7 @@ import croisement
from
Traj3D
import
*
from
random
import
random
import
matplotlib.pyplot
as
plt
import
time
# def main(N,tmax,pmutation, proportion,brin="plasmid_8k.fasta"):
# '''lineList = [line.rstrip('\n') for line in open(brin)]
...
...
@@ -29,25 +29,6 @@ import matplotlib.pyplot as plt
# plt.plot([i for i in range(tmax)], L, label = str(pmutation))
# return(best)
def
test_mutation
():
plt
.
figure
()
for
i
in
range
(
10
):
print
(
"
\n
\n
"
,
i
)
main
(
100
,
100
,
i
/
50
,
50
)
plt
.
legend
()
plt
.
xlabel
(
"
Nombre de générations
"
)
plt
.
ylabel
(
"
Score du meilleur individu
"
)
plt
.
title
(
"
Comparaison en fonction du taux de mutation
"
)
plt
.
show
()
import
time
# Debut du decompte du temps
start_time
=
time
.
time
()
test_mutation
()
def
main
(
N
,
tmax
,
pmutation
,
proportion
):
L
=
[]
...
...
@@ -96,5 +77,19 @@ def main(N,tmax,pmutation, proportion):
# test.draw("first_plot")
# Affichage du temps d execution
print
(
"
Temps d
'
execution : %s secondes
"
%
(
time
.
time
()
-
start_time
))
def
test_mutation
():
plt
.
figure
()
for
i
in
range
(
1
,
5
):
print
(
"
\n
\n
"
,
i
)
main
(
100
,
40
,
10
**
(
-
i
),
50
)
plt
.
legend
()
plt
.
xlabel
(
"
Nombre de générations
"
)
plt
.
ylabel
(
"
Score du meilleur individu
"
)
plt
.
title
(
"
Comparaison en fonction du taux de mutation
"
)
print
(
"
Temps d
'
execution : %s secondes
"
%
(
time
.
time
()
-
start_time
))
plt
.
show
()
start_time
=
time
.
time
()
test_mutation
()
This diff is collapsed.
Click to expand it.
population.py
+
0
−
8
View file @
adef402c
...
...
@@ -67,11 +67,7 @@ class Population:
p
=
(
self
.
n
)
//
2
meilleur
=
self
.
indiv
[
0
]
for
individu
in
self
.
indiv
:
<<<<<<<
HEAD
if
meilleur
.
score
<
individu
.
score
:
=======
if
meilleur
.
score
>
individu
.
score
:
>>>>>>>
69e8
a061d6fd93996d67f8b97e2c0e9d1e93f60a
print
(
"
meilleur, individu:
"
,
meilleur
.
score
,
individu
.
score
)
meilleur
=
individu
newself
=
[
meilleur
]
...
...
@@ -87,11 +83,7 @@ class Population:
x
=
self
.
indiv
[
m
]
y
=
self
.
indiv
[
t
]
<<<<<<<
HEAD
if
x
.
score
>=
y
.
score
:
=======
if
x
.
score
<
y
.
score
:
>>>>>>>
69e8
a061d6fd93996d67f8b97e2c0e9d1e93f60a
newself
.
append
(
x
)
else
:
newself
.
append
(
y
)
...
...
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