Closed RCura closed 12 years ago
Still not working, I tried with alpha 0.05, with closing fully netlogo and reopening it, still the same bug :/
Here is my bug message :
error (ArrayIndexOutOfBoundsException) while observer running ASK called by procedure TEST-NW called by Button 'test-nw'
NetLogo is unable to supply you with more details about this error. Please report the problem to bugs@ccl.northwestern.edu, or at https://github.com/NetLogo/NetLogo/issues, and paste the contents of this window into your report.
java.lang.ArrayIndexOutOfBoundsException: -1 at org.nlogo.agent.Link.getLinkVariable(Link.java:195) at org.nlogo.agent.Link.getTurtleOrLinkVariable(Link.java:179) at org.nlogo.extensions.nw.jung.Algorithms$$anonfun$dijkstraShortestPath$2$$anonfun$apply$2.apply(Algorithms.scala:62) at org.nlogo.extensions.nw.jung.Algorithms$$anonfun$dijkstraShortestPath$2$$anonfun$apply$2.apply(Algorithms.scala:62) at org.nlogo.extensions.nw.jung.Algorithms$$anon$6.transform(Algorithms.scala:52) at edu.uci.ics.jung.algorithms.shortestpath.DijkstraDistance.singleSourceShortestPath(DijkstraDistance.java:201) at edu.uci.ics.jung.algorithms.shortestpath.DijkstraDistance.getDistanceMap(DijkstraDistance.java:285) at edu.uci.ics.jung.algorithms.shortestpath.DijkstraDistance.getDistance(DijkstraDistance.java:266) at org.nlogo.extensions.nw.jung.Primitives$WeightedDistanceToPrim$.report(Primitives.scala:209) at org.nlogo.prim._externreport.report(_externreport.java:50) at org.nlogo.prim.etc._show.perform(_show.scala:13) at org.nlogo.nvm.Context.runExclusive(Context.java:119) at org.nlogo.nvm.ExclusiveJob.run(ExclusiveJob.java:56) at org.nlogo.nvm.Context.runExclusiveJob(Context.java:161) at org.nlogo.prim._asm_proceduretestnw_ask_2.perform(:1) at org.nlogo.nvm.Context.stepConcurrent(Context.java:91) at org.nlogo.nvm.ConcurrentJob.step(ConcurrentJob.java:82) at org.nlogo.job.JobThread.org$nlogo$job$JobThread$$runPrimaryJobs(JobThread.scala:143) at org.nlogo.job.JobThread$$anonfun$run$1.apply$mcV$sp(JobThread.scala:78) at org.nlogo.job.JobThread$$anonfun$run$1.apply(JobThread.scala:76) at org.nlogo.job.JobThread$$anonfun$run$1.apply(JobThread.scala:76) at scala.util.control.Exception$Catch.apply(Exception.scala:88) at org.nlogo.util.Exceptions$.handling(Exceptions.scala:41) at org.nlogo.job.JobThread.run(JobThread.scala:75)
NetLogo 5.0.1 main: org.nlogo.app.AppFrame thread: JobThread Java HotSpot(TM) 64-Bit Server VM 1.7.0_05 (Oracle Corporation; 1.7.0_05-b05) operating system: Linux 3.2.0-26-generic (amd64 processor) Scala version 2.9.1.final JOGL: (3D View not initialized) OpenGL Graphics: (3D View not initialized) model: Untitled
07:11:52.199 SwitchedTabsEvent (org.nlogo.app.Tabs) AWT-EventQueue-0 07:11:52.194 RuntimeErrorEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 07:11:52.180 PeriodicUpdateEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 07:11:52.157 OutputEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 07:11:52.136 OutputEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 07:11:52.127 OutputEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 07:11:52.106 OutputEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0 07:11:51.949 AddJobEvent (org.nlogo.window.ButtonWidget) AWT-EventQueue-0 07:11:51.861 InputBoxLoseFocusEvent (org.nlogo.window.ButtonWidget) AWT-EventQueue-0 07:11:51.850 PeriodicUpdateEvent (org.nlogo.app.App$$anon$1 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0
OK, that's weird. On my machine, your test case gives me:
observer> setup
observer> test-nw
(turtle 27): 2
(turtle 27): 22.268338814508297
(turtle 27): [(edge 10 27) (edge 10 13)]
(turtle 27): [(edge 27 53) (edge 13 53)]
(turtle 27): 22.268338814508297
(turtle 27): [(edge 27 53) (edge 13 53)]
Only thing I can see is that maybe I made a mistake when packaging the zip file... Let me check that and get back to you...
Packaging error indeed. If you re-download the file, it should now be OK. Sorry about this.
I will write a script to automate this so it does not happen again.
Indeed, working now, thanks for it :)
There's a bug with the nw:weighted-distance-to and nw:weighted-path-to functions : You can't use a "breed variable" (defined with mybreed-own[]) as a weight, it crash the model :
Here's a little exemple to make this obvious :
extensions [nw] undirected-link-breed [edges edge] links-own [ myLength ] edges-own [ edgeLength ]
to setup clear-all create-turtles 100 [setxy random-xcor random-ycor] ask turtles [ create-edges-with n-of 10 other turtles with [edge-neighbor? self = FALSE] [ set myLength link-length set edgeLength link-length ] ] end
to test-nw nw:set-snapshot turtles edges ask one-of turtles [ let target-turtle one-of other turtles with [link-neighbor? myself = FALSE] show nw:distance-to target-turtle ; WORKS show nw:weighted-distance-to target-turtle "myLength" ; WORKS show nw:path-to target-turtle ; WORKS show nw:weighted-path-to target-turtle "myLength" ; WORKS
] end
So, you can only use a links-own variable as a weight, what is a problem :)