last ubuntu
BIN
gipps V2 (modélisation)/V1-1.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
gipps V2 (modélisation)/V1-2.png
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
gipps V2 (modélisation)/V1-4.png
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
gipps V2 (modélisation)/V1.png
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
gipps V2 (modélisation)/V2-1.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
gipps V2 (modélisation)/V2-2.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
gipps V2 (modélisation)/V2-4.png
Normal file
After Width: | Height: | Size: 75 KiB |
133
gipps V2 (modélisation)/gippsV1.py
Normal file
@ -0,0 +1,133 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import time
|
||||
from colour import Color
|
||||
import imagesV1 as images
|
||||
import imagesV2 as images2
|
||||
|
||||
fps = 2
|
||||
|
||||
# ===========
|
||||
t0 = 0
|
||||
tf = 40
|
||||
dt = 1
|
||||
t = t0
|
||||
# ===========
|
||||
nbv = 2
|
||||
|
||||
"""# =========== VARIABBLES
|
||||
Xn(t) # position au temps t
|
||||
Vn(t) # vitesse au temps t
|
||||
An(t+Tr) # accel au temps t + Tr
|
||||
ln # ?
|
||||
k # ?
|
||||
m # ?
|
||||
"""
|
||||
|
||||
# =========== CONSTANTES
|
||||
An = 1.7 # accel max sampled from a normal distribution. N(1.7,0.3²) m/s²
|
||||
Bn = -2 * An # frein max equated to - 2An
|
||||
Sn = 6.5 # taille de la voiture plus marge sampled from a normal distribution. N(6.5,0.3²) m
|
||||
Vd = 20.0 # vitesse désirée sampled from a normal distribution. N(20.0,3.2²) m/sec
|
||||
Vmin = 1
|
||||
# X*n # position fin de freinage (calculable)
|
||||
Tr = 2/3 + (2/3)/2 # temps de réaction + sûreté (= tau + θ = 2/3 + tau/2)
|
||||
# B supposé égal à Bn-1 (si pas égal alors amplifications ??)
|
||||
|
||||
|
||||
def rainbow_gradient(num_colors):
|
||||
colors = []
|
||||
base_color = Color("violet")
|
||||
gradient = list(base_color.range_to(Color("red"), num_colors))
|
||||
for color in gradient:
|
||||
hex_code = color.hex_l
|
||||
colors.append(hex_code)
|
||||
return colors
|
||||
colors = rainbow_gradient(nbv)
|
||||
|
||||
def px(tt): # Avance au cours du temps
|
||||
tt += 1/fps
|
||||
return tt
|
||||
|
||||
def vitesseatt(vtold): # Vitesse qu'il peut réellement atteindre d'un point de vue dynamique
|
||||
value = vtold + 2.5 * An * Tr * ( 1 - (vtold/Vd) ) * np.sqrt( ( 0.025 + (vtold/Vd) ))
|
||||
return value
|
||||
|
||||
|
||||
def vitesseadop(vtold, xxpold): # Vitesse qu'il est possible d'adopter en connaissant les contraintes de sécurité liées à la présence du véhicule leader
|
||||
dst = np.diff(xxpold)
|
||||
value = Bn * Tr + np.sqrt( ((Bn)**2) * ((Tr)**2) - Bn * ( 2 * dst) - vtold[0] * Tr - ( (xxold[-1])**2 / Bn ) )
|
||||
newvalue = np.insert(value, 1, vtold[1])
|
||||
print('newvalue: ', newvalue)
|
||||
return newvalue
|
||||
|
||||
def vitessereelle(t, vtold, xxpold): # Vitesse du véhicule
|
||||
# t+=t
|
||||
if t==0:
|
||||
vtold[-1] = 0.1
|
||||
elif (t> 0) and (t<=10): # Accélération du leader
|
||||
a = (Vd - Vmin) / 10
|
||||
vtleader = Vmin + a * t
|
||||
vtold[-1] = vtleader
|
||||
elif (t>= 16) and (t<=20): # Leader freine
|
||||
a = - (Vd - Vmin) / 10
|
||||
vtleader = Vd + 2 * a * (t - 16)
|
||||
vtold[-1] = vtleader
|
||||
elif (t> 20) and (t<=30): # Accélération du leader
|
||||
a = (Vd - Vmin) / 10
|
||||
vtleader = Vmin + a * (t-20)
|
||||
vtold[-1] = vtleader
|
||||
else: # Leader avance normalement
|
||||
vtold[-1] = Vd
|
||||
|
||||
vatt = vitesseatt(vtold)
|
||||
vadop = vitesseadop(vtold, xxpold)
|
||||
minimum = np.minimum(vatt, vadop)
|
||||
print('minimum: ', minimum)
|
||||
return minimum
|
||||
|
||||
|
||||
|
||||
def position(fposition, newv):
|
||||
newp = fposition + newv * dt
|
||||
return newp
|
||||
|
||||
xxbase = np.linspace(-nbv, 1, nbv)
|
||||
xxpbase = np.linspace(0, 1, nbv)
|
||||
yybase = np.linspace(0, 1, nbv)
|
||||
|
||||
xxold = xxbase.copy()
|
||||
xxpold = xxpbase.copy()
|
||||
vtold = yybase.copy()
|
||||
|
||||
while(t<=tf):
|
||||
plt.figure(1,figsize=[16,9])
|
||||
# plt.clf()
|
||||
plt.xlim([-1,41])
|
||||
plt.ylim([-0.5, Vd+1])
|
||||
|
||||
xx = px(xxold)
|
||||
|
||||
vt = vitessereelle(t, vtold, xxpold)
|
||||
|
||||
xxp = position(xxpold, vt)
|
||||
|
||||
plt.scatter(xx, vt, c=colors)
|
||||
|
||||
plt.plot([0,40],[Vd, Vd], color='k', linestyle='-', linewidth=1)
|
||||
plt.xlabel('temps en s', fontsize = 16)
|
||||
plt.ylabel('vitesse en m.s-¹', fontsize = 16)
|
||||
plt.xticks(fontsize = 14)
|
||||
plt.yticks(fontsize = 14)
|
||||
# plt.title('Vitesse maximale désirée\nvitesse du leader : ' + str(Vd) + 'm.s-¹\ndistance entre deux voitures : ' + str(np.diff(xxpold)) + 'm\n\nTemps : ' + str(t))
|
||||
plt.draw()
|
||||
if t == tf:
|
||||
plt.savefig('gipps V2 (modélisation)/V1.png')
|
||||
plt.pause(0.00001)
|
||||
t += dt/fps
|
||||
xxold = xx.copy()
|
||||
xxpold = xxp.copy()
|
||||
vtold = vt.copy()
|
||||
|
||||
# images.merge()
|
||||
# images2.merge(fps)
|
132
gipps V2 (modélisation)/gippsV2.py
Normal file
@ -0,0 +1,132 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import time
|
||||
from colour import Color
|
||||
import imagesV2 as images
|
||||
|
||||
fps = 4
|
||||
|
||||
# ===========
|
||||
t0 = 0
|
||||
tf = 40
|
||||
dt = 1
|
||||
t = t0
|
||||
# ===========
|
||||
nbv = 2
|
||||
|
||||
"""# =========== VARIABBLES
|
||||
Xn(t) # position au temps t
|
||||
Vn(t) # vitesse au temps t
|
||||
An(t+Tr) # accel au temps t + Tr
|
||||
ln # ?
|
||||
k # ?
|
||||
m # ?
|
||||
"""
|
||||
|
||||
# =========== CONSTANTES
|
||||
An = 1.7 # accel max sampled from a normal distribution. N(1.7,0.3²) m/s²
|
||||
Bn = -2 * An # frein max equated to - 2An
|
||||
Sn = 6.5 # taille de la voiture plus marge sampled from a normal distribution. N(6.5,0.3²) m
|
||||
Vd = 20.0 # vitesse désirée sampled from a normal distribution. N(20.0,3.2²) m/sec
|
||||
Vmin = 1
|
||||
# X*n # position fin de freinage (calculable)
|
||||
Tr = 2/3 + (2/3)/2 # temps de réaction + sûreté (= tau + θ = 2/3 + tau/2)
|
||||
# B supposé égal à Bn-1 (si pas égal alors amplifications ??)
|
||||
|
||||
|
||||
def rainbow_gradient(num_colors):
|
||||
colors = []
|
||||
base_color = Color("violet")
|
||||
gradient = list(base_color.range_to(Color("red"), num_colors))
|
||||
for color in gradient:
|
||||
hex_code = color.hex_l
|
||||
colors.append(hex_code)
|
||||
return colors
|
||||
colors = rainbow_gradient(nbv)
|
||||
|
||||
def px(tt): # Avance au cours du temps
|
||||
tt += 1/fps
|
||||
return tt
|
||||
|
||||
def vitesseatt(vtold): # Vitesse qu'il peut réellement atteindre d'un point de vue dynamique
|
||||
value = vtold + 2.5 * An * Tr * ( 1 - (vtold/Vd) ) * np.sqrt( ( 0.025 + (vtold/Vd) ))
|
||||
return value
|
||||
|
||||
|
||||
def vitesseadop(vtold, xxpold): # Vitesse qu'il est possible d'adopter en connaissant les contraintes de sécurité liées à la présence du véhicule leader
|
||||
dst = np.diff(xxpold)
|
||||
value = Bn * Tr + np.sqrt( ((Bn)**2) * ((Tr)**2) - Bn * ( 2 * dst) - vtold[0] * Tr - ( (xxold[-1])**2 / Bn ) )
|
||||
newvalue = np.insert(value, 1, vtold[1])
|
||||
print('newvalue: ', newvalue)
|
||||
return newvalue
|
||||
|
||||
def vitessereelle(t, vtold, xxpold): # Vitesse du véhicule
|
||||
|
||||
if t==0:
|
||||
vtold[-1] = 0.1
|
||||
elif (t> 0) and (t<=10): # Accélération du leader
|
||||
a = (10 - Vmin) / 10
|
||||
vtleader = Vmin + a * t
|
||||
vtold[-1] = vtleader
|
||||
elif (t>= 16) and (t<=20): # Leader freine
|
||||
a = - (10 - Vmin) / 10
|
||||
vtleader = 10 + 2 * a * (t - 16)
|
||||
vtold[-1] = vtleader
|
||||
elif (t> 20) and (t<=29): # Accélération du leader
|
||||
a = (Vd - Vmin) / 10
|
||||
vtleader = Vmin + a * (t-19)
|
||||
vtold[-1] = vtleader
|
||||
elif (t> 29) and (t<=40): # Accélération du leader
|
||||
vtold[-1] = 20
|
||||
else: # Leader avance normalement
|
||||
vtold[-1] = 10
|
||||
|
||||
vatt = vitesseatt(vtold)
|
||||
vadop = vitesseadop(vtold, xxpold)
|
||||
minimum = np.minimum(vatt, vadop)
|
||||
print('minimum: ', minimum)
|
||||
return minimum
|
||||
|
||||
|
||||
|
||||
def position(fposition, newv):
|
||||
newp = fposition + newv * dt
|
||||
return newp
|
||||
|
||||
xxbase = np.linspace(-nbv, 1, nbv)
|
||||
xxpbase = np.linspace(0, 1, nbv)
|
||||
yybase = np.linspace(0, 1, nbv)
|
||||
|
||||
xxold = xxbase.copy()
|
||||
xxpold = xxpbase.copy()
|
||||
vtold = yybase.copy()
|
||||
|
||||
while(t<=tf):
|
||||
plt.figure(1,figsize=[16,9])
|
||||
# plt.clf()
|
||||
plt.xlim([-1,41])
|
||||
plt.ylim([-0.5, Vd+1])
|
||||
|
||||
xx = px(xxold)
|
||||
|
||||
vt = vitessereelle(t, vtold, xxpold)
|
||||
|
||||
xxp = position(xxpold, vt)
|
||||
|
||||
plt.scatter(xx, vt, c=colors)
|
||||
|
||||
plt.plot([0,40],[Vd, Vd], color='k', linestyle='-', linewidth=1)
|
||||
plt.xlabel('temps en s', fontsize = 16)
|
||||
plt.ylabel('vitesse en m.s-¹', fontsize = 16)
|
||||
plt.xticks(fontsize = 14)
|
||||
plt.yticks(fontsize = 14)
|
||||
# plt.title('Vitesse maximale désirée\nvitesse du leader : ' + str(Vd) + 'm.s-¹\ndistance entre deux voitures : ' + str(np.diff(xxpold)) + 'm\n\nTemps : ' + str(t))
|
||||
if t == tf:
|
||||
plt.savefig('gipps V2 (modélisation)/V2-' + str(fps) + '.png')
|
||||
plt.pause(0.0001)
|
||||
t += dt/fps
|
||||
xxold = xx.copy()
|
||||
xxpold = xxp.copy()
|
||||
vtold = vt.copy()
|
||||
|
||||
# images.merge(fps)
|
BIN
gipps V2 (modélisation)/graph.png
Normal file
After Width: | Height: | Size: 48 KiB |
54
gipps V2 (modélisation)/graph.py
Normal file
@ -0,0 +1,54 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
# =========== CONSTANTES
|
||||
An = 1.7 # accel max sampled from a normal distribution. N(1.7,0.3²) m/s²
|
||||
Bn = -2 * An # frein max equated to - 2An
|
||||
Sn = 6.5 # taille de la voiture plus marge sampled from a normal distribution. N(6.5,0.3²) m
|
||||
Vd = 20.0 # vitesse désirée sampled from a normal distribution. N(20.0,3.2²) m/sec
|
||||
# X*n # position fin de freinage (calculable)
|
||||
Tr = 2/3 + (2/3)/2 # temps de réaction + sûreté (= tau + θ = 2/3 + tau/2)
|
||||
# B supposé égal à Bn-1 (si pas égal alors amplifications ??)
|
||||
|
||||
|
||||
vv = np.linspace(0, 36, 200)
|
||||
|
||||
def vitesseatt(vv): # Vitesse qu'il peut réellement atteindre d'un point de vue dynamique
|
||||
value = vv + 2.5 * An * Tr * ( 1 - (vv/Vd) ) * np.sqrt( ( 0.025 + (vv/Vd) ))
|
||||
return value
|
||||
|
||||
|
||||
def vitesseadop(vv): # Vitesse qu'il est possible d'adopter en connaissant les contraintes de sécurité liées à la présence du véhicule leader
|
||||
value = 1
|
||||
return value
|
||||
|
||||
def vitessereelle(vv): # Vitesse maximale désirée
|
||||
vatt = vitesseatt(vv)
|
||||
vadop = vitesseadop(vv)
|
||||
return min(vatt, vadop)
|
||||
|
||||
def plotter(nb):
|
||||
plt.plot([0,nb],[vitesseatt(nb), vitesseatt(nb)], color='k', linestyle='-', linewidth=1)
|
||||
plt.plot([nb, nb],[0, vitesseatt(nb)], color='k', linestyle='-', linewidth=1)
|
||||
plt.scatter(nb, vitesseatt(nb))
|
||||
|
||||
plt.figure(figsize=[16,9])
|
||||
plt.xlim([0, 37])
|
||||
plt.ylim([0, 35])
|
||||
|
||||
plt.plot(vv, vitesseatt(vv), '-', color='red') #, label="Vitesse qu'il peut réellement atteindre d'un point de vue dynamique"
|
||||
# plt.plot(vv, vitesseadop(vv), '-', color='green', label='No mask')
|
||||
|
||||
plotter(10)
|
||||
plotter(20)
|
||||
plotter(30)
|
||||
|
||||
# plt.legend(fontsize = 16, loc='upper center')
|
||||
# plt.title('Variation de la vitesse de la voiture suivant en fonction de la voiture leader (première partie du modèle de Gipps)')
|
||||
plt.xlabel('vitesse de la voiture leader en m.s-¹', fontsize = 16)
|
||||
plt.ylabel('vitesse de la voiture qui suit en m.s-¹', fontsize = 16)
|
||||
plt.xticks(fontsize = 14)
|
||||
plt.yticks(fontsize = 14)
|
||||
plt.savefig('gipps V2 (modélisation)/graph.png')
|
||||
plt.draw()
|
||||
plt.pause(4)
|
42
gipps V2 (modélisation)/imagesV1.py
Normal file
@ -0,0 +1,42 @@
|
||||
from PIL import Image
|
||||
import os
|
||||
import shutil
|
||||
|
||||
try:os.remove('gipps/merged.png')
|
||||
except:pass
|
||||
|
||||
def merge_images(overlay_folder, output_path):
|
||||
overlay_path = f"{overlay_folder}/1.png"
|
||||
overlay = Image.open(overlay_path)
|
||||
result_width, result_height = overlay.size
|
||||
result = Image.new('RGB', (result_width, result_height), color=(255, 255, 255))
|
||||
x, y = 0, 0
|
||||
for i in range(1,40):
|
||||
overlay_path = f"{overlay_folder}/{i}.png"
|
||||
overlay = Image.open(overlay_path)
|
||||
result.paste(overlay, (x, y), overlay)
|
||||
result.save(output_path)
|
||||
|
||||
def detrf(folder_path):
|
||||
try:
|
||||
if os.path.exists(folder_path):
|
||||
shutil.rmtree(folder_path)
|
||||
print(f"Folder '{folder_path}' successfully deleted.")
|
||||
else:
|
||||
print(f"Folder '{folder_path}' does not exist.")
|
||||
|
||||
try:
|
||||
os.makedirs(folder_path)
|
||||
print(f"Folder '{folder_path}' successfully created.")
|
||||
except OSError as e:
|
||||
print(f"Error creating folder: {e}")
|
||||
|
||||
except OSError as e:
|
||||
print(f"Error deleting folder: {e}")
|
||||
|
||||
def merge():
|
||||
overlay_folder = "gipps/result"
|
||||
output_path = "gipps/merged.png"
|
||||
merge_images(overlay_folder, output_path)
|
||||
detrf('gipps/result')
|
||||
print('merge done')
|
42
gipps V2 (modélisation)/imagesV2.py
Normal file
@ -0,0 +1,42 @@
|
||||
from PIL import Image
|
||||
import os
|
||||
import shutil
|
||||
|
||||
try:os.remove('gipps/merged.png')
|
||||
except:pass
|
||||
|
||||
def merge_images(overlay_folder, output_path, fps):
|
||||
overlay_path = f"{overlay_folder}/1.png"
|
||||
overlay = Image.open(overlay_path)
|
||||
result_width, result_height = overlay.size
|
||||
result = Image.new('RGB', (result_width, result_height), color=(255, 255, 255))
|
||||
x, y = 0, 0
|
||||
for i in range(1,40*fps):
|
||||
overlay_path = f"{overlay_folder}/{i}.png"
|
||||
overlay = Image.open(overlay_path)
|
||||
result.paste(overlay, (x, y), overlay)
|
||||
result.save(output_path)
|
||||
|
||||
def detrf(folder_path):
|
||||
try:
|
||||
if os.path.exists(folder_path):
|
||||
shutil.rmtree(folder_path)
|
||||
print(f"Folder '{folder_path}' successfully deleted.")
|
||||
else:
|
||||
print(f"Folder '{folder_path}' does not exist.")
|
||||
|
||||
try:
|
||||
os.makedirs(folder_path)
|
||||
print(f"Folder '{folder_path}' successfully created.")
|
||||
except OSError as e:
|
||||
print(f"Error creating folder: {e}")
|
||||
|
||||
except OSError as e:
|
||||
print(f"Error deleting folder: {e}")
|
||||
|
||||
def merge(fps):
|
||||
overlay_folder = "gipps/result"
|
||||
output_path = "gipps/merged.png"
|
||||
merge_images(overlay_folder, output_path, fps)
|
||||
detrf('gipps/result')
|
||||
print('merge done')
|
BIN
gipps/merged.png
Before Width: | Height: | Size: 39 KiB |
@ -2,7 +2,7 @@ import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.ticker as ticker
|
||||
|
||||
vt = 1.25 # 4,5 km/h
|
||||
# vt = 1.25 # 4,5 km/h
|
||||
Umin = 1 # vitesse m/s
|
||||
Umax = 36 # environ 130 km/h
|
||||
Wm = 4.23 # longueur du véhicule en m (moyenne française)
|
||||
@ -11,7 +11,7 @@ t = np.linspace(0, 15, 400)
|
||||
def vitesse(t):
|
||||
a = np.where(t <= 10, (Umax - Umin) / 10, - (Umax - Umin) / 10)
|
||||
vt = np.where(t <= 10, Umin + a * t, Umax + 2 * a * (t - 10))
|
||||
print('vt: ', vt)
|
||||
# print('vt: ', vt)
|
||||
return vt
|
||||
|
||||
|
||||
|
54
pipes/dist sécuritéV2.py
Normal file
@ -0,0 +1,54 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib.ticker as ticker
|
||||
|
||||
# vt = 1.25 # 4,5 km/h
|
||||
Umin = 1 # vitesse m/s
|
||||
Umax = 36 # environ 130 km/h
|
||||
Wm = 4.23 # longueur du véhicule en m (moyenne française)
|
||||
t = np.linspace(0, 15, 400)
|
||||
|
||||
def vitesse(t):
|
||||
a = np.where(t <= 10, (Umax - Umin) / 10, - (Umax - Umin) / 10)
|
||||
vt = np.where(t <= 10, Umin + a * t, Umax + 2 * a * (t - 10))
|
||||
# print('vt: ', vt)
|
||||
return vt
|
||||
|
||||
|
||||
def security(t):
|
||||
vt = np.linspace(1, 36, 400)
|
||||
# ici la vitesse est encore en m/s
|
||||
miles_per_meter = 0.000621371
|
||||
seconds_per_hour = 3600
|
||||
vt = vt * miles_per_meter * seconds_per_hour
|
||||
dist = Wm * (1 + (vt/(16.1/3.6)))
|
||||
# print(dist)
|
||||
return dist
|
||||
|
||||
|
||||
fig, ax1 = plt.subplots(figsize=[16, 9])
|
||||
ax1.set_xlim([-1, 16])
|
||||
ax1.set_xlabel('Temps (s)', fontsize = 16)
|
||||
ax1.set_ylabel('Distance de sécurité en m', color='b', fontsize = 16)
|
||||
ax1.plot(t, security(t), label='Distance de sécurité', color='b')
|
||||
ax1.tick_params(axis='y', labelcolor='blue', labelsize = 14)
|
||||
ax1.tick_params(axis='x', labelcolor='black', labelsize = 14)
|
||||
|
||||
ax2 = ax1.twinx()
|
||||
ax2.set_ylabel('Vitesse de la voiture leader en m/s', color='r', fontsize = 16)
|
||||
vitesse_data = np.linspace(1, 36, 400)
|
||||
ax2.plot(t, vitesse_data, label='Vitesse de la voiture leader', color='r')
|
||||
ax2.tick_params(axis='y', labelcolor='r', labelsize = 14)
|
||||
|
||||
|
||||
ax1.set_ylim(-1, 100)
|
||||
ax2.set_ylim(-1, 100)
|
||||
|
||||
ax1.yaxis.set_major_locator(ticker.LinearLocator(numticks=10))
|
||||
ax2.yaxis.set_major_locator(ticker.LinearLocator(numticks=10))
|
||||
|
||||
# plt.title(label='Variation de la distance de sécurité en fonction de la vitesse du leader selon le modèle de Pipes', fontsize= 16)
|
||||
fig.legend(loc='upper center', fontsize = 16)
|
||||
plt.savefig('pipes/dist sécuritésV2.png')
|
||||
plt.draw()
|
||||
plt.pause(1)
|
BIN
pipes/dist sécuritésV2.png
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
rapport/Titre du rapport.zip
Normal file
BIN
rapport/modélisations/graphique_moedele_trafic_1.png
Normal file
After Width: | Height: | Size: 4.2 MiB |
BIN
rapport/modélisations/phi(ww).png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
rapport/modélisations/phi(ww).xcf
Normal file
1
rapport/yoloex/track/labels/voitures.txt
Normal file
@ -0,0 +1 @@
|
||||
2 0.313418 0.484872 0.29448 0.307006
|
BIN
rapport/yoloex/track/voitures.jpg
Normal file
After Width: | Height: | Size: 468 KiB |
BIN
rapport/yoloex/voitures.jpg
Normal file
After Width: | Height: | Size: 583 KiB |
@ -31,15 +31,27 @@ def position(fposition):
|
||||
|
||||
xxold = xxbase.copy()
|
||||
|
||||
while(t<tf):
|
||||
plt.figure(1,figsize=[16,9])
|
||||
plt.clf()
|
||||
plt.xlim([-1,10])
|
||||
while(t<=tf):
|
||||
plt.figure(1,figsize=[12,5])
|
||||
# plt.clf()
|
||||
plt.xlim([-1,30])
|
||||
plt.ylim([-1, 21])
|
||||
xx = position(xxold)
|
||||
color = ['#ff0000', '#ff5300', '#ffa500', '#ffd200', '#ffff00', '#80c000', '#008000', '#004080', '#0000ff', '#2600c1', '#4b0082']
|
||||
plt.scatter(xx, y, c=color)
|
||||
|
||||
# plt.plot([0,20],[t, t], color='k', linestyle='-', linewidth=1)
|
||||
|
||||
plt.scatter(xx, np.linspace(t, t, 11), c=color)
|
||||
|
||||
|
||||
plt.xlabel('distance w en m', )
|
||||
plt.ylabel('temps en s')
|
||||
# plt.title("Modélisation de l'évolution de la distance entre les voitures\n\nau temps t = " + str(t) + 's')
|
||||
|
||||
|
||||
plt.draw()
|
||||
# plt.savefig(str(t)+'.png')
|
||||
if t == 20:
|
||||
plt.savefig('test/model/frame_' + str(t)+'.png')
|
||||
plt.pause(0.2)
|
||||
t += dt
|
||||
xxold = xx.copy()
|
||||
xxold = xx.copy()
|
BIN
test/model/frame_20.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
test/model/frame_20_.png
Normal file
After Width: | Height: | Size: 55 KiB |
BIN
test/model/frame_20_stryied.png
Normal file
After Width: | Height: | Size: 56 KiB |
BIN
test/phi(ww).png
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 12 KiB |
@ -5,7 +5,7 @@ from colour import Color
|
||||
|
||||
t0 = 0
|
||||
tf = 100
|
||||
dt = 0.5
|
||||
dt = 0.25
|
||||
t = t0
|
||||
|
||||
nbv = 20
|
||||
@ -45,13 +45,18 @@ def position(fposition, newv):
|
||||
xxold = xxbase.copy()
|
||||
|
||||
while(t < tf):
|
||||
plt.figure(1, figsize=[16, 9])
|
||||
plt.figure(1, figsize=[12, 16])
|
||||
plt.clf()
|
||||
|
||||
nb = 360
|
||||
r = np.linspace(1, 1, nb)
|
||||
theta = np.linspace(0, 2 * np.pi, nb)
|
||||
|
||||
ax = plt.subplot(111, polar=True)
|
||||
|
||||
ax.set_xticklabels([])
|
||||
ax.set_yticklabels([])
|
||||
|
||||
plt.polar(theta, r, alpha=0)
|
||||
|
||||
dst = distances(xxold)
|
||||
@ -61,8 +66,12 @@ while(t < tf):
|
||||
|
||||
plt.scatter(xx/10 * np.pi, y, c=colors)
|
||||
|
||||
plt.title('Vitesse maximale : ' + str(U) + ' m/s\ndistance minimale entre deux voitures : ' + str(Wm) + ' m\nnombre de voitures : ' + str(nbv))
|
||||
# plt.title("Modélisation de l'évolution de la distance entre les voitures (périodique)\n\nnombre de voiture : "+ str(nbv) +"\n\nau temps t = " + str(t) + 's\n')
|
||||
plt.grid(False)
|
||||
|
||||
plt.draw()
|
||||
plt.savefig('test/polaired_nbv=20/frame_' + str(t)+'.png')
|
||||
plt.pause(0.00001)
|
||||
t += dt
|
||||
|
||||
xxold = xx.copy()
|
BIN
test/polaired_nbv=20/frame_0.25.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
test/polaired_nbv=20/frame_0.5.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
test/polaired_nbv=20/frame_0.75.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
test/polaired_nbv=20/frame_0.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
test/polaired_nbv=20/frame_1.0.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
test/polaired_nbv=20/frame_1.25.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
test/polaired_nbv=20/frame_1.5.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
test/polaired_nbv=20/frame_1.75.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
test/polaired_nbv=20/frame_10.0.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
test/polaired_nbv=20/frame_10.25.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
test/polaired_nbv=20/frame_10.5.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
test/polaired_nbv=20/frame_10.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_11.0.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
test/polaired_nbv=20/frame_11.25.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
test/polaired_nbv=20/frame_11.5.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
test/polaired_nbv=20/frame_11.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_12.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_12.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_12.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_12.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_13.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_13.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_13.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_13.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_14.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_14.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_14.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_14.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_15.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_15.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_15.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_15.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_16.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_16.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_16.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_16.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_17.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_17.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_17.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_17.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_18.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_18.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_18.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_18.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_19.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_19.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_19.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_19.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_2.0.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
test/polaired_nbv=20/frame_2.25.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
test/polaired_nbv=20/frame_2.5.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
test/polaired_nbv=20/frame_2.75.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
test/polaired_nbv=20/frame_20.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_20.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_20.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_20.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_21.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_21.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_21.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_21.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_22.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_22.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_22.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_22.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_23.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_23.25.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_23.5.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_23.75.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_24.0.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
test/polaired_nbv=20/frame_24.25.png
Normal file
After Width: | Height: | Size: 38 KiB |