Hello,
I use the GIS extension to load a map in NetLogo. To fit the map, I use the startup primitive including:
set-patch-size 0.6
resize-world 0 1077 0 686
When I open my model, everytime my view is bigger than it should. I then need to select my view, shortly take my mouse and drag at one of the edges (if you would resize the view). When I then open the edit field of the view, the patch size is 1 and I have to manually set it to 0.6. Why does it not work in the startup primitive?
I am unable to reproduce this issue without any other code or setup. Is there any reason why you need to set these properties programmatically instead of saving them in the Model Settings dialog? Also, it’s worth noting that resizing the View by dragging its edges as you described will change the patch size. If you want the patch size to stay at 0.6, you can’t resize the View manually. Let me know if you have any questions.
When I now close and reopen the model again, it looks like this:
Also 0.6, but it is clearly not correct. Also, if i then type a random value in patch-size, say ok, then change it to 0.6 again, it still has the wrong size. Only when I drag it slightly with the mouse, then change it to 0.6 it gets smaller as in picture 1. Hope this is clear enough
Thank you for the clarifications, I am now able to reproduce the bug. Unfortunately there’s nothing you can do about it right now, but it will be resolved in the upcoming beta release of NetLogo 7. Once it’s released, feel free to download it and test it out!
I need to do a - Task, Search, Allocation and Completion (TSAC) excercise for a Univ. course
The excercise has a “search area” 0,0 and 1000, 1000.
Netlogo did not like a
resize-world 0 1000 0 1000, downsizing to 100 helped, but 50 was better
But when when I do a show patches - I do not get 2500 as I expected ... but 2601
Where are those 101 "Dalmatians" coming from and where are they? on the screen?
BTW - if any of you have any code TSACish code - please send it to
[email protected]
**************** The code, just in case *******************
to setup;
clear-all
reset-ticks
clear-patches
resize-world 0 50 0 50
create-turtles 6
[ setxy random-xcor random-ycor ]
ask turtles
[
set shape "turtle"; more shapes under Tools
set size 5
set color red
]
show min-pxcor
show max-pxcor
show count patches
end
In NetLogo, the origin is in the center of the world by default, not in the corner. If you click the Settings button on the right side of the Interface toolbar, you’ll get a dialog where you can change the origin location to the corner instead. After making that change, your line resize-world 0 50 0 50 should work as expected, as well as resize-world 0 1000 0 1000.
Regarding the “101 dalmatians”: coordinates in NetLogo are on the centers of patches, not on their corners and edges. So a world that extends from (0, 0) to (1, 1) actually spans two patches on each axis, for a total of 4 patches.
Thanks a lot Isaac. My orientation was “corner”, I tweaked the max-pxcor - to avoid scrolling to see the whole “action_area”.
I understand now where the “Dalamatians” hide, but to me - intuitively (0, 0) to (1, 1) = 1, and (0, 0) to (2, 2)= 4
But a pure convention, so no reason for rage, but to have to write (0, 0) to (49, 49)to get 2500 patches - less intuitive for most people than than (0, 0) to (50, 50) I guess - - but I’ll get used to it.