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
7e47e04b
Commit
7e47e04b
authored
5 years ago
by
Kappes Marques Rodrigo
Browse files
Options
Downloads
Patches
Plain Diff
Resolved the problem of losing the best players
parent
2de42490
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
__pycache__/RotTable.cpython-37.pyc
+0
-0
0 additions, 0 deletions
__pycache__/RotTable.cpython-37.pyc
__pycache__/Traj3D.cpython-37.pyc
+0
-0
0 additions, 0 deletions
__pycache__/Traj3D.cpython-37.pyc
algogenetique.py
+1
-1
1 addition, 1 deletion
algogenetique.py
population.py
+6
-4
6 additions, 4 deletions
population.py
with
7 additions
and
5 deletions
__pycache__/RotTable.cpython-37.pyc
+
0
−
0
View file @
7e47e04b
No preview for this file type
This diff is collapsed.
Click to expand it.
__pycache__/Traj3D.cpython-37.pyc
+
0
−
0
View file @
7e47e04b
No preview for this file type
This diff is collapsed.
Click to expand it.
algogenetique.py
+
1
−
1
View file @
7e47e04b
...
@@ -32,7 +32,7 @@ def main(N,tmax,pmutation, proportion,brin="plasmid_8k.fasta"):
...
@@ -32,7 +32,7 @@ def main(N,tmax,pmutation, proportion,brin="plasmid_8k.fasta"):
return
(
best
)
return
(
best
)
main
(
100
,
100
,
0
.1
,
50
)
main
(
100
,
100
,
0
,
50
)
This diff is collapsed.
Click to expand it.
population.py
+
6
−
4
View file @
7e47e04b
...
@@ -3,6 +3,7 @@ from random import *
...
@@ -3,6 +3,7 @@ from random import *
from
individu
import
Individu
from
individu
import
Individu
from
RotTable
import
RotTable
from
RotTable
import
RotTable
from
croisement
import
croisement_un_point
,
croisement_deux_points
from
croisement
import
croisement_un_point
,
croisement_deux_points
import
copy
class
Population
:
class
Population
:
def
__init__
(
self
,
n
):
def
__init__
(
self
,
n
):
...
@@ -13,6 +14,9 @@ class Population:
...
@@ -13,6 +14,9 @@ class Population:
"""
Fonction qui renvoie une nouvelle instance de population a partir d
'
une liste d
'
individus
"""
"""
Fonction qui renvoie une nouvelle instance de population a partir d
'
une liste d
'
individus
"""
self
.
n
=
len
(
liste_individus
)
self
.
n
=
len
(
liste_individus
)
self
.
indiv
=
liste_individus
self
.
indiv
=
liste_individus
for
i
in
range
(
0
,
self
.
n
):
self
.
indiv
[
i
].
evaluate
(
"
AAAGGATCTTCTTGAGATCCTTTTTTTCTGCGCGTAATCTGCTGCCAGTAAACGAAAAAACCGCCTGGGGAGGCGGTTTAGTCGAA
"
)
return
self
return
self
def
selection_p_best
(
self
,
p
=
None
):
def
selection_p_best
(
self
,
p
=
None
):
...
@@ -83,8 +87,6 @@ class Population:
...
@@ -83,8 +87,6 @@ class Population:
newself
.
append
(
x
)
newself
.
append
(
x
)
else
:
else
:
newself
.
append
(
y
)
newself
.
append
(
y
)
for
i
in
range
(
0
,
len
(
newself
)):
print
(
newself
[
i
].
score
)
self
=
self
.
modifier_population
(
newself
)
self
=
self
.
modifier_population
(
newself
)
...
@@ -161,8 +163,8 @@ class Population:
...
@@ -161,8 +163,8 @@ class Population:
while
len
(
newself
)
<
vieille_taille
:
while
len
(
newself
)
<
vieille_taille
:
m
=
randrange
(
0
,
self
.
n
)
m
=
randrange
(
0
,
self
.
n
)
t
=
randrange
(
0
,
self
.
n
)
t
=
randrange
(
0
,
self
.
n
)
x
=
newself
[
m
]
x
=
copy
.
deepcopy
(
newself
[
m
]
)
y
=
newself
[
t
]
y
=
copy
.
deepcopy
(
newself
[
t
]
)
couple_enfant
=
enfant
(
x
,
y
)
couple_enfant
=
enfant
(
x
,
y
)
for
child
in
couple_enfant
:
for
child
in
couple_enfant
:
child
.
mutation
(
proba_mutation
)
child
.
mutation
(
proba_mutation
)
...
...
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