-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Calibration process #31
Comments
Hello, there should be no GUI involved when running the calibration. I suspect your jar is not executing the correct scenario class. Please double-check your generated jar and make sure it runs the scenario class and not the gui. |
Dear @rakow , thank you for your response. Indeed in the code provided in the main page the corresponding part is: study, obj = create_calibration("calib", ASCCalibrator(modes, initial, target, fixed_mode=fixed_mode, I just adrresed the default "matsim-example-project-0.0.1-SNAPSHOT.jar" from my matsim-example-project. How can I check if it executes the RunMatsim.java ? |
First, you need to have a run class like this: In the You need to replace this reference with your scenario class and rebuild the jar. You may check if it is correct by just running |
Dear @rakow , thank you so much for your help. I try rebuilding the jar file and see how things will work! |
Dear @rakow , I rebuilt the JAR file and tested if it runs correctly. After executing the Python code (attached as "Python_Code.txt"), I encountered the following issues:
File "C:\Users\Al\anaconda3\Lib\site-packages\pandas\core\indexes\base.py", line 3812, in get_loc raise KeyError(key) from err KeyError: 'n' [W 2024-12-13 18:21:15,407] Trial 191 failed with value None. To fix this, I added a default value for 'n' as follows: if "n" not in aggr.columns: aggr["n"] = 0
File "C:\Users\Al\matsim-python-tools\main_page_code.py", line 33, in study.optimize(obj, 10) KeyError: 'walk_share' Unfortunately, I have not been able to resolve this issue. Could you please help with this? Additionally, is there an existing scenario in the GitHub repository that fully works with this calibration code? It would be helpful for me to check the input files and their formatting in order to compare them with my own scenario. I've attached the Python code and error logs in text files for your reference. Thank you in advance for your help! |
Please try with a subpopulation called "person". This one is also mentioned in your code. |
Dear @rakow , After verifying that the code runs properly in the command line (cmd), I attempted to execute the Python code, but unfortunately, I encountered the error that I have attached to this message. I am unsure whether the issue relates to the following part of the error, since input files should be sourced from the specified config file and not this folder: And probably in the next iterations input files are taken from the address below(which does not exist): I also tried the suggestion to "Alternatively, run the cmd from the log above manually and check for errors." but the code ran properly without any errors. |
Normally, only having a "person" subpopulation should be no problem. I would advise cleaning all existing failed simulations runs and stored information. Delete the |
Hi,
I tried running the calibration process. First, I installed all the required libraries and dependencies. Then, I followed the example for calibration provided in the instructions on the main page (Section 5: CALIBRATION: Automatic calibration for MATSim scenario).
After running the code, I encountered an error related to missing initial values, which I added manually. Upon running the code again, the MATSim GUI opened. After providing the config file and running the simulation, I received an error regarding some files in the output folder (persons, plans, and trips files). After struggling for a while, I modified the code to provide a direct path to each of these required files. However, this approach seems illogical, and I wonder if there’s a way to run the Python code without manually specifying the paths to the output files.
Additionally, it seems the process repeats each time, requiring me to reopen the MATSim GUI, provide the config file again, and update the output plans file from the previous iteration.
Despite these efforts, I still couldn't achieve logical results or reach my target modal share.
One more question: Is it possible to use the MATSim Run class instead of relying on the MATSim GUI for this process?
I would greatly appreciate more detailed instructions on how to properly run the calibration code.
The text was updated successfully, but these errors were encountered: