From 1da22eafaaa46a00c3318695b67537b1cb349074 Mon Sep 17 00:00:00 2001 From: bertuol <yoann.bertuol@etu.unistra.fr> Date: Sun, 22 Mar 2020 18:55:04 +0100 Subject: [PATCH] Script Hypo --- README.md | 4 +++- shellscript/script.sh | 39 +++++++++++--------------------------- shellscript/script_hypo.sh | 37 ++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 shellscript/script_hypo.sh diff --git a/README.md b/README.md index cf1dcb9..e2e0695 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,9 @@ public static Collection add(Collection c, int size) { ### Analyse des résultats expérimentaux -Tout d'abord nous remarquons que la structure `LinkedList` as gagné en temps +Tout d'abord nous remarquons que la structure `LinkedList` as gagné en temps d'éxécution global mais au niveau de la mémoire, il n'y as aucun changement particulier. + +De plus, on ### Discussion des résultats expérimentaux diff --git a/shellscript/script.sh b/shellscript/script.sh index b4fee40..49f008a 100755 --- a/shellscript/script.sh +++ b/shellscript/script.sh @@ -29,37 +29,20 @@ cd ../src echo -e "Size\tOperation\tOpSize\tType\tTime\tMemory" -if [[ $1 == "Hypothese" ]]; then - for size in ${structSize[*]}; do - for operation in ${operationType[*]}; do - for opSize in ${operationSize[*]}; do - for type in ${structType[*]}; do - - res=$((/usr/bin/time -f "\t%U\t%M" /usr/bin/java Hypothese $type $size $operation $opSize) 2>&1) - echo -e "$size\t$operation\t$opSize\t$type\t$res" - - done +for size in ${structSize[*]}; do + for operation in ${operationType[*]}; do + for opSize in ${operationSize[*]}; do + for type in ${structType[*]}; do + + res=$((/usr/bin/time -f "\t%U\t%M" /usr/bin/java Main $type $size $operation $opSize) 2>&1) + echo -e "$size\t$operation\t$opSize\t$type\t$res" + done done done - cd ../graphs - ./graphique_hypothese.R -else - for size in ${structSize[*]}; do - for operation in ${operationType[*]}; do - for opSize in ${operationSize[*]}; do - for type in ${structType[*]}; do - - res=$((/usr/bin/time -f "\t%U\t%M" /usr/bin/java Main $type $size $operation $opSize) 2>&1) - echo -e "$size\t$operation\t$opSize\t$type\t$res" - - done - done - done - done - cd ../graphs - ./graphique.R -fi +done +cd ../graphs +./graphique.R cd ../src rm *.class diff --git a/shellscript/script_hypo.sh b/shellscript/script_hypo.sh new file mode 100644 index 0000000..dab2863 --- /dev/null +++ b/shellscript/script_hypo.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +structType[0]="ArrayList" +structType[1]="LinkedList" +structType[2]="HashSet" + +size = 500000 + +operationSize[0]=10000 +operationSize[1]=20000 +operationSize[2]=50000 +operationSize[3]=100000 +operationSize[4]=200000 + +operationType[0]="Ajout" +operationType[1]="Présence" +operationType[2]="Suppression" + +cd ../src +/usr/bin/javac *.java + +echo -e "Size\tOperation\tOpSize\tType\tTime\tMemory" + +for operation in ${operationType[*]}; do + for opSize in ${operationSize[*]}; do + for type in ${structType[*]}; do + + res=$((/usr/bin/time -f "\t%U\t%M" /usr/bin/java Hypothese $type $size $operation $opSize) 2>&1) + echo -e "$size\t$operation\t$opSize\t$type\t$res" + + done + done +done +cd ../graphs +./graphique_hypothese.R +cd ../src +rm *.class \ No newline at end of file -- GitLab