Skip to content
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

MethodError: no method matching nv(::Graphs.SimpleGraphs.SimpleDiGraph{Int64}) #62

Open
ghost opened this issue Mar 2, 2022 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 2, 2022

Hi! When I ran the https://pszufe.github.io/OpenStreetMapX_Tutorial/JuliaCon2020/ , the part that took 10 cars an let them drive between randomly selected pairs of points, gives the following error. I installed all the required packages though.

image

@pszufe
Copy link
Owner

pszufe commented Mar 2, 2022

Hi, LightGraphs.jl is no longer maintained and has been replaced by Graphs.jl.
Hence all you need to do is to replace the line:

using LightGraphs

with

using Graphs

After the change restart Julia in the Jupyter so you do not have the name clash.

Let me know if it works after the replacement.

@ghost
Copy link
Author

ghost commented Mar 2, 2022

@pszufe Thanks! that one resolved, however, later it gives error regarding plotting
image

@pszufe
Copy link
Owner

pszufe commented Mar 2, 2022

Change:

ns = LightGraphs.neighbors(s.m.g, agent.current_node)

to

ns = Graphs.neighbors(s.m.g, agent.current_node)

@ghost
Copy link
Author

ghost commented Mar 2, 2022

Perfect! So, all the codes are the same, and just need to change the older LightGraphs to Graphs. Is there any comprehensive documentation for using OpenStreetMapX.jl in addition to STABLE one. These are a bit brief.

Thanks again!

@pszufe
Copy link
Owner

pszufe commented Mar 2, 2022

Yes they are unfortunately brief - we look for volunteers here!

For time being have a look https://openstreetmapjl.readthedocs.io/en/stable/
This is the project that OpenStreetMapX.jl took most of the code (and most of it has been rewritten and extended later). Everything that used to work in OpenStreetMap.jl will also work with OpenStreetMapX.jl maybe with slight naming changes.

@ghost
Copy link
Author

ghost commented Mar 2, 2022

Thanks a lot @pszufe for your help. If I gain expertise I'll be happy to extend it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant