Skip to content
Snippets Groups Projects
Commit 038516f7 authored by AxelCarayon's avatar AxelCarayon
Browse files

add nb of cycles in params and added the output file in the .gitignore file

parent 6326a38b
No related branches found
No related tags found
No related merge requests found
......@@ -19,5 +19,7 @@
*.tar.gz
*.rar
output.csv
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
......@@ -62,19 +62,3 @@ SUCEPTIBLE,EXPOSED,RECOVERED,INFECTED
0,0,9083,917
0,0,9144,856
0,0,9198,802
0,0,9245,755
0,0,9296,704
0,0,9342,658
0,0,9385,615
0,0,9428,572
0,0,9457,543
0,0,9490,510
0,0,9518,482
0,0,9541,459
0,0,9580,420
0,0,9608,392
0,0,9630,370
0,0,9647,353
0,0,9674,326
0,0,9690,310
0,0,9708,292
......@@ -9,6 +9,7 @@ public class Parameters {
float infectionChance;
float incubationRate;
float recoveryRate;
int nbOfCycles;
public Parameters() {
}
......@@ -62,4 +63,12 @@ public class Parameters {
public void setRecoveryRate(float recoveryRate) {
this.recoveryRate = recoveryRate;
}
public int getNbOfCycles() {
return nbOfCycles;
}
public void setNbOfCycles(int nbOfCycles) {
this.nbOfCycles = nbOfCycles;
}
}
......@@ -73,7 +73,9 @@ public class SMA {
}
public void run() throws IOException, InterruptedException {
while (true) {
int cpt = 0;
while (cpt < parameters.getNbOfCycles()) {
cpt++;
scheduler.nextCycle();
stats = environment.getAgentStatus();
updateGraphics();
......
......@@ -5,5 +5,4 @@ nbOfPatientZero : 1
infectionChance : 0.1 #percentage of chance that an infected agent will spread to a susceptible agent
incubationRate : 0.5 #chance that an exposed agent become infected each cycle
recoveryRate : 0.05 #chance that an infected agent become recovered each cycle
#TODO : ajouter le nu démographie
\ No newline at end of file
nbOfCycles : 100
\ No newline at end of file
......@@ -5,5 +5,4 @@ nbOfPatientZero : 1
infectionChance : 0.1 #percentage of chance that an infected agent will spread to a susceptible agent
incubationRate : 0.5 #chance that an exposed agent become infected each cycle
recoveryRate : 0.05 #chance that an infected agent become recovered each cycle
#TODO : ajouter le nu démographie
\ No newline at end of file
nbOfCycles : 100
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment