Problems with set-patch-size and resize world at startup

, ,

Hello,
I use the GIS extension to load a map in NetLogo. To fit the map, I use the startup primitive including:

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.

Isaac B.

Hey Isaac,

this is my interface right now:
Imgur

As you can see, the patch size is set to 0.6.

When I now close and reopen the model again, it looks like this:
Imgur

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!

Isaac B.

1 Like

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

end code

Hi @anders_ekeland,

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.

Isaac B.

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.