Commit 46626dbc authored by Erik Andresen's avatar Erik Andresen

Merge branch 'v0.7' of cst.version.fz-juelich.de:jupedsim/jpscore into v0.7

parents ccbaa466 6fcc9848
......@@ -3,6 +3,7 @@
# -DCMAKE_BUILD_TYPE:STRING=Debug (default Release)
# -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON (default OFF)
# -DBUILD_TESTING=ON (default OFF)
# -DBUILD_CPPUNIT_TEST=ON (default OFF)
#--------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
......@@ -18,10 +19,15 @@ set(JPSCORE_VERSION
message( STATUS "JPSCORE_VERSION: " ${JPSCORE_VERSION} )
if(NOT BUILD_TESTING)
set(BUILD_TESTING OFF) # test units are not generated.
set(BUILD_TESTING OFF) # test units & python tests are not generated.
endif(NOT BUILD_TESTING)
message( STATUS "BUILD_TESTING: " ${BUILD_TESTING} )
if(NOT BUILD_CPPUNIT_TEST)
set(BUILD_CPPUNIT_TEST OFF)
endif(NOT BUILD_CPPUNIT_TEST)
message( STATUS "BUILD_CPPUNIT_TEST: " ${BUILD_CPPUNIT_TEST} )
if(NOT CMAKE_EXPORT_COMPILE_COMMANDS)
# To generate a compilation database "compilation_commands.json" for clang_check
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
......@@ -137,14 +143,14 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
# endif(CGAL_FOUND)
# test all cpp-files in Utest
if(BUILD_TESTING)
if(BUILD_TESTING OR BUILD_CPPUNIT_TEST)
find_package(Boost COMPONENTS unit_test_framework REQUIRED)
file(GLOB test_files "${CMAKE_TEST_DIR}/*.cpp")
# file(GLOB test_py_files "${CMAKE_TEST_DIR}/*/runtest*.py")
file(GLOB_RECURSE test_py_files "${CMAKE_TEST_DIR}/*runtest_*.py")
#string(REGEX REPLACE "CMakeFiles/[^;]+;?" "" SRCS "${test_py_files}")
endif(BUILD_TESTING OR BUILD_CPPUNIT_TEST)
if(BUILD_TESTING)
file(GLOB_RECURSE test_py_files "${CMAKE_TEST_DIR}/*runtest_*.py")
endif(BUILD_TESTING)
# add sources and headers
set ( source_files
......@@ -401,7 +407,7 @@ endif()
# ----------------------------- cTest ------------------------------------------
if(BUILD_TESTING)
if(BUILD_TESTING OR BUILD_CPPUNIT_TEST)
SET(BUILD_TEST_TIMEOUT 10800 CACHE STRING "Global timeout on all tests (seconds).")
SET(DART_TESTING_TIMEOUT "${BUILD_TEST_TIMEOUT}" CACHE STRING "" FORCE)
message(STATUS "Timeout: " ${BUILD_TEST_TIMEOUT} " s" )
......@@ -409,15 +415,7 @@ if(BUILD_TESTING)
include(CTest) # adding Dart support
# test if code compiles and runs default setting. Takes about 30 seconds
add_test (jpscore_compile ${CMAKE_CTEST_COMMAND}
--build-and-test "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" #"${EXECUTABLE_OUTPUT_PATH}" #"${CMAKE_BINARY_DIR}"
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${CMAKE_MAKE_PROGRAM} -j${PROCESSOR_COUNT}
--build-two-config
--build-exe-dir ${EXECUTABLE_OUTPUT_PATH} # todo wo soll der exe hin?: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
--build-project JPScore
--test-command jpscore --ini=${CMAKE_SOURCE_DIR}/inputfiles/Default/ini.xml
)
link_directories(${Boost_LIBRARY_DIRS})
foreach (test_src ${test_files})
GET_FILENAME_COMPONENT(test ${test_src} NAME_WE)
......@@ -425,9 +423,18 @@ if(BUILD_TESTING)
target_link_libraries (${test} core ${Boost_LIBRARIES})
add_test(NAME ${test} COMMAND ${test})
endforeach(test_src ${test_files})
endif(BUILD_TESTING OR BUILD_CPPUNIT_TEST)
if(BUILD_TESTING)
add_test (jpscore_compile ${CMAKE_CTEST_COMMAND}
--build-and-test "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" #"${EXECUTABLE_OUTPUT_PATH}" #"${CMAKE_BINARY_DIR}"
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${CMAKE_MAKE_PROGRAM} -j${PROCESSOR_COUNT}
--build-two-config
--build-exe-dir ${EXECUTABLE_OUTPUT_PATH} # todo wo soll der exe hin?: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
--build-project JPScore
--test-command jpscore --ini=${CMAKE_SOURCE_DIR}/inputfiles/Default/ini.xml
)
find_package(PythonInterp)
if(PYTHONINTERP_FOUND)
foreach (test_src ${test_py_files})
......@@ -440,3 +447,5 @@ if(BUILD_TESTING)
# add_test(NAME flow COMMAND "${CMAKE_TEST_DIR}/testflow.py" "${test_parameters}")
endif(PYTHONINTERP_FOUND)
endif(BUILD_TESTING)
install (TARGETS jpscore DESTINATION bin)
......@@ -14,7 +14,7 @@ __author__ = 'Oliver Schmidts'
def runtest15(inifile, trajfile):
logsim = "inifiles/log.P0.dat"
if not path.exists(logsim):
if not os.path.exists(logsim):
logging.critical("logsim <%s> does not exist"%logsim)
exit(FAILURE)
logging.info("open <%s> "%logsim)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" ?>
<JuPedSim project="offenbach" version="0.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../xsd/jps_ini_core.xsd">
<!-- header: seed, geometry, output format -->
<seed>3011</seed>
<max_sim_time>600</max_sim_time>
<!--maxCPU>1</maxCPU-->
<geometry>offenbach_geo.xml</geometry>
<!-- traectories file and format -->
<trajectories format="xml-plain" fps="8">
<file location="offenbach_traj.xml" />
</trajectories>
<!-- traffic constraints -->
<traffic_constraints>
<!-- doors states are: close or open -->
<doors>
<door trans_id="0" caption="" state="open" />
</doors>
</traffic_constraints>
<!-- routing -->
<routing>
<goals>
<goal id="0" final="true" caption="exit_y_max">
<polygon>
<vertex px="-4" py="36" />
<vertex px="-4" py="38" />
<vertex px="-2" py="38" />
<vertex px="-2" py="36" />
<vertex px="-4" py="36" />
</polygon>
</goal>
<goal id="1" final="true" caption="exit_y_min">
<polygon>
<vertex px="-8" py="-6" />
<vertex px="-8" py="-8" />
<vertex px="-6" py="-8" />
<vertex px="-6" py="-6" />
<vertex px="-8" py="-6" />
</polygon>
</goal>
</goals>
</routing>
<!-- agents -->
<agents operational_model_id="2">
<agents_distribution>
<group group_id="1" agent_parameter_id="1" room_id="0" subroom_id="0" number="50" router_id="7" pre_movement_mean="15" pre_movement_sigma="15"/>
<!--group group_id="2" agent_parameter_id="1" room_id="0" subroom_id="1" number="10" router_id="7" pre_movement_mean="30" pre_movement_sigma="30"/>/
<group group_id="3" agent_parameter_id="1" room_id="0" subroom_id="2" number="10" router_id="7" pre_movement_mean="30" pre_movement_sigma="30"/-->
</agents_distribution>
</agents>
<!-- operational models -->
<operational_models>
<model operational_model_id="2" description="gompertz">
<model_parameters>
<solver>euler</solver>
<stepsize>0.01</stepsize>
<exit_crossing_strategy>3</exit_crossing_strategy>
<linkedcells enabled="true" cell_size="2.2" />
<force_ped nu="3" b="0.25" c="3.0" />
<force_wall nu="10" b="0.7" c="3.0" />
</model_parameters>
<agent_parameters agent_parameter_id="1">
<v0 mu="0.5" sigma="0.0" />
<bmax mu="0.25" sigma="0.001" />
<bmin mu="0.20" sigma="0.001" />
<amin mu="0.18" sigma="0.001" />
<tau mu="0.5" sigma="0.001" />
<atau mu="0.5" sigma="0.001" />
</agent_parameters>
</model>
</operational_models>
<!-- route choice models -->
<route_choice_models>
<router router_id="2" description="quickest">
<parameters>
<!-- extra routing information -->
<navigation_lines file="routing.xml" />
</parameters>
</router>
<router router_id="7" description="cognitive_map">
<sensors>
<sensor sensor_id="1" description="Room2Corridor" status="activated"/>
<sensor sensor_id="2" description="LastDestination" status="activated"/>
<sensor sensor_id="3" description="Smoke" potentialfile="./"/>
</sensors>
<cognitive_map status="complete" />
<!--parameters>
<navigation_lines file="routing.xml" />
</parameters -->
</router>
</route_choice_models>
</JuPedSim>
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment