Commit 4bfb797d authored by Mohcine Chraibi's avatar Mohcine Chraibi

Optimize includes + jpsfire fix

parent 40851b44
Pipeline #5815 failed with stages
in 57 seconds
......@@ -36,6 +36,12 @@ endif ()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${warnings}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${warnings}")
# TODO clean up. no flags.
#set(CMAKE_CXX_STANDARD 11)
#set(CMAKE_CXX_STANDARD_REQUIRED ON)
#set(CMAKE_CXX_EXTENSIONS OFF)
if (NOT BUILD_TESTING)
set(BUILD_TESTING OFF) # test units & python tests are not generated.
endif (NOT BUILD_TESTING)
......
......@@ -21,7 +21,6 @@
#include "GeoFileParser.h"
#include "../tinyxml/tinyxml.h"
#include "../geometry/Goal.h"
#include "../geometry/SubRoom.h"
GeoFileParser::GeoFileParser(Configuration* configuration)
......
......@@ -33,8 +33,6 @@
#include "../mpi/LCGrid.h"
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;
......
......@@ -28,9 +28,6 @@
#include "OutputHandler.h"
#include <stdio.h>
#include <stdarg.h>
#include <cstdlib>
#include <cmath>
using namespace std;
......
......@@ -29,9 +29,6 @@
/********* include files ******************************************************/
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "TraVisToClient.h"
#include "../general/Macros.h"
......
......@@ -30,12 +30,7 @@
#include "../../pedestrian/Pedestrian.h"
#include "../generic/FDSMesh.h"
#include "../generic/FDSMeshStorage.h"
#include "../../pedestrian/PedDistributor.h"
#include "../../tinyxml/tinyxml.h"
#include <set>
#include <algorithm>
#include <math.h>
#include "../../IO/OutputHandler.h"
#include <boost/filesystem.hpp>
using namespace boost::filesystem;
......
#include "FDSMesh.h"
#include <cmath>
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
std::vector<std::string> &split2(const std::string &s, char delim, std::vector<std::string> &elems) {
std::stringstream ss(s);
......@@ -163,17 +159,23 @@ void FDSMesh::ReadMatrix(std::string line, std::ifstream &pFile)
while (std::getline(pFile, line)) {
n = 0;
strVec = split2(line, ',', strVec);
for (auto &elem : strVec)
{
for (auto &elem : strVec) {
//std::cout << elem << " col " << n << " line " << m << std::endl;
if (elem=="nan" || elem=="NAN" || elem=="NaN" || elem=="-inf" || elem=="inf")
{
if (elem=="nan" || elem=="NAN" || elem=="NaN" || elem=="-inf" || elem=="inf") {
_matrix[m][n].SetValue(1.0);
//Log->Write("ERROR: Mesh values consist of nan!");
//exit(EXIT_FAILURE);
}
else
_matrix[m][n].SetValue(std::stod(elem));
else {
double temp = 0;
try {
temp = std::stod(elem);
}
catch (...) {
std::cout << "can not convert " << elem << std::endl;
}
_matrix[m][n].SetValue(temp);
}
++n;
}
strVec.clear();
......
......@@ -27,11 +27,8 @@
*
**/
#include "FDSMeshStorage.h"
#include "../../IO/OutputHandler.h"
//#include <unistd.h>
#include <stdio.h>
//#include <glob.h>
#include <string>
#include <boost/filesystem.hpp>
namespace fs=boost::filesystem;
......@@ -161,7 +158,7 @@ void FDSMeshStorage::CreateTimeList()
{
/// Create time list for mesh refreshment
_timelist.clear();
double i=0;
double i=0;
while (i<=_finalTime)
{
_timelist.push_back(i);
......@@ -174,12 +171,12 @@ void FDSMeshStorage::CreateTimeList()
if (_doorlist.size() > 0) { // Smoke sensor active
check_str = _filepath + _quantitylist[0] + "/" +
_doorlist[0] + "/t_" + std::to_string(elem) + ".csv";
// std::cout << "1: " << check_str << std::endl;
std::cout << "1: " << check_str << std::endl;
}
else if (_doorlist.size() == 0) { // Smoke sensor not active
check_str = _filepath + _quantitylist[0] + "/Z_" +
std::to_string(_elevationlist[0]) + "/t_" + std::to_string(elem) + ".csv";
// std::cout << "2: " << check_str << std::endl;
std::cout << "2: " << check_str << std::endl;
}
if (fs::exists(check_str) == false )
......
......@@ -35,12 +35,9 @@
#include "math/GompertzModel.h"
#include "math/GradientModel.h"
#include "pedestrian/AgentsQueue.h"
#include "pedestrian/AgentsSourcesManager.h"
#ifdef _OPENMP
#include <omp.h>
#else
#define omp_get_thread_num() 0
#define omp_get_max_threads() 1
......
......@@ -7,12 +7,12 @@ See template_test/How_to_make_new_test.txt
import fnmatch
import glob
import logging
from os import path
import numpy as np
import os
from stat import S_ISREG, ST_MODE, ST_MTIME
import subprocess
import sys
import numpy as np
from os import path
from stat import S_ISREG, ST_MODE, ST_MTIME
__author__ = 'Oliver Schmidts'
__email__ = 'dev@jupedsim.org'
......
......@@ -2,11 +2,12 @@
measure the fundamental diagram in a 1d scenario.
return density, velocity
"""
import glob
import numpy as np
import os
import glob
from sys import *
import sys
from sys import *
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
path.append(utestdir)
from utils import *
......
......@@ -22,9 +22,10 @@ Source
"""
import matplotlib.pyplot as plt
import os
import sys
import matplotlib.pyplot as plt
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
......@@ -2,9 +2,9 @@
plot fundamental diagram produced by runtest
just to check the results without reruning the test
"""
import glob
import matplotlib.pyplot as plt
import numpy as np
import glob
simfiles = glob.glob("Output/Fundamental_Diagram/Individual_FD/*.dat")
expfiles = glob.glob("data/*.txt")
......
......@@ -16,9 +16,10 @@ Source
"""
import matplotlib.pyplot as plt
import os
import sys
import matplotlib.pyplot as plt
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
......@@ -17,9 +17,10 @@ Source
"""
import matplotlib.pyplot as plt
import os
import sys
import matplotlib.pyplot as plt
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
......@@ -17,9 +17,10 @@ Source
"""
import matplotlib.pyplot as plt
import os
import sys
import matplotlib.pyplot as plt
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
......@@ -18,9 +18,10 @@ Source
Table 4.4 Jun Zhang Diss.
"""
import matplotlib.pyplot as plt
import os
import sys
import matplotlib.pyplot as plt
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
......@@ -18,9 +18,10 @@ Source
"""
import matplotlib.pyplot as plt
import os
import sys
import matplotlib.pyplot as plt
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
#!/usr/bin/env python3
import glob
import logging
import matplotlib.pyplot as plt
import multiprocessing
import numpy as np
import os, logging, time, sys
from sys import argv, exit
import subprocess, glob
import os
import subprocess
import sys
import time
from os import path
import multiprocessing
import matplotlib.pyplot as plt
from sys import argv, exit
def get_empirical_flow():
files = glob.glob("experiments/*.txt")
......@@ -79,7 +84,7 @@ if __name__ == "__main__":
# lib_path = os.path.abspath(lib_path)
sys.path.append(lib_path)
from utils import SUCCESS, FAILURE
from utils import parse_file, flow, rolling_flow
from utils import parse_file, rolling_flow
# from utils import get_maxtime
os.chdir("..")
TRUNK = os.getcwd()
......
......@@ -2,14 +2,16 @@
# todo: spaghetti code. directory mess
import numpy as np
from xml.dom import minidom
import os, argparse, logging, time
from os import path, system
from sys import argv ,exit
import subprocess, glob, sys
import multiprocessing
import glob
import logging
import matplotlib.pyplot as plt
import numpy as np
import os
import subprocess
import sys
import time
from os import path
from sys import argv, exit
#=========================
testnr = 10
......
#! /usr/bin/env python
import glob
import logging
import numpy as np
import os
import subprocess
import sys
from os import path
from sys import argv, exit
from xml.dom import minidom
import os, argparse, logging, time
from os import path, system
from sys import argv ,exit
import subprocess, glob
import multiprocessing
import matplotlib.pyplot as plt
import re, sys
#=========================
testnr = 11
......
#! /usr/bin/env python
import glob
import logging
import numpy as np
import os
import subprocess
import sys
from os import path
from sys import argv, exit
from xml.dom import minidom
import os, argparse, logging, time
from os import path, system
from sys import argv ,exit
import subprocess, glob
import multiprocessing
import matplotlib.pyplot as plt
import re, sys
#=========================
testnr = 11
......
#! /usr/bin/env python
import logging
import numpy as np
from xml.dom import minidom
import os, argparse, logging, time
from os import path, system
from sys import argv ,exit
import subprocess, glob
import multiprocessing
import matplotlib.pyplot as plt
import re
import os
import subprocess
from os import path
from sys import argv, exit
#=========================
testnr = 11
......
......@@ -22,9 +22,6 @@ import os
import sys
from sys import *
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
import scipy
import scipy.stats
import matplotlib.pyplot as plt
sys.path.append(utestdir)
from JPSRunTest import JPSRunTestDriver
from utils import *
......
......@@ -16,10 +16,11 @@ Source
"""
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
# help: python3 makeini.py -h
import os, sys, glob
from shutil import copy2, rmtree, move
import logging, types, argparse
import errno, time
from numpy import *
import argparse
import errno
import glob
import logging
import os
import sys
import time
from itertools import product
from numpy import *
from shutil import copy2, rmtree, move
try:
import xml.etree.cElementTree as ET
except ImportError:
......
import re, subprocess
import re
import subprocess
from pylatex import Document, Command, PageStyle, Head, MiniPage, LargeText, LineBreak, \
MediumText, LongTabu, NewPage, Package, Section, Description, NoEscape, Subsection, Figure, Center
from pylatex.utils import NoEscape, bold, verbatim
from pylatex.base_classes import Environment
MediumText, LongTabu, NewPage, Package, Section, Description, Figure
from pylatex.utils import NoEscape, bold
def get_evac_time(testnumber):
......
......@@ -16,9 +16,10 @@ Source
http://www.rimea.de/fileadmin/files/dok/richtlinien/RiMEA_Richtlinie_3.0.0_-_D-E.pdf
"""
import glob
import os
import sys
import glob
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
......@@ -35,9 +35,10 @@ Source
http://www.rimea.de/fileadmin/files/dok/richtlinien/RiMEA_Richtlinie_3.0.0_-_D-E.pdf
"""
import matplotlib.pyplot as plt
import os
import sys
import matplotlib.pyplot as plt
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
......@@ -23,7 +23,7 @@ http://www.rimea.de/fileadmin/files/dok/richtlinien/RiMEA_Richtlinie_3.0.0_-_D-E
import numpy as np
import os
import sys
import glob
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
......@@ -25,7 +25,7 @@ http://www.rimea.de/fileadmin/files/dok/richtlinien/RiMEA_Richtlinie_3.0.0_-_D-E
import numpy as np
import os
import sys
import glob
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
......@@ -41,8 +41,9 @@ http://www.rimea.de/fileadmin/files/dok/richtlinien/RiMEA_Richtlinie_3.0.0_-_D-E
"""
import numpy as np
import matplotlib
import numpy as np
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
......
......@@ -24,9 +24,10 @@ Source
http://www.rimea.de/fileadmin/files/dok/richtlinien/RiMEA_Richtlinie_3.0.0_-_D-E.pdf
"""
import numpy as np
import os
import sys
import numpy as np
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
......@@ -17,9 +17,10 @@ Source
http://www.rimea.de/fileadmin/files/dok/richtlinien/RiMEA_Richtlinie_3.0.0_-_D-E.pdf
"""
import numpy as np
import os
import sys
import numpy as np
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.mlab as mlab
weidman_max_vel = np.array([1.61, 1.54, 1.41, 0.76])
weidman_min_vel = np.array([0.58, 1.41, 0.68, 0.46])
......
......@@ -36,10 +36,11 @@ Source
http://www.rimea.de/fileadmin/files/dok/richtlinien/RiMEA_Richtlinie_3.0.0_-_D-E.pdf
"""
import os
import sys
import numpy as np
import os
import pylab as P
import sys
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
from sys import *
sys.path.append(utestdir)
......
......@@ -30,7 +30,7 @@ http://www.rimea.de/fileadmin/files/dok/richtlinien/RiMEA_Richtlinie_3.0.0_-_D-E
import os
import sys
from sys import *
import glob
utestdir = os.path.abspath(os.path.dirname(os.path.dirname(sys.path[0])))
sys.path.append(utestdir)
from JPSRunTest import JPSRunTestDriver
......
#! /usr/bin/env python
import numpy as np
import os, argparse, logging, time, sys
from os import path, system
from sys import argv ,exit
import subprocess, glob
import multiprocessing
import matplotlib.pyplot as plt
import re
import glob
import logging
import os
import subprocess
import sys
from os import path
from sys import argv, exit
#=========================
testnr = 1
......
from xml.dom import minidom
import logging
import numpy as np
import pandas as pd
from xml.dom import minidom
SUCCESS = 0
FAILURE = -1
critical_value = 0.9
......
......@@ -27,25 +27,16 @@
#include <string>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <math.h>
#include <stdio.h>
#include "../pedestrian/Pedestrian.h"
#include "../pedestrian/Knowledge.h"
#include "../mpi/LCGrid.h"
#include "../geometry/Building.h"
#include "../geometry/SubRoom.h"
#include "../geometry/Transition.h"
#include "../geometry/Point.h"
#include "../tinyxml/tinyxml.h"
#include "../IO/OutputHandler.h"
#include "../IO/IODispatcher.h"
#include "../routing/RoutingEngine.h"
#include "../routing/global_shortest/GlobalRouter.h"
#include "../routing/quickest/QuickestPathRouter.h"
#include "../routing/ai_router/AIRouter.h"
......
......@@ -34,8 +34,6 @@
#ifdef _OPENMP
#include <omp.h>
#else
#define omp_get_thread_num() 0
#define omp_get_max_threads() 1
......@@ -43,13 +41,11 @@
#include "../IO/OutputHandler.h"
#include "ArgumentParser.h"
#include "Macros.h"
#include "../pedestrian/AgentsParameters.h"
#include "../routing/global_shortest/GlobalRouter.h"
#include "../routing/quickest/QuickestPathRouter.h"
#include "../routing/ai_router/AIRouter.h"
#include "../IO/IniFileParser.h"
#include <sys/stat.h>
using namespace std;
......
......@@ -36,10 +36,7 @@
#include "GeometryReader.h"
#include "../pedestrian/Pedestrian.h"
#include "../mpi/LCGrid.h"
#include "../routing/RoutingEngine.h"
#include "../pedestrian/PedDistributor.h"
#include "../IO/GeoFileParser.h"
#include "../hybrid/GeometryFromProtobufLoader.h"
#endif
......@@ -47,8 +44,6 @@
#ifdef _OPENMP
#include <omp.h>
#else
#define omp_get_thread_num() 0
#define omp_get_max_threads() 1
......
......@@ -29,13 +29,13 @@
#ifndef _BUILDING_H
#define _BUILDING_H
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <cfloat>
#include <map>
#include <memory>
// nclude <cstdlib>
// #include <string>
// #include <vector>
// #include <fstream>
// #include <cfloat>
// #include <map>
// #include <memory>
#include "Room.h"
#include "NavLine.h"
......
......@@ -27,7 +27,6 @@
#include "Crossing.h"
#include "Room.h"