Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (79)
Showing
with 997 additions and 13 deletions
File added
load("E:\\Documents\\IUT - Semestre 4\\Module - P4a - Performance\\P4a\\.RData")
perfArray
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point()
library(ggplot2)
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point()
GraphArray
perfTableau
GraphTableau <- ggplot(perfTableau, aes(x=Taille, y=CPU, color="blue")) + geom_point()
GraphTableau
GraphTableau
GraphTableau <- ggplot(perfTableau, aes(x=Taille, y=CPU, color="green")) + geom_point()
GraphTableau
GraphTableau <- ggplot(perfTableau, aes(x=Taille, y=CPU, color='green')) + geom_point()
GraphTableau
GraphArray
GraphTableau <- ggplot(perfTableau, aes(x=Taille, y=CPU, color='green')) + geom_point(color="green")
GraphTableau
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point(color="red")
GraphArray
perfLinked
GraphLinked = ggplot(perfLinked, aes(x=Taille, y=CPU, color="blue")) + geom_point(color="blue")
GraphLinked
GraphPerfInitializing <- rbind(GraphArray, GraphTableau, GraphLinked)
GraphPerfInitializing
GraphPerf <- ggplot(GraphPerfInitializing, aes(x=Taille, y=CPU)) + geom_point()
ggplot(GraphPerfInitializing, aes(x=Taille, y=CPU)) + geom_point()
GraphTableau
test<- rbind(perfArray, perfTableau, perfLinked)
GraphTest <- ggplot(test, aes(x=Taille, y=CPU)) + geom_point()
GraphTest
ggplot(perfArray, aes(x=Taille, y=CPU)) + geom_point() + geom_smooth(fill="blue", colour="darkblue", size=1)
warnings()
save.image("E:\\Documents\\IUT - Semestre 4\\Module - P4a - Performance\\P4a\\.RData")
q()
load("E:\\Documents\\IUT - Semestre 4\\Module - P4a - Performance\\P4a\\.RData")
perfArray
Array
graphArray
arrayGraph
GraphArray
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point(color="red") + geom_smooth()
library(ggplot2)
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point(color="red") + geom_smooth()
GraphArray <- ggplot(perfArray, aes(x=Taille, y=CPU, color="red")) + geom_point(color="red") + geom_smooth()
GraphArray
warnings()
q()
perf <- read.csv2("perf.csv", sep="\t", dec=".")
perfTableau <- read.csv2("perfTableau.csv", sep="\t", dec=".")
perfTableau <- read.csv2("perfTableau.csv", sep="\t", dec=".")
perfArray <- read.csv2("perfArray.csv", sep="\t", dec=".")
perfLinked <- read.csv2("perfLinked.csv", sep="\t", dec=".")
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,label="Performance Add Tableau")) + geom_smooth(color=blue")
)
"
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,label="Performance Add Tableau")) + geom_smooth(color="blue")
library(ggplot2)
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,label="Performance Add Tableau")) + geom_smooth(color="blue")
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,label="Performance Add Tableau")) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,colour="Performance Add Tableau")) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,colour=Performance Add Tableau)) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,color="Performance Add Tableau")) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,color="red")) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,color=red)) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,color=time)) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphTableau
graphTableau <- ggplot(perfTableau, aes(x=Taille,y=CPU,color=CPU)) + geom_smooth(color="blue") + ggtitle("Evaluation du temps d'xcution de Add sur un tableau")
graphTableau
graphArray <- ggplot(perfArray, aes(x=Taille,y=CPU,color=CPU)) + geom_smooth(color="red") + ggtitle("Evaluation du temps d'xcution de Add sur une Array")
graphArray
graphLinked <- ggplot(perfLinked, aes(x=Taille,y=CPU,color=CPU)) + geom_smooth(color="green") + ggtitle("Evaluation du temps d'xcution de Add sur une LinkedList")
graphLinked
graph <- ggarrange(graphTableau, graphArray, graphLinked, Labels=c("Tableau","Array","Linked"), ncol=2, nrow=2)
library(ggpubr)
install.package(ggpubr)
instal.package(ggpubr)
local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
if(nchar(pkg)) library(pkg, character.only=TRUE)})
instal.packages(ggpubr)
install.packages(ggpubr)
if(!require(devtools)) install.packages("devtools")
devtools::install_github("kassambara/ggpubr")
devtools::install_github("kassambara/ggpubr")
install.packages(ggpubr)
local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
if(nchar(pkg)) library(pkg, character.only=TRUE)})
library(devtools)
library("devtools")
library("devtools")
local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
if(nchar(pkg)) library(pkg, character.only=TRUE)})
local({pkg <- select.list(sort(.packages(all.available = TRUE)),graphics=TRUE)
if(nchar(pkg)) library(pkg, character.only=TRUE)})
print(perfArray)
print(graphArray)
print(graphLinked)
using pushViewport()
pushViewport(viewport(layout = grid.layout(2,2)))
if(!require(devtools)) install.packages("devtools")
devtools::install_github("kassambara/ggpubr")
devtools::install_github("kassambara/ggpubr")
install.packages("ggpubr")
libraryr(ggpubr)
library(ggpubr)
graph <- ggarrange(graphTableau, graphArray, graphLinked, Labels=c("Tableau","Array","Linked"), ncol=2, nrow=2)
graph
save.image("E:\\Documents\\IUT - Semestre 4\\Module - P4a - Performance\\P4a\\.RData")
perf <- read.csv2("perf.csv", sep="\t", dec=".")
perf
perf <- read.csv2("perf.csv", sep="\t", dec=".")
perf
ggplot(perf,aes(y = CPU, x = Taille, colour = Structure, shape =Structure))
ggplot(perf,aes(y = CPU, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth()
ggplot(perf,aes(y = CPU, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance CPU de la mthode ADD en fonction de la taille")
perfAdd <- read.csv2("perf.csv", sep="\t", dec=".")
GraphAdd <- ggplot(perfAdd,aes(y = CPU, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance CPU de la mthode ADD en fonction de la taille")
GraphAdd
GraphAddCPU <- ggplot(perfAdd,aes(y = CPU, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance CPU de la mthode ADD en fonction de la taille")
GraphAddMemoire <- ggplot(perfAdd,aes(y = CPU, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance mmoire de la mthode ADD en fonction de la taille")
GraphAddMemoire
GraphAddMemoire <- ggplot(perfAdd,aes(y = Memoire, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance mmoire de la mthode ADD en fonction de la taille")
GraphAddMemoire
GraphAddMemoire <- ggplot(perfAdd,aes(y = Mem, x = Taille, colour = Structure, shape =Structure)) + geom_point() + geom_smooth() + ggtitle("Evaluation de la performance mmoire de la mthode ADD en fonction de la taille")
GraphAddMemoire
save.image("E:\\Documents\\IUT - Semestre 4\\Module - P4a - Performance\\P4a\\.RData")
q()
File added
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="Common"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-15.0.2">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>P4a</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=15
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=15
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=15
package PersonalStructure;
import defaultpackage.Structure;
public class ChainedList implements Structure {
protected Link head;
protected Cursor cursor;
public int nbVal = 0;
//
// public ChainedList(Link head, Cursor cursor) {
// this.head = head;
// this.cursor = cursor;
// this.nbVal = 1;
// }
public ChainedList(Cursor cursor) {
this.cursor = cursor;
this.nbVal = 0;
}
public void setNextLink(Link currentLink)
{
Link last_next = this.cursor.currentLink.next;
this.cursor.currentLink.next = currentLink;
nbVal+=1;
}
public void setPreviousLink(Link currentLink)
{
Link last_next = this.cursor.currentLink.next;
this.cursor.currentLink.next = currentLink;
nbVal+=1;
}
public Link getLink()
{
return this.cursor.currentLink;
}
public Link getNextLink()
{
return this.cursor.currentLink.next;
}
public Link getPreviousLink(Link currentLink)
{
return this.cursor.currentLink.next;
}
public void replaceCursor(int position)
{
this.cursor.currentList = this;
this.cursor.position(position);
}
public boolean isEmpty() {
boolean res = false;
if(this.nbVal != 0)
res = true;
return res;
}
@Override
public void Add(int value) {
if (nbVal == 0) {
Link new_link = new Link(value);
this.head = new_link;
this.head.last = new_link;
this.cursor.currentLink = new_link;
this.head.next = new_link;
}
else {
this.replaceCursor(this.nbVal);
Link last_before_added = this.cursor.currentLink.last;
Link next_after_added = this.head;
Link new_link = new Link(value, next_after_added, last_before_added);
last_before_added.next = new_link;
this.head.last = new_link;
this.cursor.currentLink = new_link;
}
this.nbVal += 1;
}
public int GetNbVal()
{
return this.nbVal;
}
@Override
public void RemoveTete() throws Exception {
this.replaceCursor(nbVal - 1);
Link last_of_remove = this.cursor.currentLink.last;
Link next_of_remove = this.cursor.currentLink.next;
last_of_remove.next = next_of_remove;
next_of_remove.last = last_of_remove;
this.cursor.currentLink = next_of_remove;
}
@Override
public int Get(int index) throws Exception {
if ((index < 0) && isEmpty())
throw new IndexOutOfBoundsException("Wrong position");
this.replaceCursor(index);
return this.cursor.currentLink.value;
}
@Override
public void RemoveMiddle() throws Exception
{
if(nbVal%2==0)
{
// TODO Auto-generated method stub
this.replaceCursor(nbVal / 2);
Link last_of_remove = this.cursor.currentLink.last;
Link next_of_remove = this.cursor.currentLink.next;
last_of_remove.next = next_of_remove;
next_of_remove.last = last_of_remove;
this.cursor.currentLink = next_of_remove;
}
else
{
// TODO Auto-generated method stub
this.replaceCursor((nbVal-1) / 2);
Link last_of_remove = this.cursor.currentLink.last;
Link next_of_remove = this.cursor.currentLink.next;
last_of_remove.next = next_of_remove;
next_of_remove.last = last_of_remove;
this.cursor.currentLink = next_of_remove;
}
}
@Override
public int GetLenght() {
// TODO Auto-generated method stub
return nbVal;
}
}
package PersonalStructure;
public class Cursor {
protected Link currentLink;
protected ChainedList currentList;
protected int pos;
public Cursor(ChainedList currentList, Link currentLink, int pos) {
this.currentLink = currentLink;
this.currentList = currentList;
this.pos = pos;
}
public Cursor() {
this.pos = 0;
}
public void position(int pos)
{
// si on est arrivé à la bonne position, on garde le maillon actuel
if (pos == this.pos)
{
return;
}
// si nous sommes avant la position voulue, on avance
else if (pos > this.pos)
{
while(pos != this.pos)
{
goForward();
}
}
// si nous sommes après la position voulue, on recule
else if (pos < this.pos)
{
while(pos != this.pos)
{
goBack();
}
}
}
private void goForward()
{
// si on n'est pas encore arrivé à la fin de la liste, on avance
if(this.pos <= this.currentList.GetNbVal())
{
this.pos += 1;
this.currentLink = this.currentLink.next;
}
// sinon on retourne au début de la liste
else
{
this.pos = 0;
this.currentLink = this.currentList.head;
}
}
private void goBack() {
// si on n'est pas encore arrivé au début de la liste, on recule
if(this.pos >= 0)
{
this.pos -= 1;
}
// sinon on va à la fin de la liste
else {
this.pos = this.currentList.nbVal;
}
// on recule toujours
this.currentLink = this.currentLink.last;
}
private void setList(ChainedList list) {
this.currentList = list;
this.currentLink = list.head;
}
}
package PersonalStructure;
public class Link {
protected int value;
protected Link next;
protected Link last;
public Link(int value, Link next, Link last) {
this.value = value;
this.next = next;
this.last = next;
}
public Link(int value) {
this.value = value;
}
public void setNext(Link next) {
this.next = next;
}
public void setLast(Link last) {
this.last = last;
}
}
package StandardStructure;
import defaultpackage.Structure;
import java.util.ArrayList;
import java.util.Random;;
public class ArrayListC implements Structure
{
protected ArrayList<Integer> arrayList;
public ArrayListC(int nbValue)
{
Random rnd = new Random();
arrayList = new ArrayList<Integer>();
for(int i = 0; i < nbValue; i++)
{
Add(rnd.nextInt());
}
}
@Override
public void Add(int value)
{
arrayList.add(value);
}
@Override
public void RemoveTete() throws Exception
{
try
{
arrayList.remove(arrayList.size() - 1);
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
}
@Override
public int Get(int index) throws Exception
{
try
{
return arrayList.get(index);
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
}
@Override
public void RemoveMiddle() throws Exception {
// TODO Auto-generated method stub
if(arrayList.size()%2==0) {
arrayList.remove(arrayList.size()/2);
}
else {
arrayList.remove((arrayList.size()-1)/2);
}
}
@Override
public int GetLenght() {
// TODO Auto-generated method stub
return arrayList.size();
}
}
package StandardStructure;
import java.util.LinkedList;
import java.util.Random;
import defaultpackage.Structure;
public class LinkedListC implements Structure
{
LinkedList<Integer> linkedList;
public LinkedListC(int nbValue)
{
Random rnd = new Random();
linkedList = new LinkedList<Integer>();
for(int i = 0; i < nbValue; i++) {
Add(rnd.nextInt());
}
}
@Override
public void Add(int value) {
// TODO Auto-generated method stub
linkedList.add(value);
}
@Override
public void RemoveTete() throws Exception {
// TODO Auto-generated method stub
try
{
linkedList.remove(linkedList.size() - 1);
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
}
@Override
public int Get(int index) throws Exception
{
// TODO Auto-generated method stub
try
{
return linkedList.get(index);
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
}
@Override
public void RemoveMiddle() throws Exception {
// TODO Auto-generated method stub
if(linkedList.size()%2==0) {
linkedList.remove(linkedList.size()/2);
}
else {
linkedList.remove((linkedList.size()-1)/2);
}
}
@Override
public int GetLenght() {
// TODO Auto-generated method stub
return linkedList.size();
}
}
package StandardStructure;
import java.util.Random;
import defaultpackage.Structure;
public class Table implements Structure
{
Integer[] tab;
Integer nbValue = 0;
public Table(int nbValue)
{
Random rnd = new Random();
tab = new Integer[nbValue];
for(int i = 0; i < nbValue;i++)
{
Add(rnd.nextInt());
}
}
@Override
public void Add(int value) {
// TODO Auto-generated method stub
if(nbValue < tab.length)
{
tab[nbValue] = value;
nbValue++;
}
else
{
Integer[] temp = new Integer[nbValue * 2];
for(int i = 0; i < nbValue; i++)
{
temp[i] = tab[i];
}
temp[nbValue] = value;
tab=temp;
}
}
@Override
public void RemoveTete() throws Exception
{
// TODO Auto-generated method stub
try
{
for(int y = 1; y<tab.length;y++)
{
tab[y-1] = tab[y];
}
nbValue--;
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
}
@Override
public int Get(int index) throws Exception
{
// TODO Auto-generated method stub
try
{
return tab[index];
}
catch(IndexOutOfBoundsException e)
{
throw new Exception("L'index dfini ne se situe pas dans les bornes du tableau");
}
catch(NullPointerException e)
{
throw new Exception("Tableau n'existe pas");
}
}
@Override
public void RemoveMiddle() throws Exception
{
// TODO Auto-generated method stub
if(tab.length%2==0)
{
tab[tab.length/2]=null;
}
else
{
tab[(tab.length - 1)/2]=null;
}
int i = 0;
while(tab[i] != null)
{
i++;
}
for(int y = i+1; y<tab.length-1;y++)
{
tab[y-1] = tab[y];
}
}
@Override
public int GetLenght() {
// TODO Auto-generated method stub
return nbValue;
}
}
package defaultpackage;
import java.math.BigInteger;
import java.util.Random;
import com.sun.jdi.Type;
import PersonalStructure.ChainedList;
import PersonalStructure.Cursor;
import StandardStructure.ArrayListC;
import StandardStructure.LinkedListC;
import StandardStructure.Table;
public class Main {
Type tab;
public static void main(String[] args) throws NumberFormatException, Exception {
// TODO Auto-generated method stub
GenerateTab(args[0], Integer.parseInt(args[1]), args[2], Integer.parseInt(args[3]));
}
public static void GenerateTab(String type, int nbValue, String methode, Integer nbOperation) throws Exception
{
Random rnd = new Random();
if(type.equals("Tableau"))
{
Table tab = new Table(nbValue);
switch(methode)
{
case "Add":
{
for(int i = 0; i < nbOperation; i++)
{
tab.Add(rnd.nextInt());
}
break;
}
case"RemoveTete":
{
for(int i = 0; i < nbOperation; i++)
{
tab.RemoveTete();
}
break;
}
case"RemoveMiddle":
{
for(int i = 0; i < nbOperation; i++)
{
tab.RemoveMiddle();
}
break;
}
case "Get":
{
for(int i = 0; i < nbOperation; i++)
{
tab.Get(rnd.nextInt(tab.GetLenght()-1));
}
break;
}
}
}
if(type.equals("Array")) {
ArrayListC array = new ArrayListC(nbValue);
switch(methode)
{
case "Add":
{
for(int i = 0; i < nbOperation; i++)
{
array.Add(rnd.nextInt());
}
break;
}
case"RemoveTete":
{
for(int i = 0; i < nbOperation; i++)
{
array.RemoveTete();
}
break;
}
case"RemoveMiddle":
{
for(int i = 0; i < nbOperation; i++)
{
array.RemoveMiddle();
}
break;
}
case "Get":
{
for(int i = 0; i < nbOperation; i++)
{
array.Get(rnd.nextInt(array.GetLenght()));
}
break;
}
}
}
if(type.equals("Linked"))
{
LinkedListC linked = new LinkedListC(nbValue);
switch(methode)
{
case "Add":
{
for(int i = 0; i < nbOperation; i++)
{
linked.Add(rnd.nextInt());
}
break;
}
case"RemoveTete":
{
for(int i = 0; i < nbOperation; i++)
{
linked.RemoveTete();
}
break;
}
case"RemoveMiddle":
{
for(int i = 0; i < nbOperation; i++)
{
linked.RemoveMiddle();
}
break;
}
case "Get":
{
for(int i = 0; i < nbOperation; i++)
{
linked.Get(rnd.nextInt(linked.GetLenght()-1));
}
break;
}
}
}
if(type.equals("Maillon"))
{
Cursor cursor = new Cursor();
ChainedList maillons = new ChainedList(cursor);
Random rndMaillon = new Random();
for(int i = 0; i < nbValue; i++) {
maillons.Add(rndMaillon.nextInt());
}
switch(methode)
{
case "Add":
{
for(int i = 0; i < nbOperation; i++)
{
maillons.Add(rnd.nextInt());
}
break;
}
case"RemoveTete":
{
for(int i = 0; i < nbOperation; i++)
{
maillons.RemoveTete();
}
break;
}
case"RemoveMiddle":
{
for(int i = 0; i < nbOperation; i++)
{
maillons.RemoveMiddle();
}
break;
}
case "Get":
{
for(int i = 0; i < nbOperation; i++)
{
maillons.Get(rnd.nextInt(maillons.GetLenght()-1));
}
break;
}
}
}
}
}
package defaultpackage;
public interface Structure
{
public void Add(int value);
public void RemoveTete() throws Exception;
public void RemoveMiddle() throws Exception;
public int Get(int index) throws Exception;
public int GetLenght();
}
/StandardStructure/
/defaultpackage/
/PersonalStructure/
Manifest-Version: 1.0
Main-Class: defaultpackage.Main
......@@ -4,29 +4,64 @@
## Problème
Description du Problème.
**Langage utilisé**
Nous avons choisi d'utiliser le langage Java car il est plus adapté à notre organisation.
**Description du problème**
Analyse de performance de quatre structures identiques contenant des nombres mais fonctionnant différemment.
Nous aurons plusieurs paramètres au démarrage :
- Nombre de valeurs dans chaque tableau : chaque structure a une taille fixe de un million d'éléments générés aléatoirement.
- Nombre d'opérations : à chaque test, on augmente le nombre d'opérations de 100. Le nombre d'opérations varie de 100 à 5000.
- Type de l'opération : AddTete, AddQueue, RemoveTete, RemoveMiddle ou Get.
- Type de structure : nous utilisons des structures déjà existante (ArrayList, LinkedList, Table) et que nous avons créées nous-même (ChainedList composée de Link et d'un Cursor).
Contrainte : il faut de l’abstraction, et au moins un tableau ET une liste chaînée (Maillons)
**Description des paramètres exploratoires du problème**
- Analyser la différence de temps d'éxécution CPU et de consommation de mémoire sur des opérations simples dans chaque structure (insérer, supprimer, sélectionner).
**Organisation du projet**
Description de tous les paramètres exploratoires du problème
## Dispositif expérimental
### Organisation objet
Description de l'organisation des classes et interfaces, ou diagramme de classes.
**Description de l'organisation des classes et interfaces**
Nous avons utilisé trois packages différents :
- Un pour les structures déjà existantes, StandardStructure : ArrayList, LinkedList et Table.
- Un pour celle que nous avons créée, PersonalStructure : ChainedList et ses composants, Link et Cursor.
- Un pour ce qui est commun aux deux packages précédents, defaultpackage : Main et Structure.
Pour les structures déjà existantes, nous avons préféré recréer une classe wrapper pour chacune d'entre elles afin de personnaliser les fonctions que nous voulions tester et adapter leur fonctionnement à chaque structure.
**Diagramme de classes**
![](/UML_P4a.png)
### Application
[code source de l'application](chemin)
```
Description de l'application et des arguments
```
[code source de l'application](/Main.jar)
**Description de l'application et des arguments**
Pour utiliser notre application, il faut lui passer plusieurs paramètres dans l'ordre suivant : le type de structure que l'on souhaite évaluer, le nombre de valeurs (un million), la méthode que l'on va évaluer et le nombre d'opérations.
Le Main va ensuite créer une structure en fonction des paramètres qu'on lui a passé et la remplir de nombres aléatoires. Il va ensuite appeler la fonction choisie en utilisant un switch.
### Environnement de test
Description de la plateforme de test
```
Extrait pertinent de /proc/cpuinfo
```
![](/cpuinfo.png)
### Description de la démarche systématique
......@@ -40,11 +75,12 @@ Suite des commandes, ou script, à exécuter pour produire les données.
### Temps d'exécution
![plot](prealable.png)
![plot](/tpsExecutionCpu.png)
![plot zoomé](/tpsExecutionzoomer.png)
### Consommation mémoire
![plot](prealable-mem.png)
![plot](/consoMemoire.png)
### Analyse des résultats préalables
......@@ -65,7 +101,13 @@ Expression précise et succincte d'une hypothèse.
### Protocole expérimental de vérification de l'hypothèse
Expression précise et succincte du protocole.
Ainsi, le code nous renverra l’indice qui correspond à l’endroit où la valeur voulue se trouve dans le tableau et nous aurons un résultat correspondant à l'indice de la valeur trouvée dans chaque tableau
- Temps d'exécution des deux programmes (et leur différence)
- Types de recherche de chaque programme (une standard et une recherche dichotomique)
- Comment le “Random” influe sur la performance des structures
- Comment améliorer la performance des deux structures
- Déterminer la classe de compléxité des structures
```
Suite des commandes, ou script, à exécuter pour produire les données.
......
<mxfile host="app.diagrams.net" modified="2021-03-09T14:27:15.252Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36" etag="9Kk41M0dOw_UMj_LRa3x" version="14.4.6" type="device"><diagram id="R8-pWj9DbBJSb4AKZ-qf" name="Page-1">7Vxtc9soEP41nul9aEYSkmx/tJ32Xia9yTSdXvuRWMTmKgsPxolzv/5AgN5AtpwIp1O7HzoWWhDafXb3YSEagNlq9zuF6+UnkqB0EHjJbgCuB0EQjiP+v2h4lg0RALJhQXEim/yy4Q7/h1Sjp1q3OEGbmiAjJGV4XW+ckyxDc1Zrg5SSp7rYA0nrT13DhXqiVzbczWGKDLF/cMKWsnUUDMv2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