Update ARE-DYNAMIC.py
This commit is contained in:
parent
cfe2e79466
commit
537a2ba1f3
|
@ -70,6 +70,9 @@ AffichageDynamique = True
|
|||
# nécessaire pour matrice_init_pourcents_choisis()
|
||||
ListePourcents = list()
|
||||
|
||||
#Couleurs des Stratégies
|
||||
CouleursStrat=['b','r','black','g','purple']
|
||||
|
||||
|
||||
"""
|
||||
Types:
|
||||
|
@ -499,8 +502,7 @@ def matRecup(i, param):
|
|||
|
||||
return matR
|
||||
|
||||
#Couleurs des Stratégies
|
||||
CouleursStrat=['b','r','black','g','purple']
|
||||
|
||||
|
||||
def afficher_strat_dynamique():
|
||||
fig=plt.figure()
|
||||
|
@ -522,7 +524,30 @@ def afficher_strat_dynamique():
|
|||
|
||||
anim = animation.FuncAnimation(fig, update, frames=range(MaxIterations), interval=500, repeat = False)
|
||||
|
||||
plt.show()
|
||||
plt.show(Block = True)
|
||||
|
||||
|
||||
def afficher_strat_dynamique():
|
||||
fig=plt.figure()
|
||||
fig.suptitle('Animation des états')
|
||||
|
||||
cmap = mpl.colors.ListedColormap(["black","white"])
|
||||
|
||||
bounds=[0,1,2]
|
||||
norm=mpl.colors.BoundaryNorm(bounds, cmap.N)
|
||||
img=plt.imshow(matRecup(0, 'etat'), interpolation = "nearest", cmap = cmap , norm = norm)
|
||||
|
||||
cb=plt.colorbar(img , cmap=cmap , norm=norm , boundaries = bounds , ticks=bounds)
|
||||
labels = np.arange(0, 2, 1)
|
||||
cb.set_ticklabels(labels)
|
||||
|
||||
def update(next_iteration,*args):
|
||||
img.set_array(matRecup(next_iteration , 'etat'))
|
||||
return [img]
|
||||
|
||||
anim = animation.FuncAnimation(fig, update, frames=range(MaxIterations), interval=500, repeat = False)
|
||||
|
||||
plt.show(Block = True)
|
||||
|
||||
|
||||
def affichage_strats_resultats_totaux():
|
||||
|
|
Loading…
Reference in New Issue