-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeplacement_tete_de_lecture.py
28 lines (16 loc) · 1 KB
/
deplacement_tete_de_lecture.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from fonction import *
def deplacement_t(frame_lecture, lecture, direction_lecture, nombre_de_frame,
sens_lecture, nb_frame_min_changement_lecture, probabilite_direction, liste_proba, indice_proba, compteur_de_frame):
duree_lecture_changement = compteur_de_frame - frame_lecture
if lecture >= 0 and lecture <= nombre_de_frame - 1 and \
duree_lecture_changement > nb_frame_min_changement_lecture:
# Tirage tête de lecture
tirage_sens_lecture = tirage(liste_proba[indice_proba])
tirage_direction_lecture = tirage(probabilite_direction)
if tirage_sens_lecture:
sens_lecture = -sens_lecture
frame_lecture = compteur_de_frame
if tirage_direction_lecture:
sens_lecture = direction_lecture
frame_lecture = compteur_de_frame
return lecture, sens_lecture, direction_lecture, frame_lecture