Skip to content

Commit

Permalink
[JuPedSim] Minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoueraud87 authored and palvarezlopez committed Aug 4, 2023
1 parent 32d60bf commit a9a47c1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/microsim/transportables/MSPModel_JuPedSim.cpp
Expand Up @@ -382,7 +382,7 @@ MSPModel_JuPedSim::buildPedestrianNetwork(MSNet* network) {
if (lane != nullptr) {
if (edge->isNormal()) {
const Position& anchor = getAnchor(lane, junction);
geos::geom::Geometry* dilatedLaneLine = createShapeFromCenterLine(lane->getShape(), lane->getWidth() / 2.0, geos::operation::buffer::BufferOp::CAP_SQUARE);
geos::geom::Geometry* dilatedLaneLine = createShapeFromCenterLine(lane->getShape(), lane->getWidth() / 2.0, geos::operation::buffer::BufferOp::CAP_ROUND);
dilatedPedestrianLanes.push_back(dilatedLaneLine);

for (const MSEdge* const nextEdge : adjacent) {
Expand All @@ -399,7 +399,7 @@ MSPModel_JuPedSim::buildPedestrianNetwork(MSNet* network) {
}
}
if (edge->isCrossing()) {
geos::geom::Geometry* dilatedCrossingLane = createShapeFromCenterLine(lane->getShape(), lane->getWidth() / 2.0, geos::operation::buffer::BufferOp::CAP_SQUARE);
geos::geom::Geometry* dilatedCrossingLane = createShapeFromCenterLine(lane->getShape(), lane->getWidth() / 2.0, geos::operation::buffer::BufferOp::CAP_ROUND);
dilatedPedestrianLanes.push_back(dilatedCrossingLane);

for (MSEdge* nextEdge : getAdjacentEdgesOfEdge(edge)) {
Expand Down Expand Up @@ -626,9 +626,11 @@ MSPModel_JuPedSim::initialize() {
WRITE_WARNINGF(TL("Error creating the pedestrian model: %"), JPS_ErrorMessage_GetMessage(message));
}

myJPSSimulation = JPS_Simulation_Create(myJPSModel, myJPSGeometry, STEPS2TIME(myJPSDeltaT), &message);
if (myJPSSimulation == nullptr) {
WRITE_WARNINGF(TL("Error creating the simulation: %"), JPS_ErrorMessage_GetMessage(message));
if ((myJPSModel != nullptr) && (myJPSGeometry != nullptr)) {
myJPSSimulation = JPS_Simulation_Create(myJPSModel, myJPSGeometry, STEPS2TIME(myJPSDeltaT), &message);
if (myJPSSimulation == nullptr) {
WRITE_WARNINGF(TL("Error creating the simulation: %"), JPS_ErrorMessage_GetMessage(message));
}
}

JPS_ErrorMessage_Free(message);
Expand Down

0 comments on commit a9a47c1

Please sign in to comment.