From f557b3d88907fddcb031fe4d4a2cff78e4a91a95 Mon Sep 17 00:00:00 2001
From: Jdrezen <jeremie.drezen@gmail.com>
Date: Mon, 10 May 2021 18:27:15 +0200
Subject: [PATCH] Modification pour tester les courbes

---
 .../controleurPhilosophersExample.py          | 30 ++++++++++---------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/philosopher_example/controleurPhilosophersExample.py b/philosopher_example/controleurPhilosophersExample.py
index 7e33269..46757e8 100644
--- a/philosopher_example/controleurPhilosophersExample.py
+++ b/philosopher_example/controleurPhilosophersExample.py
@@ -11,8 +11,8 @@ class ControleurPhilosophersExample(Controleur):
         self.__numberPhilosopher = 10
         self.__barChart = []
         self.__barChart.append(self.addBarChart('Eaten Pastas'))
-        #self.__barChart.append(self.addBarChart('Hours of tkinking'))
-        #self.__barChart.append(self.addBarChart('Hours of hunger'))
+        self.__barChart.append(self.addBarChart('Hours of tkinking'))
+        self.__barChart.append(self.addPlotChart('Hours of hunger'))
 
     def initialisation(self):
 
@@ -22,16 +22,16 @@ class ControleurPhilosophersExample(Controleur):
 
         # Init
         self.setTitle(self.__barChart[0],'Eaten Pastas')
-        #self.setXLabel(self.__barChart[0],'Philosophers')
-        #self.setYLabel(self.__barChart[0],'Number of eaten pastas')
+        self.setXLabel(self.__barChart[0],'Philosophers')
+        self.setYLabel(self.__barChart[0],'Number of eaten pastas')
 
-        #self.setTitle(self.__barChart[1],'Hours of thinking')
-        #self.setXLabel(self.__barChart[1],'Philosophers')
-        #self.setYLabel(self.__barChart[1],'Hours')
+        self.setTitle(self.__barChart[1],'Hours of thinking')
+        self.setXLabel(self.__barChart[1],'Philosophers')
+        self.setYLabel(self.__barChart[1],'Hours')
 
-        #self.setTitle(self.__barChart[2],'Hours of hunger')
-        #self.setXLabel(self.__barChart[2],'Philosophers')
-        #self.setYLabel(self.__barChart[2],'Hours')
+        self.setTitle(self.__barChart[2],'Hours of hunger')
+        self.setXLabel(self.__barChart[2],'Philosophers')
+        self.setYLabel(self.__barChart[2],'Hours')
 
         self.draw_text(40,15, "EATING")
         self.draw_text(40,45, "THINKING")
@@ -51,10 +51,12 @@ class ControleurPhilosophersExample(Controleur):
             self.__philosophers.append(carre)
 
             nom = 'Mr ' + str(i)
-            self.addPoint(self.__barChart[0],x,y)
-            #self.addColumn(self.__barChart[0],nom)
-            #self.addColumn(self.__barChart[1],nom)
-            #self.addColumn(self.__barChart[2],nom)
+
+            self.addColumn(self.__barChart[0],nom)
+            self.addColumn(self.__barChart[1],nom)
+            self.addPoint(self.__barChart[2],0,x,y)
+            self.addCurve(self.__barChart[2],'go')
+            self.addPoint(self.__barChart[2],1,x-10,y-10)
 
     def updateCycle(self, env, amas):
         agents = amas.get_Agents_Sorted()
-- 
GitLab