Code Monkey home page Code Monkey logo

Comments (15)

kainagel avatar kainagel commented on May 24, 2024 3

Hello, could you please provide a bit more detail. If one does not know maven, the starting point presumably is

  1. downloading the newest release zip ([matsim.org/downloads], 0.10.1?),
  2. unzip that,
  3. double-click on the jar, which should start the matsim gui.
  4. From there, it should be possible to run one of the example scenarios that were also in the zipfile.
  5. Then one has to figure out how to look at results; in general, we recommend the commercial software VIA which is free up to 500 agents and usually free for student projects (ask the maintainer).

Only after these steps have been successfully taken does it make sense to consider one's own scenario. This is, however, not an easy exercise; it also depends on one's training. Converting an osm network (using the matsim plugin in josm) should be relatively straightforward. Generating a handful of vehicles that drive around on that network should also be relatively straighforward. Beyond that, it is no longer straightforward.
So, please, provide more detail.

from matsim-code-examples.

nnuk avatar nnuk commented on May 24, 2024 1

Thankyou for your reply.
I have gone through all of these steps but whenever i run an example on gui it gives me different errors for different examples. one of the example showed following error.

10 errors
at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:470)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:232)
at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:236)
at org.matsim.core.controler.Injector.createInjector(Injector.java:73)
at org.matsim.core.controler.Controler.run(Controler.java:189)
at org.matsim.run.Controler.run(Controler.java:56)
at org.matsim.run.Controler.main(Controler.java:60)

The simulation did not run properly. Error/Exit code: 1

but all of them are giving errors. I also added files to check on VIA but it does not run me a proper simulation like when time is running slowly it shows only the network but when i select the the time to +150 it just blips some lights on the network for one time in one clock cycle.

I converted my own OSM data that i built to matsim layer and then converted it to shape file because i wanted to use my own network in VIA but in VIA that shape file gave only dotted paths and not the proper street and road network. maybe i have done something wrong.

I also searched a lot about the files ( network, plans, config, events etc... ) , actually i do not know how to build these files for ones own scenario.

I cloned a matsim project from jithub to eclipse and followed all the steps and it gave a huge number of files which was very confusing.

I wanted to know how to build all the required matsim files for my own scenario.
I hope i have provided all the detail.

from matsim-code-examples.

golanbendor avatar golanbendor commented on May 24, 2024 1

You have three options to solve this issue:

  1. In your scenario runner class (assuming you have an "Config" object) you can add one of these lines:
    config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists);
    config.controler().setOverwriteFileSetting(OverwriteFileSetting.overwriteExistingFiles);

  2. Manually delete the output directory.

  3. Changing the parameter manually in your "config.xml" file under:

  • <module name="controler" >
    • <!-- Possible values: failIfDirectoryExists, overwriteExistingFiles, deleteDirectoryIfExists -->
    • <param name="overwriteFiles" value="failIfDirectoryExists" />
  • </module>

from matsim-code-examples.

jfbischoff avatar jfbischoff commented on May 24, 2024 1

MATsim is able to route agents within-day . This allows you to change the agents' behavior while en-route.
As a starting point, see the relevant book chapters about the topic. There are also some code examples in this repository to start with.

from matsim-code-examples.

nnuk avatar nnuk commented on May 24, 2024

Can someone help me with above case. It will be highly appreciated.

from matsim-code-examples.

mrieser avatar mrieser commented on May 24, 2024

can you provide a full log file where the error is shown? the above error message is not enough to figure out what's going wrong.

from matsim-code-examples.

nnuk avatar nnuk commented on May 24, 2024

Berlin.docx
i am attaching this file because when i click on the output it open a folder which has a log file but has not these errors. the errors which occured are in the berlin file.

from matsim-code-examples.

tduberne avatar tduberne commented on May 24, 2024

Here is the relevant part of the log:

Error injecting constructor, java.lang.RuntimeException: The output directory ./output/berlin already exists and is not empty! Please either delete or empty the directory or configure the services via setOverwriteFileSetting() or the "overwriteFiles" parameter of the "services" config group.

This is also the reason why you could not find the error message in the log file: MATSim stoped before writing anything in the directory, because by default, it is configured not to change anything in an existing directory.

When you get errors from com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist, it is usually necessary to scroll down to see what actually was the problem. This is actually the case for a lot of exceptions ("errors"): exceptions can be thrown when intercepting other exceptions, and then usually report their cause as well, lower in the log. For this reason:

  • always try to look at all errors messages until the end of the log file, to see if you find one message that might put you on track for finding the problem
  • if you need help understanding the messages, always join the full log file. The first line(s) of the error message are often no enough to pin down a problem.

from matsim-code-examples.

nnuk avatar nnuk commented on May 24, 2024

Thankyou very much for your reply. Can you kindly guide me step by step how can I correct this?

from matsim-code-examples.

nnuk avatar nnuk commented on May 24, 2024

Thanks @tduberne now its working as i deleted the output directory and started MATSim so it created a new output file which was working fine in the visualizer (VIA).

Now i wanted to know that i am working on a very small area (OSM) in which i have done editions like made nodes as bus stops and streets but it is a small area. I imported that area in JOSM and wanted to convert that into a MATSim network. Actually can you kindly guide me step by step how can i create the necessary files (network file, Vehicles file, Events file, etc) for MATSim for my area.

This is my first time on this type of project so my questions are at basic level.

Thanks.

from matsim-code-examples.

nnuk avatar nnuk commented on May 24, 2024

Thanks @golanbendor i just deleted the output directory and then everything was smooth.
Can you kindly guide me step by step how can i create the necessary files (network file, Vehicles file, Events file, etc) for MATSim for my area which is a small OSM area which i have edited in JOSM for routing.

from matsim-code-examples.

golanbendor avatar golanbendor commented on May 24, 2024

Hi @nnuk .

  • Regarding the network, there is a chapter in the MATSim book about JOSM (here is the link ) you can use it as a starting point for converting your network to MATSim's specifications.

  • Creating a real population/vehicles is a more cumbersome process. You can use the following RunPOnePersonPopulationGenerator class as a starting point for creating a pseudo-demand and the RunMobsimWithMultipleModeVehiclesExample class for creating different vehicle types.

  • Events are created during the simulation processes. Thus there is no need to create them (unless you want to add your own custom events).

from matsim-code-examples.

nnuk avatar nnuk commented on May 24, 2024

Thankyou very much @golanbendor. I will follow all these steps and if there is any problem i will ask later.

from matsim-code-examples.

nnuk avatar nnuk commented on May 24, 2024

Hi,
I had a query that as I am working on a small map and I want that the cars should run on the paths with defined speed and should return their GPS coordinates after every 30 seconds so that if i wanted to change the path of the car midway. Is it possible with MATSim or is there other software for it?
Thanks.

from matsim-code-examples.

nnuk avatar nnuk commented on May 24, 2024

Hi,
Can anyone help me with above query it will be highly appreciated.
Thanks.

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.