Skip to content

Commit

Permalink
first case of walking around a vehicle refs #3138
Browse files Browse the repository at this point in the history
git-svn-id: file:///home/behr_mi/git/sumo_synched/trunk@24444 afbd958f-9f77-42d5-a016-97a22340ccf4
  • Loading branch information
namdre committed May 23, 2017
1 parent 4ac331a commit c45c053
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 35 deletions.
27 changes: 27 additions & 0 deletions sumo/src/microsim/pedestrians/MSPModel_Striping.cpp
Expand Up @@ -803,6 +803,33 @@ MSPModel_Striping::moveInDirectionOnLane(Pedestrians& pedestrians, const MSLane*
Obstacles arrival(stripes, Obstacle(p.myStage->getArrivalPos() + dir * p.getMinGap(), 0, "arrival", 0, true));
p.mergeObstacles(currentObs, arrival);
}
if (lane->getVehicleNumberWithPartials() > 0) {
// react to vehicles
// @todo: improve efficiency by using the same iterator for all pedestrians on this lane
Obstacles vehObs(stripes, Obstacle(dir));
for (MSLane::AnyVehicleIterator it = lane->anyVehiclesUpstreamBegin(); it != lane->anyVehiclesUpstreamEnd(); ++it) {
const MSVehicle* veh = *it;
const double vehBack = veh->getBackPositionOnLane(lane);
if (dir == FORWARD && vehBack > p.getMinX() && vehBack <= p.getMaxX() + LOOKAHEAD_SAMEDIR) {
Obstacle vo(vehBack, veh->getSpeed(), veh->getID(), 0, true);
vo.xFwd += veh->getVehicleType().getLength();
// relY increases from left to right (the other way around from vehicles)
// XXX lateral offset for partial vehicles
const double vehYmax = 0.5 * (lane->getWidth() + veh->getVehicleType().getWidth()) - veh->getLateralPositionOnLane();
const double vehYmin = vehYmax - veh->getVehicleType().getWidth();
for (int s = MAX2(0, p.stripe(vehYmin)); s < MIN2(p.stripe(vehYmax) + 1, stripes); ++s) {
vehObs[s] = vo;
}
}
}
p.mergeObstacles(currentObs, vehObs);
if DEBUGCOND(p.myPerson->getID()) {
std::cout << SIMTIME << " ped=" << p.myPerson->getID() << " obsWitVehs=";
DEBUG_PRINT(currentObs);
}
}

// walk, taking into account all obstacles
p.walk(currentObs, currentTime);
gDebugFlag1 = false;
if (!p.myWaitingToEnter && !p.myAmJammed) {
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on Tue May 23 21:52:11 2017 by SUMO Version dev-SVN-r22661
<!-- generated on Tue May 23 23:38:54 2017 by SUMO Version dev-SVN-r22661
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/sumoConfiguration.xsd">
Expand Down Expand Up @@ -102,145 +102,147 @@
</timestep>
<timestep time="18.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="45.00" angle="0.00" speed="1.39" pos="45.00" edge="SC" slope="0.00"/>
<person id="p0" x="105.07" y="45.00" angle="0.00" speed="1.39" pos="45.00" edge="SC" slope="0.00"/>
</timestep>
<timestep time="19.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="46.39" angle="0.00" speed="1.39" pos="46.39" edge="SC" slope="0.00"/>
<person id="p0" x="104.42" y="45.00" angle="0.00" speed="0.00" pos="45.00" edge="SC" slope="0.00"/>
</timestep>
<timestep time="20.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="47.78" angle="0.00" speed="1.39" pos="47.78" edge="SC" slope="0.00"/>
<person id="p0" x="103.77" y="45.00" angle="0.00" speed="0.00" pos="45.00" edge="SC" slope="0.00"/>
</timestep>
<timestep time="21.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="49.17" angle="0.00" speed="1.39" pos="49.17" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="46.39" angle="0.00" speed="1.39" pos="46.39" edge="SC" slope="0.00"/>
</timestep>
<timestep time="22.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="50.56" angle="0.00" speed="1.39" pos="50.56" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="47.78" angle="0.00" speed="1.39" pos="47.78" edge="SC" slope="0.00"/>
</timestep>
<timestep time="23.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="51.94" angle="0.00" speed="1.39" pos="51.94" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="49.17" angle="0.00" speed="1.39" pos="49.17" edge="SC" slope="0.00"/>
</timestep>
<timestep time="24.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="53.33" angle="0.00" speed="1.39" pos="53.33" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="50.55" angle="0.00" speed="1.39" pos="50.55" edge="SC" slope="0.00"/>
</timestep>
<timestep time="25.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="54.72" angle="0.00" speed="1.39" pos="54.72" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="51.94" angle="0.00" speed="1.39" pos="51.94" edge="SC" slope="0.00"/>
</timestep>
<timestep time="26.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="56.11" angle="0.00" speed="1.39" pos="56.11" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="53.33" angle="0.00" speed="1.39" pos="53.33" edge="SC" slope="0.00"/>
</timestep>
<timestep time="27.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="57.50" angle="0.00" speed="1.39" pos="57.50" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="54.72" angle="0.00" speed="1.39" pos="54.72" edge="SC" slope="0.00"/>
</timestep>
<timestep time="28.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="58.89" angle="0.00" speed="1.39" pos="58.89" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="56.11" angle="0.00" speed="1.39" pos="56.11" edge="SC" slope="0.00"/>
</timestep>
<timestep time="29.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="60.28" angle="0.00" speed="1.39" pos="60.28" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="57.50" angle="0.00" speed="1.39" pos="57.50" edge="SC" slope="0.00"/>
</timestep>
<timestep time="30.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="61.67" angle="0.00" speed="1.39" pos="61.67" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="58.89" angle="0.00" speed="1.39" pos="58.89" edge="SC" slope="0.00"/>
</timestep>
<timestep time="31.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="63.06" angle="0.00" speed="1.39" pos="63.06" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="60.28" angle="0.00" speed="1.39" pos="60.28" edge="SC" slope="0.00"/>
</timestep>
<timestep time="32.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="64.44" angle="0.00" speed="1.39" pos="64.44" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="61.67" angle="0.00" speed="1.39" pos="61.67" edge="SC" slope="0.00"/>
</timestep>
<timestep time="33.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="65.83" angle="0.00" speed="1.39" pos="65.83" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="63.05" angle="0.00" speed="1.39" pos="63.05" edge="SC" slope="0.00"/>
</timestep>
<timestep time="34.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="67.22" angle="0.00" speed="1.39" pos="67.22" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="64.44" angle="0.00" speed="1.39" pos="64.44" edge="SC" slope="0.00"/>
</timestep>
<timestep time="35.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="68.61" angle="0.00" speed="1.39" pos="68.61" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="65.83" angle="0.00" speed="1.39" pos="65.83" edge="SC" slope="0.00"/>
</timestep>
<timestep time="36.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="70.00" angle="0.00" speed="1.39" pos="70.00" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="67.22" angle="0.00" speed="1.39" pos="67.22" edge="SC" slope="0.00"/>
</timestep>
<timestep time="37.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="71.39" angle="0.00" speed="1.39" pos="71.39" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="68.61" angle="0.00" speed="1.39" pos="68.61" edge="SC" slope="0.00"/>
</timestep>
<timestep time="38.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="72.78" angle="0.00" speed="1.39" pos="72.78" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="70.00" angle="0.00" speed="1.39" pos="70.00" edge="SC" slope="0.00"/>
</timestep>
<timestep time="39.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="74.17" angle="0.00" speed="1.39" pos="74.17" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="71.39" angle="0.00" speed="1.39" pos="71.39" edge="SC" slope="0.00"/>
</timestep>
<timestep time="40.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="75.56" angle="0.00" speed="1.39" pos="75.56" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="72.78" angle="0.00" speed="1.39" pos="72.78" edge="SC" slope="0.00"/>
</timestep>
<timestep time="41.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="76.94" angle="0.00" speed="1.39" pos="76.94" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="74.17" angle="0.00" speed="1.39" pos="74.17" edge="SC" slope="0.00"/>
</timestep>
<timestep time="42.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="78.33" angle="0.00" speed="1.39" pos="78.33" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="75.55" angle="0.00" speed="1.39" pos="75.55" edge="SC" slope="0.00"/>
</timestep>
<timestep time="43.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="79.72" angle="0.00" speed="1.39" pos="79.72" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="76.94" angle="0.00" speed="1.39" pos="76.94" edge="SC" slope="0.00"/>
</timestep>
<timestep time="44.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="81.11" angle="0.00" speed="1.39" pos="81.11" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="78.33" angle="0.00" speed="1.39" pos="78.33" edge="SC" slope="0.00"/>
</timestep>
<timestep time="45.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="82.50" angle="0.00" speed="1.39" pos="82.50" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="79.72" angle="0.00" speed="1.39" pos="79.72" edge="SC" slope="0.00"/>
</timestep>
<timestep time="46.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="83.89" angle="0.00" speed="1.39" pos="83.89" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="81.11" angle="0.00" speed="1.39" pos="81.11" edge="SC" slope="0.00"/>
</timestep>
<timestep time="47.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="85.28" angle="0.00" speed="1.39" pos="85.28" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="82.50" angle="0.00" speed="1.39" pos="82.50" edge="SC" slope="0.00"/>
</timestep>
<timestep time="48.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="86.67" angle="0.00" speed="1.39" pos="86.67" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="83.89" angle="0.00" speed="1.39" pos="83.89" edge="SC" slope="0.00"/>
</timestep>
<timestep time="49.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="88.06" angle="0.00" speed="1.39" pos="88.06" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="85.28" angle="0.00" speed="1.39" pos="85.28" edge="SC" slope="0.00"/>
</timestep>
<timestep time="50.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="89.44" angle="0.00" speed="1.39" pos="89.44" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="86.67" angle="0.00" speed="1.39" pos="86.67" edge="SC" slope="0.00"/>
</timestep>
<timestep time="51.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="105.62" y="90.83" angle="0.00" speed="1.39" pos="90.83" edge="SC" slope="0.00"/>
<person id="p0" x="103.67" y="88.05" angle="0.00" speed="1.39" pos="88.05" edge="SC" slope="0.00"/>
</timestep>
<timestep time="52.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="103.67" y="89.44" angle="0.00" speed="1.39" pos="89.44" edge="SC" slope="0.00"/>
</timestep>
<timestep time="53.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
<person id="p0" x="103.67" y="90.83" angle="0.00" speed="1.39" pos="90.83" edge="SC" slope="0.00"/>
</timestep>
<timestep time="54.00">
<vehicle id="v0" x="104.95" y="50.00" angle="0.00" type="car" speed="0.00" pos="50.00" lane="SC_0" slope="0.00"/>
Expand Down

0 comments on commit c45c053

Please sign in to comment.