From e7b9f75035d6aa37577ad8d69191bb9606c7f6c3 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Fri, 24 Mar 2023 10:48:49 +0100 Subject: [PATCH] Fix integration of python with the java project --- build.gradle | 2 +- plot/main.py | 12 ++---------- src/main/java/fr/ntr/scheduler/ProportionalFair.java | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index c64edef..fb0aa8c 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ plugins { } run { - args = ["1000", "250"] + args = ["10000", "50"] } application { diff --git a/plot/main.py b/plot/main.py index 2bfb0dc..a63b194 100644 --- a/plot/main.py +++ b/plot/main.py @@ -3,15 +3,7 @@ import matplotlib.pyplot as plt import numpy as np import pandas as pd -""" -data = pd.read_csv("data.csv", delimiter=';').to_numpy() - -tick = data[:, 0] - -rb = data[:, 4] - -""" -nb_files = os.listdir('export/') +nb_files = os.listdir(".." + os.sep + "export") size = len(nb_files) @@ -19,7 +11,7 @@ size = len(nb_files) averages = np.empty((size, 2)) nb = 0 for i in nb_files: - data = pd.read_csv("export" + os.sep + i, delimiter=';').to_numpy() + data = pd.read_csv(".." + os.sep + "export" + os.sep + i, delimiter=';').to_numpy() rb = data[:, 4] total = 0.0 diff --git a/src/main/java/fr/ntr/scheduler/ProportionalFair.java b/src/main/java/fr/ntr/scheduler/ProportionalFair.java index 4ef2757..8ed0cb8 100644 --- a/src/main/java/fr/ntr/scheduler/ProportionalFair.java +++ b/src/main/java/fr/ntr/scheduler/ProportionalFair.java @@ -28,7 +28,7 @@ public class ProportionalFair extends Scheduler { } } avg = avg / (bandwidthTable.length * bandwidthTable[0].length); - averageBandwiths.add(new Double(avg)); + averageBandwiths.add(avg); } User selectedUser = null; for(int ts = 0; ts < 2; ts++){