Skip to content

Commit

Permalink
fixing JPS_VERSION #3 and style #22
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Feb 21, 2024
1 parent b4cf389 commit 58f1b48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ if (CHECK_OPTIONAL_LIBS)
find_package(GEOS)
if (GEOS_FOUND)
include_directories(SYSTEM ${GEOS_INCLUDE_DIR})
set(JPS_VERSION "${jupedsim_VERSION_MINOR}0${jupedsim_VERSION_PATCH}")
set(JPS_VERSION "${jupedsim_VERSION_MAJOR}${jupedsim_VERSION_MINOR}${jupedsim_VERSION_PATCH}")
set(ENABLED_FEATURES "${ENABLED_FEATURES} JuPedSim")
message(STATUS "Found JuPedSim: ${jupedsim_DIR} ${jupedsim_VERSION}")
else (GEOS_FOUND)
Expand Down
14 changes: 7 additions & 7 deletions src/microsim/transportables/MSPModel_JuPedSim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <fstream>
#include <geos_c.h>
#include <jupedsim/jupedsim.h>
#if JPS_VERSION > 106
#if JPS_VERSION >= 110
#include <jupedsim/simulation.h>
#endif
#include <microsim/MSEdge.h>
Expand Down Expand Up @@ -65,7 +65,7 @@ const RGBColor MSPModel_JuPedSim::PEDESTRIAN_NETWORK_COLOR = RGBColor(179, 217,
// ===========================================================================
MSPModel_JuPedSim::MSPModel_JuPedSim(const OptionsCont& oc, MSNet* net) :
myNetwork(net), myJPSDeltaT(string2time(oc.getString("pedestrian.jupedsim.step-length"))),
myExitTolerance(oc.getFloat("pedestrian.jupedsim.exit-tolerance")), myMaxAreaConnectedComponentPolygon(nullptr),
myExitTolerance(oc.getFloat("pedestrian.jupedsim.exit-tolerance")), myMaxAreaConnectedComponentPolygon(nullptr),
myHaveAdditionalWalkableAreas(false) {
initialize(oc);
net->getBeginOfTimestepEvents()->addEvent(new Event(this), net->getCurrentTimeStep() + DELTA_T);
Expand Down Expand Up @@ -422,9 +422,9 @@ MSPModel_JuPedSim::execute(SUMOTime time) {
const std::vector<MSTrainHelper::Carriage*>& carriages = trainHelper.getCarriages();
for (const MSTrainHelper::Carriage* carriage : carriages) {
Position dir = carriage->front - carriage->back;
if (dir.length2D() == 0.0) {
continue;
}
if (dir.length2D() == 0.0) {
continue;
}
dir.norm2D();
Position perp = Position(-dir.y(), dir.x());
// Create carriages geometry.
Expand Down Expand Up @@ -460,7 +460,7 @@ MSPModel_JuPedSim::execute(SUMOTime time) {
#endif
myJPSGeometryWithTrainsAndRamps = buildJPSGeometryFromGEOSGeometry(pedestrianNetworkWithTrainsAndRamps);
preparePolygonForDrawing(myMaxAreaConnectedComponentPolygon, myMaxAreaPolygonId + ".carriages_and_ramps", PEDESTRIAN_NETWORK_COLOR);
#if JPS_VERSION > 106
#if JPS_VERSION >= 110
JPS_Simulation_SwitchGeometry(myJPSSimulation, myJPSGeometryWithTrainsAndRamps, nullptr, nullptr);
#endif
GEOSGeom_destroy(pedestrianNetworkWithTrainsAndRamps);
Expand All @@ -470,7 +470,7 @@ MSPModel_JuPedSim::execute(SUMOTime time) {
GEOSGeom_destroy(carriagesUnion);
GEOSGeom_destroy(carriagesCollection);
} else {
#if JPS_VERSION > 106
#if JPS_VERSION >= 110
JPS_Simulation_SwitchGeometry(myJPSSimulation, myJPSGeometry, nullptr, nullptr);
#endif
}
Expand Down

0 comments on commit 58f1b48

Please sign in to comment.