diff --git a/ant_example/antsLaunchExample.py b/ant_example/antsLaunchExample.py index 34ac9b56e59a5285f1d46750de5a40602e073e3a..c08eb76175f3ecc7560bceaf62ff1a53e736f19f 100644 --- a/ant_example/antsLaunchExample.py +++ b/ant_example/antsLaunchExample.py @@ -19,14 +19,7 @@ amas = AntHillExample(env) controleur = ControleurAntsExample(fenetre, amas) -def run(): - controleur.get_amas().start() - - def main(): - controleur.initialisation() - Thread(target=run).start() - controleur.get_fenetre().display() - + controleur.start() main() diff --git a/ant_example/controleurAntsExample.py b/ant_example/controleurAntsExample.py index 8f3252b9fe26b72102237c35c0b7e48302746c02..ac7ded76efd6ee955fb308919a8dd3d79feafe31 100644 --- a/ant_example/controleurAntsExample.py +++ b/ant_example/controleurAntsExample.py @@ -17,7 +17,7 @@ class ControleurAntsExample(Controleur): for i in range(self.__numberAnts): self.__ants.append(self.draw_image(widthCanvas / 2, heightCanvas / 2, 'images/blackAnt.png')) - def updateCycle(self, env, amas): + def updateWindow(self, env, amas): ants = amas.get_Agents_Sorted() for i in range(len(ants)): diff --git a/ant_example_2_phases/antsLaunchExample.py b/ant_example_2_phases/antsLaunchExample.py index 34ac9b56e59a5285f1d46750de5a40602e073e3a..c08eb76175f3ecc7560bceaf62ff1a53e736f19f 100644 --- a/ant_example_2_phases/antsLaunchExample.py +++ b/ant_example_2_phases/antsLaunchExample.py @@ -19,14 +19,7 @@ amas = AntHillExample(env) controleur = ControleurAntsExample(fenetre, amas) -def run(): - controleur.get_amas().start() - - def main(): - controleur.initialisation() - Thread(target=run).start() - controleur.get_fenetre().display() - + controleur.start() main() diff --git a/ant_example_2_phases/controleurAntsExample.py b/ant_example_2_phases/controleurAntsExample.py index 8f3252b9fe26b72102237c35c0b7e48302746c02..ac7ded76efd6ee955fb308919a8dd3d79feafe31 100644 --- a/ant_example_2_phases/controleurAntsExample.py +++ b/ant_example_2_phases/controleurAntsExample.py @@ -17,7 +17,7 @@ class ControleurAntsExample(Controleur): for i in range(self.__numberAnts): self.__ants.append(self.draw_image(widthCanvas / 2, heightCanvas / 2, 'images/blackAnt.png')) - def updateCycle(self, env, amas): + def updateWindow(self, env, amas): ants = amas.get_Agents_Sorted() for i in range(len(ants)): diff --git a/ant_examplev2/antsLaunchExample.py b/ant_examplev2/antsLaunchExample.py index 34ac9b56e59a5285f1d46750de5a40602e073e3a..c08eb76175f3ecc7560bceaf62ff1a53e736f19f 100644 --- a/ant_examplev2/antsLaunchExample.py +++ b/ant_examplev2/antsLaunchExample.py @@ -19,14 +19,7 @@ amas = AntHillExample(env) controleur = ControleurAntsExample(fenetre, amas) -def run(): - controleur.get_amas().start() - - def main(): - controleur.initialisation() - Thread(target=run).start() - controleur.get_fenetre().display() - + controleur.start() main() diff --git a/ant_examplev2/controleurAntsExample.py b/ant_examplev2/controleurAntsExample.py index 8f3252b9fe26b72102237c35c0b7e48302746c02..ac7ded76efd6ee955fb308919a8dd3d79feafe31 100644 --- a/ant_examplev2/controleurAntsExample.py +++ b/ant_examplev2/controleurAntsExample.py @@ -17,7 +17,7 @@ class ControleurAntsExample(Controleur): for i in range(self.__numberAnts): self.__ants.append(self.draw_image(widthCanvas / 2, heightCanvas / 2, 'images/blackAnt.png')) - def updateCycle(self, env, amas): + def updateWindow(self, env, amas): ants = amas.get_Agents_Sorted() for i in range(len(ants)): diff --git a/philosopher_example/controleurPhilosophersExample.py b/philosopher_example/controleurPhilosophersExample.py index c1be8552430e042ed995b9e1af19af8a0f3af30e..cdb4dc55753a83e15a4872dd25df344e7b5fcafa 100644 --- a/philosopher_example/controleurPhilosophersExample.py +++ b/philosopher_example/controleurPhilosophersExample.py @@ -60,7 +60,7 @@ class ControleurPhilosophersExample(Controleur): self.addPoint(self.__barChart[2],0,i*50,y) self.addPoint(self.__barChart[2],1,i*50,y-50) - def updateCycle(self, env, amas): + def updateWindow(self, env, amas): agents = amas.get_Agents_Sorted() for i in range(10): diff --git a/philosopher_example/philosophersLaunchExample.py b/philosopher_example/philosophersLaunchExample.py index bda75ccadd628df416da4831c29b86a11e7b0cdc..163266233266b806bbcaa01e951e6834126edc27 100644 --- a/philosopher_example/philosophersLaunchExample.py +++ b/philosopher_example/philosophersLaunchExample.py @@ -1,7 +1,6 @@ from pyAmakIHM.classes.fenetre import Fenetre from controleurPhilosophersExample import ControleurPhilosophersExample from philosophersAmasExample import PhilosophersAmasExamples -from threading import Thread fenetre = Fenetre("Prototype Philosophers") amas = PhilosophersAmasExamples() @@ -9,14 +8,8 @@ amas = PhilosophersAmasExamples() controleur = ControleurPhilosophersExample(fenetre, amas) -def run(): - controleur.get_amas().start() - - def main(): - controleur.initialisation() - Thread(target=run).start() - controleur.get_fenetre().display() + controleur.start() main()