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
a5d79180
Commit
a5d79180
authored
5 years ago
by
Gauthier Roy
Browse files
Options
Downloads
Plain Diff
Merge branch 'gauthier'
parents
269d5be2
3874ae39
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
individu.py
+33
-0
33 additions, 0 deletions
individu.py
with
33 additions
and
0 deletions
individu.py
+
33
−
0
View file @
a5d79180
from
table_rotation
import
table_rotation
from
traj3D
import
*
import
numpy
as
np
from
math
import
sqrt
class
Individu
():
def
__init__
(
self
,
rot_table
):
self
.
rot_table
=
rot_table
self
.
score
=
None
def
evaluate
(
self
,
brin
):
traj
=
Traj3D
()
traj
.
compute
(
brin
,
self
.
rot_table
)
traj_array
=
np
.
array
(
traj
.
getTraj
())
first_nucleotide
=
traj_array
[
0
,
:]
last_nucleotide
=
traj_array
[
-
1
,
:]
distance
=
sqrt
(
sum
((
last_nucleotide
-
last_nucleotide
)
**
2
))
first_name
=
brin
[
0
]
last_name
=
brin
[
-
1
]
rot_computed
=
rot_table
[
last_name
+
first_name
]
rot_traj
=
first_name
-
last_name
diff_angle
=
sum
(
abs
(
rot_computed
-
rot_traj
))
self
.
score
=
1
/
(
distance
+
diff_angle
)
def
mutation
(
self
):
return
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