From e813401fb9365215a7d783e12ee396bdf7ac5c8c Mon Sep 17 00:00:00 2001
From: david <david@lipn.fr>
Date: Wed, 9 Sep 2020 11:38:46 +0200
Subject: [PATCH] plot result updated

---
 .gitignore          | 13 +++++++++++--
 C/arraylist.c       |  2 +-
 CPP/arraylist.hpp   |  2 +-
 Java/ArrayList.java |  2 +-
 Python/main.py      |  2 +-
 README.md           | 12 ++++++++----
 plots/plot_result   |  6 +++---
 7 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/.gitignore b/.gitignore
index 102493f..44a3df2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,15 @@
 */*~
-
+Python/__pycache__/*
 Sujets/*.tex
 Sujets/*.aux
 Sujets/*.bak
-Sujets/*.log
\ No newline at end of file
+Sujets/*.log
+Sujets/*.ods
+
+Corrections/*
+
+Java/*.class
+Java/.idea
+
+plots/plot_files/*
+plots/png/*
\ No newline at end of file
diff --git a/C/arraylist.c b/C/arraylist.c
index 32d45a6..1fbeeec 100644
--- a/C/arraylist.c
+++ b/C/arraylist.c
@@ -60,7 +60,7 @@ size_t arraylist_capacity(arraylist_t * a){
 }
 
 char arraylist_do_we_need_to_enlarge_capacity(arraylist_t * a){
-  return ( a->size >= (a->capacity * 3)/4 )? TRUE: FALSE;
+  return a->size == a->capacity ? TRUE: FALSE;
 }
 
 void arraylist_enlarge_capacity(arraylist_t * a){
diff --git a/CPP/arraylist.hpp b/CPP/arraylist.hpp
index 7f9331c..be35de5 100644
--- a/CPP/arraylist.hpp
+++ b/CPP/arraylist.hpp
@@ -89,7 +89,7 @@ private:
      @returns true si le tableau doit être agrandi, false sinon.
   */
   bool do_we_need_to_enlarge_capacity(){
-    return data.size() >= (data.capacity() * 3)/4;
+    return data.size() == data.capacity();
   }
 
   /**
diff --git a/Java/ArrayList.java b/Java/ArrayList.java
index 4c259b8..3401432 100644
--- a/Java/ArrayList.java
+++ b/Java/ArrayList.java
@@ -83,7 +83,7 @@ public class ArrayList<T> {
      @returns true si le tableau doit être agrandi, false sinon.
      */
     private boolean do_we_need_to_enlarge_capacity() {
-        return size >= (capacity * 3)/4;
+        return size == capacity;
     }
 
     /**
diff --git a/Python/main.py b/Python/main.py
index 9634cb4..e999e99 100644
--- a/Python/main.py
+++ b/Python/main.py
@@ -5,7 +5,7 @@ from arraylist import ArrayListProxy
 from analyzer import Analyzer
 
 # Tableau dynamique.
-a = ArrayListProxy()
+a = []
 # Analyse du temps pris par les operations.
 time_analysis = Analyzer();
 
diff --git a/README.md b/README.md
index 422ec13..7e4f98f 100644
--- a/README.md
+++ b/README.md
@@ -41,12 +41,16 @@ python main.py
 cd ..
 
 # Observation des résultats
-### Dans le répertoire courant, lisez le contenu du fichier plot_result
+### Dans le répertoire plots, lisez le contenu du fichier plot_result
 
+cd plots
 more plot_result
 
-### puis lancez gnuplot
+### puis lancez ce script avec gnuplot
 
-gnuplot
+gnuplot plot_result
+
+### Regardez à présent les courbes obtenus dans le répertoire eps/
+
+gv eps/dynamic_array_amortized_time_alpha_2.eps
 
-### puis copiez le contenu du fichier plot_result dans gnuplot (3 lignes, une par une)
\ No newline at end of file
diff --git a/plots/plot_result b/plots/plot_result
index 5118dc0..1035e00 100644
--- a/plots/plot_result
+++ b/plots/plot_result
@@ -14,7 +14,7 @@ set ylabel "Temps amorti" font "Helvetica,24"
 # Nom du fichier Postscript en sortie
 set output 'eps/dynamic_array_amortized_time_alpha_2.eps' 
 
-plot [0:1000000][0:600] 'plot_files/dynamic_array_time_c.plot' using 1:3 w lines title "Amortized C", 'plot_files/dynamic_array_time_cpp.plot' using 1:3 w lines title "Amortized C++", 'plot_files/dynamic_array_time_java.plot' using 1:3 w lines title "Amortized JAVA", 'plot_files/dynamic_array_time_python.plot' using 1:3 w lines title "Amortized Python"
+plot [0:1000000][0:1000] 'dynamic_array_time_c.plot' using 1:3 w lines title "Amortized C", 'dynamic_array_time_cpp.plot' using 1:3 w lines title "Amortized C++", 'dynamic_array_time_java.plot' using 1:3 w lines title "Amortized JAVA", 'dynamic_array_time_python.plot' using 1:3 w lines title "Amortized Python"
 
 ###############################################################
 ###########  Affichage de l'espace mémoire gaspillé ###########
@@ -25,7 +25,7 @@ set ylabel "Mémoire gaspillée" font "Helvetica,24"
 # Nom du fichier Postscript en sortie
 set output 'eps/dynamic_array_wasted_memory_alpha_2.eps' 
 
-plot 'plot_files/dynamic_array_memory_c.plot' using 1:2 w lines title "Espace memoire inutilise"
+plot 'dynamic_array_memory_c.plot' using 1:2 w lines title "Espace memoire inutilise"
 
 #################################################################
 ###########  Affichage du nombre de copies effectuées ###########
@@ -36,4 +36,4 @@ set ylabel "Nombre de copie effectuée" font "Helvetica,24"
 # Nom du fichier Postscript en sortie
 set output 'eps/dynamic_copy_alpha_2.eps' 
 
-plot 'plot_files/dynamic_array_copy_c.plot' using 1:2 w boxes title "Nombre de copies de valeurs effectuees"
\ No newline at end of file
+plot 'dynamic_array_copy_c.plot' using 1:2 w boxes title "Nombre de copies de valeurs effectuees"
\ No newline at end of file
-- 
GitLab