NetLogo / NW-Extension

This is the NetLogo Network Extension. For general information about NetLogo, see:
http://ccl.northwestern.edu/netlogo/
Other
62 stars 25 forks source link

Resize world in 3D messes up distance calculations #160

Closed qiemem closed 8 years ago

qiemem commented 8 years ago

There's already a failing test for this: https://github.com/NetLogo/NW-Extension/blob/af307ea7d864f897f71e26906d605a71c6e972d3/tests.txt#L103

From the console:

observer> crt 2 [ create-links-with other turtles ]
observer> show [ nw:distance-to one-of other turtles ] of turtles
observer: [1 1]
observer> resize-world -1 1 -1 1 -1 1
observer> crt 2 [ create-links-with other turtles ]
observer> show [ nw:distance-to one-of other turtles ] of turtles
observer: [false false]

Strangely:

observer> show [ nw:turtles-in-radius 1 ] of turtles
observer: [(agentset, 1 turtle) (agentset, 1 turtle)]
qiemem commented 8 years ago

Looks like the context isn't get reset on the resize.

qiemem commented 8 years ago

This happens in 2d as well.