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
ae56b931
Commit
ae56b931
authored
5 years ago
by
Kappes Marques Rodrigo
Browse files
Options
Downloads
Patches
Plain Diff
added mutation method
parent
59c403af
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
algogenetique.py
+3
-3
3 additions, 3 deletions
algogenetique.py
individu.py
+14
-2
14 additions, 2 deletions
individu.py
with
17 additions
and
5 deletions
algogenetique.py
+
3
−
3
View file @
ae56b931
...
...
@@ -23,15 +23,15 @@ def main(N,tmax,pmutation, proportion,brin="plasmid_8k.fasta"):
if
individu
.
score
>
max
:
best
=
individu
max
=
individu
.
score
L
.
append
(
max
)
print
(
i
,
"
:
"
,
max
)
L
.
append
(
1
/
max
)
print
(
i
,
"
:
"
,
1
/
max
)
plt
.
plot
([
i
for
i
in
range
(
tmax
)],
L
)
plt
.
show
()
return
(
best
,
People
)
best
,
People
=
main
(
60
,
100
,
0.
0
1
,
2
0
)
best
,
People
=
main
(
60
,
5
,
0.1
,
3
0
)
traj
=
Traj3D
()
traj
.
compute
(
best
.
brin
,
best
.
table
)
traj
.
draw
(
"
plot
"
)
...
...
This diff is collapsed.
Click to expand it.
individu.py
+
14
−
2
View file @
ae56b931
...
...
@@ -45,7 +45,7 @@ class Individu():
return
1
/
max
(
list_distance
)
def
mutation
(
self
,
proba
=
P1
):
def
mutation
_with_numbers
(
self
,
proba
=
P1
):
table_rotations
=
self
.
table
.
rot_table
number_of_mutations
=
5
for
i
in
range
(
0
,
number_of_mutations
):
...
...
@@ -66,7 +66,19 @@ class Individu():
#sur l'axe z il y a un moins
table_rotations
[
doublet2
][
coord
]
=
-
table_rotations
[
doublet
][
coord
]
def
mutation
(
self
,
proba
=
P1
):
table_rotations
=
self
.
table
.
rot_table
for
doublet
in
table_rotations
:
for
coord
in
range
(
3
):
tir
=
random
()
if
tir
<
proba
:
table_rotations
[
doublet
][
coord
]
=
np
.
random
.
uniform
(
low
=
self
.
table
.
orta
()[
doublet
][
coord
]
-
self
.
table
.
orta
()[
doublet
][
coord
+
3
],
high
=
self
.
table
.
orta
()[
doublet
][
coord
]
+
self
.
table
.
orta
()[
doublet
][
coord
+
3
])
doublet2
=
self
.
table
.
corr
()[
doublet
]
if
coord
==
0
or
coord
==
1
:
table_rotations
[
doublet2
][
coord
]
=
table_rotations
[
doublet
][
coord
]
else
:
#sur l'axe z il y a un moins
table_rotations
[
doublet2
][
coord
]
=
-
table_rotations
[
doublet
][
coord
]
# individu1 = Individu(RotTable())
# print(individu1.table.rot_table)
# individu1.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