Skip to content
Snippets Groups Projects
Commit 8f1a49e7 authored by AxelCarayon's avatar AxelCarayon
Browse files

modified access to ressources to make it "jar-friendly"

parent 56118efb
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
*.tar.gz *.tar.gz
*.rar *.rar
output.csv src/main/resources/output.csv
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid* hs_err_pid*
This diff is collapsed.
...@@ -28,6 +28,6 @@ def showDiagram(data): ...@@ -28,6 +28,6 @@ def showDiagram(data):
plt.show() plt.show()
data = readCSV("output.csv") data = readCSV("src/main/resources/output.csv")
showDiagram(data) showDiagram(data)
\ No newline at end of file
...@@ -90,7 +90,7 @@ public class SMA { ...@@ -90,7 +90,7 @@ public class SMA {
private void doNextCycle() throws IOException, InterruptedException { private void doNextCycle() throws IOException, InterruptedException {
scheduler.nextCycle(); scheduler.nextCycle();
stats = environment.getAgentStatus(); stats = environment.getAgentStatus();
StatsRecorder.writeToCSV(stats,"output.csv"); StatsRecorder.writeToCSV(stats,"src/main/resources/output.csv");
updateGraphics(); updateGraphics();
if (parameters.getTimeBetweenCycles() > 0) { if (parameters.getTimeBetweenCycles() > 0) {
Thread.sleep(parameters.getTimeBetweenCycles()); Thread.sleep(parameters.getTimeBetweenCycles());
......
...@@ -8,7 +8,6 @@ import java.util.List; ...@@ -8,7 +8,6 @@ import java.util.List;
public class StatsRecorder { public class StatsRecorder {
private static int nbOfCycles = 0; private static int nbOfCycles = 0;
private static ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
public static void writeToCSV(HashMap<String,Integer> data, String outputFile) throws IOException { public static void writeToCSV(HashMap<String,Integer> data, String outputFile) throws IOException {
......
...@@ -12,12 +12,12 @@ public class YamlReader { ...@@ -12,12 +12,12 @@ public class YamlReader {
private static ObjectMapper om = new ObjectMapper(new YAMLFactory()); private static ObjectMapper om = new ObjectMapper(new YAMLFactory());
private static Parameters parameters; private static Parameters parameters;
public static final String FILE_PATH = "parameters.yaml"; public static final String FILE_PATH = "src/main/resources/parameters.yaml";
public static Parameters getParams() { public static Parameters getParams() {
if (parameters == null) { if (parameters == null) {
System.out.println("Getting parameters in parameters.yaml file ..."); System.out.println("Getting parameters in parameters.yaml file ...");
File file = new File(classLoader.getResource(FILE_PATH).getFile()); File file = new File(FILE_PATH);
try { try {
parameters = om.readValue(file,Parameters.class); parameters = om.readValue(file,Parameters.class);
} catch (Exception e) { } catch (Exception e) {
......
SUCEPTIBLE,EXPOSED,RECOVERED,INFECTED
996,3,1,0
997,3,0,0
997,3,0,0
995,4,0,1
994,5,0,1
994,5,1,0
994,4,1,1
991,6,1,2
989,8,2,1
987,9,3,1
984,11,3,2
982,13,3,2
979,15,3,3
973,20,4,3
973,21,3,3
971,21,5,3
967,23,6,4
965,22,8,5
964,20,12,4
961,20,14,5
959,20,14,7
960,20,12,8
958,23,11,8
953,28,14,5
950,29,14,7
942,32,18,8
939,33,21,7
937,32,21,10
933,34,21,12
920,43,22,15
912,51,21,16
906,49,25,20
898,54,29,19
897,51,33,19
890,57,37,16
889,58,39,14
883,55,42,20
878,52,50,20
874,54,52,20
867,57,55,21
867,57,57,19
860,63,62,15
859,63,61,17
863,62,60,15
864,62,59,15
861,60,61,18
857,59,61,23
848,64,64,24
842,65,70,23
838,66,74,22
835,64,79,22
829,67,82,22
827,68,82,23
827,67,79,27
820,74,83,23
810,74,88,28
809,74,94,23
804,78,100,18
805,74,101,20
799,76,108,17
795,70,113,22
792,75,115,18
785,79,117,19
779,80,122,19
780,78,126,16
782,76,127,15
778,83,120,19
770,86,122,22
766,82,125,27
758,81,132,29
750,84,134,32
746,85,137,32
738,87,144,31
739,90,144,27
737,86,146,31
734,85,142,39
723,92,147,38
717,95,151,37
719,96,153,32
717,99,156,28
714,97,156,33
698,105,161,36
696,106,160,38
690,107,164,39
686,111,170,33
687,111,173,29
678,108,173,41
668,115,180,37
669,119,182,30
666,125,180,29
655,135,186,24
657,131,181,31
659,127,172,42
656,134,168,42
654,129,166,51
648,136,165,51
643,137,169,51
628,147,176,49
618,149,183,50
621,146,192,41
612,149,202,37
608,148,202,42
602,154,209,35
598,148,207,47
602,151,206,41
601,145,213,41
603,143,208,46
585,153,218,44
584,150,213,53
585,151,214,50
579,155,216,50
573,158,219,50
567,161,227,45
557,167,234,42
552,164,233,51
549,160,238,53
554,149,251,46
554,147,251,48
548,152,248,52
550,147,256,47
543,154,258,45
540,151,263,46
537,148,266,49
528,158,267,47
517,162,274,47
519,169,264,48
523,164,257,56
519,165,265,51
518,167,262,53
512,163,265,60
499,164,277,60
499,168,277,56
488,164,284,64
486,164,282,68
485,161,290,64
474,170,292,64
460,179,296,65
453,184,296,67
455,173,298,74
446,179,295,80
439,182,300,79
436,188,299,77
427,188,317,68
418,189,325,68
410,187,327,76
408,193,330,69
399,191,338,72
396,190,349,65
401,187,351,61
409,178,343,70
397,187,348,68
389,201,360,50
390,201,353,56
379,206,359,56
371,204,356,69
368,202,357,73
362,203,364,71
358,201,376,65
357,192,392,59
372,191,382,55
357,196,380,67
357,206,374,63
346,219,380,55
337,223,377,63
336,214,382,68
331,219,384,66
330,225,383,62
339,218,385,58
339,217,385,59
332,210,388,70
325,211,398,66
312,210,394,84
300,233,391,76
289,237,401,73
287,231,411,71
292,226,412,70
289,232,405,74
290,234,411,65
298,224,409,69
298,220,411,71
305,209,406,80
300,203,412,85
302,201,421,76
302,202,418,78
305,201,427,67
303,201,423,73
302,207,427,64
307,201,425,67
317,198,422,63
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment