Closed beta-ray70 closed 6 years ago
The Road A* utility is designed for finding a path from a segment to another segment, not from a connection to another connection. It is more close to the needs of the agents: find a sequence of segments.
I would recommend you to consider to call the other solve
functions, which are written for the previously explained purpose.
Nevertheless, I will update the code of the API in order to let you find a path between two connections.
Hello,
Can you tell me the "solve" function that use the RoadSegment ? I only see "solve" function that use RoadConnection or Point2D<?,?>.
Thanks in advance,
Julien Barbier
The other solve
functions takes a 2D position as input. There is no solve
function that takes a segment as input.
Nevertheless, commit bd22152 contains a patch for solve(RoadConnection, RoadConnection)
. It should be available on the Maven server.
When we call the function "solve" with two RoadConnection, we have this runtime error :
"java.lang.AssertionError at org.arakhne.afc.gis.road.path.astar.RoadAStar.translateCandidate(RoadAStar.java:201) at org.arakhne.afc.gis.road.path.astar.RoadAStar.translateCandidate(RoadAStar.java:1) at org.arakhne.afc.math.graph.astar.AStar.findPath(AStar.java:521) at org.arakhne.afc.math.graph.astar.AStar.solve(AStar.java:439) at org.arakhne.afc.math.graph.astar.AStar.solve(AStar.java:416) at ia51.project.trafficsimulation.agents.Environment.findPath(Environment.java:244) at ia51.project.trafficsimulation.agents.Environment.spawnCars(Environment.java:197) at ia51.project.trafficsimulation.agents.Environment.$behaviorUnit$Initialize$0(Environment.java:93) at ia51.project.trafficsimulation.agents.Environment.lambda$0(Environment.java:299) at io.janusproject.kernel.bic.internaleventdispatching.AgentInternalEventsDispatcher$1.run(AgentInternalEventsDispatcher.java:295) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)"
The code that causes this issue is :