matsim-vsp / matsim-python-tools Goto Github PK
View Code? Open in Web Editor NEWTools for analyzing matsim with python
Tools for analyzing matsim with python
Hi,
Thanks for the interesting project!
I was wondering if you intend to also include python tools for tasks beyond data analysis?
Writing XMLs for example: https://github.com/eqasim-org/ile-de-france/blob/develop/matsim/writers.py
In the link above, the code is perhaps specific to one use case but it could probably be well generalizable.
Kind regards, Davi
Fresh installation of matsim-tools throws this error:
Traceback (most recent call last):
File "~/calibrate_MT_100.py", line 12, in <module>
from matsim import calibration
File "~/.local/lib/python3.9/site-packages/matsim/init.py", line 1, in <module>
from . import Events, Network, Plans, TripEventHandler, writers
File "~/.local/lib/python3.9/site-packages/matsim/[Events.py](https://events.py/)", line 10, in <module>
from .pb.Ids_pb2 import ProtoId
File "~/.local/lib/python3.9/site-packages/matsim/pb/Ids_pb2.py", line 31, in <module>
_descriptor.EnumValueDescriptor(
File "~/.local/lib/python3.9/site-packages/google/protobuf/[descriptor.py](https://descriptor.py/)", line 755, in new
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
We might want to update the generated protobuf files.
Hello,
Now, I have a project, in which I need to analyze the output files and obtain some useful data.
I hope to obtain the map data and the state of each edge in the map at every time. More detailly, I want to obtain the data that for each time point, how long a vehicle will take to traverse a route (edge).
May I ask if it is possible to implement by using this python-tools.
Thanks!!!
Best,
Hao
In xml, we have
<person id="01067005_518">
<attributes>
<attribute name="age" class="java.lang.Integer">45</attribute>
<attribute name="district" class="java.lang.String">Dresden</attribute>
...
</attributes>
</person>
How to you get to, say, age
?
Hi!
I'm using the plan reader to analyze the plan file. But I have met some problems here. I can't filter the plan file after I got the matsim.plan_reader generator. For example, I want to get all legs with mode= pt in the plan file and no matter what trip type it was. And I use the code as follows:
for person, plan in plans: pt_activities = filter( lambda e: e.tag == 'leg' and e.leg['mode'] == 'pt', plan)
It seems that I didn't filter the activities I want.
How should I work with that? I attached the plan file that I am using now.
Thanks a lot for the help!
Hello,
Now, I have a project, in which I need to analyze the output files and obtain some useful data.
I hope to obtain the map data and the state of each edge in the map at every time. More detailly, I want to obtain the data that for each time point, how long a vehicle will take to traverse a route (edge).
May I ask if it is possible to implement by using this python-tools.
Thanks!!!
Best,
Hao
Hello, I'm trying to run geo = net.as_geo() but I get this error:
CRSError: Invalid projection: Atlantis: (Internal Proj Error: proj_create: unrecognized format / unknown name)
could you please let me know how can I solve it?
Thanks
I just tried reading the episim input plans ... that uses up time (so it is going through the file) ... but it does not return any material.
Reason, as far as I can tell, is that persons without plans are not read.
In this case, however, we need persons without plans, since we store the person attributes in those persons.
Could you please change that? Thanks.
Hello,
Now, I have a project, in which I need to analyze the output files and obtain some useful data.
I hope to obtain the map data and the state of each edge in the map at every time. More detailly, I want to obtain the data that for each time point, how long a vehicle will take to traverse a route (edge).
May I ask if it is possible to implement by using this python-tools.
Thanks!!!
Best,
Hao
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.