Giter VIP home page Giter VIP logo

Comments (12)

pierromond avatar pierromond commented on August 28, 2024

Yes, you can do it. The first job is to add your new category in this file : https://github.com/Universite-Gustave-Eiffel/NoiseModelling/blob/master/noisemodelling-emission/src/main/resources/org/noise_planet/noisemodelling/emission/road/cnossos/RoadCnossos_2020.json

"4a": {
"description": "powered_two_wheelers_inf_50cc",

You can do a fifth category...

Then, you will need to modify a bit this file adding a new code name for the fifth category, for the moment LV = cat 1 MV = cat2, etc. :

And compile again.

I think this is the two only files to modify. Please tell us if you succeed to do so or if you need more info !

from noisemodelling.

zjc9988 avatar zjc9988 commented on August 28, 2024

@pierromond Thanks for the reply. In previous use, I downloaded the NoiseModelling ver 4.0.0 without GUI, but when I try to look for the code to modify, I can't find them in the directory. So I just downloaded the source code from Github. However, since I'm not familiar with java, can you please give me some instructions about how to compile the codes and put them into use?

from noisemodelling.

pierromond avatar pierromond commented on August 28, 2024

You should use the last version of NM -> 4.0.5

from noisemodelling.

zjc9988 avatar zjc9988 commented on August 28, 2024

Well, thanks for your reply. I have downloaded two files of the ver 4.0.5 (NoiseModelling_without_gui.zip and NoiseModelling-4.0.5.zip) and unzipped them. The problem here is: I prefer to use the without_gui version because I have written a script for running the model automatically; however, I cannot find the source code file to modify in the NoiseModelling_without_gui directory.
NoiseModelling_without_gui directory
The only place I can find the source code file is in the NoiseModelling-4.0.5 directory but I do not know how to run the model with the source code files.
NoiseModelling-4 0 5 directory (source code)

So here's the help I'm looking for: how can I compile the source codes and make them look like the files in the NoiseModelling_without_gui directory for the model to run? Or is it possible to directly run the model with the source code?

Thanks for your reply.

from noisemodelling.

pierromond avatar pierromond commented on August 28, 2024

You will need to use a IDE as IntelliJ and open NoiseModelling as a github project. Did you already see the video of NM 2022? I think it explains how to run and compile NoiseModelling in your favorite IDE.

from noisemodelling.

zjc9988 avatar zjc9988 commented on August 28, 2024

No, I can't find the video of NM 2022 on the website of NoiseModelling. Much appreciate if you can provide the link.
Anyway, I'll try with my IDE first. Thanks for your help. I'll keep you informed of the progress.

from noisemodelling.

pierromond avatar pierromond commented on August 28, 2024

You can access here : https://cloud.univ-eiffel.fr/s/tnqybGmj4EE8M8k
pwd : NMDays2022!NMDays2022! free access during 3 days !

Keep in touch

from noisemodelling.

zjc9988 avatar zjc9988 commented on August 28, 2024

Hello, @pierromond, I've come back to report my progress.
In the past few days, I modified some of the codes and compiled them (Some errors occur at maven test part, but if I toggle 'skip tests' mode, maven build goes fine, so I suppose it doesn't matter?). Then I use the generated .jar files to replace the existing ones in the scriptrunner/lib folder. After that, I modified the input file roads.shp to add some info about the electric vehicles (named 'ev' in the codes and input files).
However, when I start to test running NoiseModelling, I get some errors at the first step of the calculation. Would you mind having a look at the errors and give some advice?
The modified codes, input files, running scripts and running results are attached in the zip files.
bug_report_NM_1116.zip
input1.zip
input2.zip
Thank you for the help.

from noisemodelling.

pierromond avatar pierromond commented on August 28, 2024

Nice work, congratulations !

(Some errors occur at maven test part, but if I toggle 'skip tests' mode, maven build goes fine, so I suppose it doesn't matter?).
It depends the errors, but most of the test are regression tests. They help to be sure that your modifications will not change another part of the code.

However, when I start to test running NoiseModelling, I get some errors at the first step of the calculation. Would you mind having a look at the errors and give some advice? The modified codes, input files, running scripts and running results are attached in the zip files.

Thank you very much for your codes, I will try to find a moment in the next days/week to look at it. The best to test your code, is to do a unit test. You can inspire you from https://github.com/Universite-Gustave-Eiffel/NoiseModelling/blob/master/noisemodelling-emission/src/test/java/org/noise_planet/noisemodelling/emission/road/RoadCnossosTest.java and here :

public void testTableGenerationFromTraffic() throws SQLException, IOException {
and add two TEV tests for example. Then you can publish your code on your github. In this way, it will be much more easy and fast for me to look at your work. Also, because of the test, we can include your work in the main branch quite easily and with a lot of confidence. Finally, using github will guaranty that you will keep the author rights of your code lines ! just a last advice, the road.shp that you will add to the test directory : https://github.com/Universite-Gustave-Eiffel/NoiseModelling/tree/master/noisemodelling-jdbc/src/test/resources/org/noise_planet/noisemodelling/jdbc should be as light as possible !

By the way, I find a moment to look at your code and come back to you. If you want to follow my advices just tell me !

Kind regards.

from noisemodelling.

zjc9988 avatar zjc9988 commented on August 28, 2024

Hi, @pierromond , I am coming back to share some of my recent progresses.

Last week I was heavily engaged in some other stuffs, so I didn't look into the problem very much. This week I made some test about the input files and I have found some really confusing things.

At first I suppose the problem was due to some differences in the input file formats between previous version ( I was using v4.0.0 previously) and the latest version, so I prepared the input files from osm files again with the latest version. After that the model runs perfectly.

Then, since I need to add electric vehicles' info into the input roads file, I applied a python script to modify the roads file (using geopandas). The modifications are mainly adding electric vehicles info and modify the numbers for light vehicles (as I try to replace some of the light vehicles with electric vehicles). After that I encountered the problem: the model throws an error message that reads"java.lang.IllegalArgumentException: Invalid ordinate index: 2" and some other errors. The most confusing thing is, when I compare the modified file with the original file in QGIS, I find nothing different except the numbers.

What do you think could be the reason of this bug? I'm looking forward to your opinion.

Thank you very much.

from noisemodelling.

pierromond avatar pierromond commented on August 28, 2024

Generaly, this error is because the z-value is now missing. Sometimes it happens exporting and importing shp. Geojson files are safer for that. Tell me if it was that ! (you can use add_height wps block is you want !)

from noisemodelling.

zjc9988 avatar zjc9988 commented on August 28, 2024

Yes, you are right. It worked!
Though using geojson format did not help solve the problem, after applying a set_height step before calculating, the model worked well. I'll check the results of the eletric vehicle part for the next few days and see if it meets my expectation. Then I'll publish the codes as you suggested. (may take some time as I have never published codes on Github before).
Thanks a lot for the help these days!

from noisemodelling.

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.