Skip to content
Snippets Groups Projects
Commit 12ffda11 authored by Gjorgji's avatar Gjorgji
Browse files

Fixes helsinki: ferry file not found, before sim script, and messina before sim script

parent cb5154e4
Branches master
No related tags found
No related merge requests found
...@@ -10,6 +10,8 @@ colnames(cons) <- c('district',c(1:7),c('m','f','totals')) ...@@ -10,6 +10,8 @@ colnames(cons) <- c('district',c(1:7),c('m','f','totals'))
#remove district #remove district
districts <- cons[1] districts <- cons[1]
cons <- cons[,-c(1)] cons <- cons[,-c(1)]
cons <- cons[,-c(1,dim(cons)[2])]
ind$age <- as.character(ind$age) ind$age <- as.character(ind$age)
......
...@@ -11,6 +11,7 @@ colnames(cons) <- c('district',c(1:5),c('f','m','totals')) ...@@ -11,6 +11,7 @@ colnames(cons) <- c('district',c(1:5),c('f','m','totals'))
#remove district and totals #remove district and totals
districts <- cons[1] districts <- cons[1]
#cons <- cons[,-c(1)] #cons <- cons[,-c(1)]
cons <- cons[,-c(1,dim(cons)[2])]
......
...@@ -112,5 +112,6 @@ cons1['5'] = a5 ...@@ -112,5 +112,6 @@ cons1['5'] = a5
cons1['f'] = cons['f'] cons1['f'] = cons['f']
cons1['m'] = cons['m'] cons1['m'] = cons['m']
cons1['total']=cons1.m+cons1.f cons1['total']=cons1.m+cons1.f
cons1.index=["1_Circoscrizione","2_Circoscrizione","3_Circoscrizione","4_Circoscrizione","5_Circoscrizione","6_Circoscrizione"]
cons1.to_csv(os.sep.join([data_path,"cons.csv"])) cons1.to_csv(os.sep.join([data_path,"cons.csv"]))
...@@ -72,7 +72,7 @@ public class SimulationRunService { ...@@ -72,7 +72,7 @@ public class SimulationRunService {
logger.info("running steps before simulation..."); logger.info("running steps before simulation...");
runPythonPreprocess(); runPythonPreprocess();
runRScript(); runRScript();
if (this.city.equals("helsinki")){ if (this.city.equals("helsinki") && new File(ferriesToAddPath).exists()){
String new_ferries = new String(Files.readAllBytes(Paths.get(ferriesToAddPath)), StandardCharsets.UTF_8); String new_ferries = new String(Files.readAllBytes(Paths.get(ferriesToAddPath)), StandardCharsets.UTF_8);
FileWriter fw = new FileWriter(ferriesPath,true); FileWriter fw = new FileWriter(ferriesPath,true);
fw.write(new_ferries); fw.write(new_ferries);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment