Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Rerouting pedestrians in model
  • From: "Evans, Barry" <B.Evans@xxxxxxxxxxxx>
  • Date: Tue, 10 Mar 2020 22:18:31 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=exeter.ac.uk; dmarc=pass action=none header.from=exeter.ac.uk; dkim=pass header.d=exeter.ac.uk; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HWpPSLQG8IPrbiLhQpMQCGkpO1TYtZL2YhOnDm1adeo=; b=brkaENiFEmoNaBoZPBaba6w0SmWoxYO7SZ0YoM4um5aILlVgU9l76LN/aWAS0sARRPRFpBiD98q0s9OlQC+6PUKx4YPWoWWPcwUdW5d/q+C2J1a3S0uH86OzNF1P2DvnEUK3dQcSjpM6gZKDgl9OwZ5ZL+G0CnVu825AJgc4kp8C/jjbqerEzUe1B5TPxcJb3k8qEZkVSRovOZ0EdaiJcrE20JhcSgaQiPXlPJ+PIYd1GxLuwZw/FFG78UIKGy+/OOuWw8tAkS9k6SRKY9TBxCnKt9wu4oO8myQyKSlvrcjPx12/aoaMn9WvxSk3bkKbcGwtRuovmRdZj8eLzXP8kw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SC9/8+C5eZsjN82ckCufzZ7zf/nikKnXGYETcYZj7OyEWOvy3aehpiXHb1Pg00dTaPtcxuz+6oFdhAzpUVAxiuAshMNu+LucM9PjUK4Y5ubdZC1HBUjA+jWJo9kkGsV2sbTXaN9XK5uuruDHuH8YPINDXZ691OXfjdYnMDaGABvNoaGV/Dy5J50tOP7m2jZA7IGd0/PTtfITRRoljxdDmvrqx6s65bES34FdP4EM0r2wLfGrMqDlQRnWHxhG1RR7YuRYK+SZXPLDz7s+fBV+w6Z70Q0APIPuswAh6UEKSay53DKD3kV43/7247Rtnzzc+rmSc1GDiFZtk/TLG9utzg==
  • Delivered-to: sumo-user@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/sumo-user>
  • List-help: <mailto:sumo-user-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/sumo-user>, <mailto:sumo-user-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AdX2jLaxFEYLirWESkKtoHqi+Qd3hAAHuWkAAB89/KA=
  • Thread-topic: [sumo-user] Rerouting pedestrians in model

Hi Jakob,

 

Thank you for your reply. I’ve managed to find another workaround which I thought I’d share on here. The code is not pretty but it seems to solve the issue:

 

            ##***CHANGE THE ROUTE OF A PERSON DURING SIMULATION***##

           

            #STEP1: GET THE EDGE ID OF PERSON

           

            edgeid = traci.person.getRoadID("ped1")

 

            #STEP2: CALCULATE NEW ROUTE FOR PERSON

            #myroute = traci.simulation.findRoute(edgeid,NewEndEdgeID,PedestrianVType,-1,0)

           

            myroute = traci.simulation.findRoute(edgeid,"95612610","ped_pedestrian1",-1,0)

           

            #STEP3: GET LIST OF EDGES FROM NEW ROUTE INFORMATION

            temp1 = str(myroute).split('edges=(',1)

            temp2 = temp1[1].split('), travelTime=',1)

            temp3 = temp2[0].replace("'","")

            edge_list = temp3.split(',')

            myedges = []

            for temp_edge in edge_list:

                if ':' not in temp_edge:                #this condition removes the junction parts from the route list

                    myedges.append(temp_edge.lstrip().rstrip())

           

            #STEP4: REMOVE STAGES FOR PEDESTRIANS

            traci.person.removeStages("ped1")           # I assume this resets/clears the pedestrian values

            

            #STEP5: ADD NEW WALKING STAGE FOR PEDESTRIAN WITH NEW ROUTE

            traci.person.appendWalkingStage("ped1",myedges,0, duration=-1, speed=-1, stopID='')

 

 

Maybe this will be useful for others if they wish to use it.

 

Kind regards,

 

Barry

 

From: sumo-user-bounces@xxxxxxxxxxx <sumo-user-bounces@xxxxxxxxxxx> On Behalf Of Jakob Erdmann
Sent: Tuesday, 10 March 2020 8:15 PM
To: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Subject: Re: [sumo-user] Rerouting pedestrians in model

 

Hello,

rerouters for pedestrians are simply not implemented yet (https://github.com/eclipse/sumo/issues/1722).

As a workaround you can use TraCI to trigger pedestrian rerouting (traci.person.rerouteTraveltime).

regards,

Jakob

 

Am Di., 10. März 2020 um 04:34 Uhr schrieb Evans, Barry <B.Evans@xxxxxxxxxxxx>:

Hi all,

 

I apologise if this question has been asked already. I’ve been trying to reroute pedestrians in my sumo model using the re-router method. For some reason, unlike that of traffic when the pedestrians move onto an edge declared by the rerouter they continue on their pre-existing route.

 

Does anyone have a simple example of how to do the re-routing with pedestrians? I’ve looked online and could not find any work arounds. I’ve been trying this sort of setup in my additional file whereby an edge in front of the pedestrian is closed and I assign them a new destination to reach. This however does not work.

 

<additional xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo-sim.org/xsd/additional_file.xsd">

 

                <rerouter id="reroute1" edges="688077234#0 688077234#2 688077234#3 688077234#4 688077234#0 -364040558#7">

                                <interval begin="30" end="6000">

                                                <closingReroute id="-364040558#5" disallow="all"/>

                                                <destProbReroute id="-85383958#0" probability="1.0"/>

                                </interval>

                </rerouter>

 

</additional>

 

 

It’s likely I’m missing something obvious. Any thoughts or suggestions would be greatly appreciated.

 

Kind regards,

 

Barry

 

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user


Back to the top