Code Monkey home page Code Monkey logo

Comments (6)

tduberne avatar tduberne commented on May 29, 2024 2

Hi,

I just took the time to document a bit my minimal experimentation (create a simple scenario with 10 empty plans and run it) and put it on GitHub: https://github.com/tduberne/matsim-python-experiments/blob/master/simple-run.ipynb

I am pretty sure there will be corner cases where it fails, but it seems to work extremely well for what I envision as the main use of Python for MATSim (data preparation or analysis), with virtually no boilerplate.

Closing this issue, as

  • the question in the title is clearly answered
  • a viable alternative seems to exist

from matsim-code-examples.

kainagel avatar kainagel commented on May 29, 2024 1

Thanks for the accolades. Re python API: We have discussed this multiple times, but someone would need to write it. Please let us know if you want to undertake that; we would happily give you a corresponding project within matsim-org and help if you get stuck somewhere. All the best ...

from matsim-code-examples.

tduberne avatar tduberne commented on May 29, 2024 1

I think what Kai mentioned was not a lack of skills, but rather interest/capacity: we ourselves do not need the feature, and do not have capacity to develop it for others, but would be very happy to provide feedback if someone did start this independently.

That being said, I did consider using JPype myself in teaching, to avoid overwhelming students with yet another language (we use Python for data preparation and analysis). I did not have the time to experiment with it for this term, but as far as I understand, it should allow you to use any class from your Java classpath from Python (almost) as if they were Python classes, allowing you to prepare data, start a simulation, and analyze the results with one single Python script, with all MATSim data structures at your disposal. Maybe that is enough for your usecase?

In any case, if you experiment with anything, I would be very happy to hear back from you!

from matsim-code-examples.

GoingMyWay avatar GoingMyWay commented on May 29, 2024

@kainagel Wow, I wrote Python extension for C++ with Boost.Python before and it indeed gained more than 10 times speedup for Python codes. I don't know what skills your teams need to write Python APIs for Java codes.

from matsim-code-examples.

GoingMyWay avatar GoingMyWay commented on May 29, 2024

@tduberne That's good, thank you for your suggestion. MATSim is a good simulator for traffic flow. And I am considering using it in my research. I will use Python to write my algorithm models. And I will do some research on libraries(including JPype) that can successfully and easily connect Python and Java. Thank you.

from matsim-code-examples.

GoingMyWay avatar GoingMyWay commented on May 29, 2024

@tduberne thank you for your example code.

from matsim-code-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.