Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Jaywalking

Alright, I’ve now got some pretty feature-full functionality in TraCI (via the Python interface), but it runs rather slowly... largely because of Python, the server-client message passing, and the limited functionality TraCI offers (which requires workarounds).

Therefore, I would like to transition it over to a C++ extension instead.

Is there a good place to start on learning SUMO's code structure, and how to write extensions for SUMO?

I’ve looked around the wiki and have been able to find almost nothing -- though it's quite possible I've simply missed something obvious!

Are there examples I could work from?

So far I’ve just been trying to reverse engineer the code on my own to figure out how and where to put stuff, but without a guide of some sort it’s proving difficult.


Thanks!
Yokhanan


-----Original Message-----
From: Michael Behrisch [mailto:oss@xxxxxxxxxxx] 
Sent: Monday, January 29, 2018 3:27 PM
To: Beck, Yokhanan Z. <Yokhanan.Beck@xxxxxxxxxxxxxxx>; Sumo project User discussions <sumo-user@xxxxxxxxxxx>
Subject: Re: [sumo-user] Jaywalking

Hi Yokhanan,

Am 29.01.2018 um 20:09 schrieb Beck, Yokhanan Z.:
> However, I have been unable to figure out how to access these neighbors from either traci or sumolib:
> 
> net = sumolib.net.readNet(net_file)
> # ...
> ped_road = traci.person.getRoadID(ped_id)
> try:
>     edge = net.getEdge(ped_road)
> except KeyError:
>     edge = None
> if edge is not None: 
>     inner_lane = edge.getLane(edge.getLaneNumber() - 1)
> 
> At this point I can't actually figure out how to access the "neigh" attribute. Reading through the NetReader class in sumolib/net/__init__.py, it seems that the attribute is not actually read in by sumolib..?

You are right it wasn't. I just fixed that. You may either download a nightly snapshot tomorrow or apply the changes yourself, see https://github.com/DLR-TS/sumo/commit/a6752e13a8af44c1e19eebe8e421720a2bfdb7fa
I did not test it, so please speak up if something does not work as expected.

Best regards,
Michael



Back to the top