Multiple Patch Layers

34 views
Skip to first unread message

Donald Hawk

unread,
Aug 1, 2022, 12:39:18 PM8/1/22
to netlogo-users
Do I have to go to Netlogo 3D to have multiple non interacting patch layers? Think floors of a building. 

Michael Tamillow

unread,
Aug 1, 2022, 12:43:27 PM8/1/22
to Donald Hawk, netlogo-users
I would recommend using the patches as are and giving it a layers attribute. You should be able to do everything with that. 

It’s all data anyways, it’s just a matter of how you choose to organize it.

Sent from my iPhone

On Aug 1, 2022, at 11:39 AM, Donald Hawk <donal...@gmail.com> wrote:

Do I have to go to Netlogo 3D to have multiple non interacting patch layers? Think floors of a building. 

--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/492bdcac-a232-451a-aea7-947858edb016n%40googlegroups.com.

Wade Schuette

unread,
Aug 1, 2022, 12:50:49 PM8/1/22
to netlogo-users
Yep.  Depending on what you're doing,  having some patch variable that is actually a list of values ( for "floor" 0,1,2,3...) would also work.
You could try things both ways ( implicit levels via lists in variable slots that patches-own, versus totally separated levels in levelspace ) and see how much performance hit you get either way and how easy it is to maintain and keep things clear in your head and code.

I made a two hospital system by making one hospital system and then having a third tiny model in Netlogo that ran them both and passed data back and forth occasionally, including loading different parameters for sliders ) as they were launched. So again, one netlogo model for generic-hospital became two different virtual hospitals, but if you change code in the base hospital model it affects very "level" or instance  / replica of that.

Wade


Wade Schuette

unread,
Aug 1, 2022, 12:56:03 PM8/1/22
to netlogo-users
sorry for afterthought.
The level-space approach automatically gives you two simultaneous parallel viewports into the grid of patches and agents,
which I found is kind of nice to see what's going on.    If you hide the level data inside variables in patches,  you could
still write a routine to flip the displayed patch color, say, back and forth between levels, showing one at a time, but
I don't know how to have two parallel viewports in one model.

Actually if it's possible to have two viewports open, could someone tell me how to do that?
thank you!

wade

Donald Hawk

unread,
Aug 1, 2022, 1:15:09 PM8/1/22
to netlogo-users
Thanks everyone. Level parameters and hiding based on that should work.
I also considered flattening the floors into a long strip of patches and a 
offset for agents coordinates based on floor. Maybe there would be a way
to scroll the viewport based on floor.

James Steiner

unread,
Aug 1, 2022, 11:55:51 PM8/1/22
to Donald Hawk, netlogo-users
Working with lists of properties is usually a pain I would do anything to avoid. Just imagine trying to use diffuse on properties stored in lists! Or doing route finding, or anything.  Ugh. 

I'd either use 3D, which also helps visualization,  or use turtles as the layers, adding a pzcor and pzcor as well as whatever other properties are needed.

Or both.  3d and turtles as layers.

Plus turtles gives you links as neat way to encode paths/connections between spaces, in any direction, and spanning more than one patch unit. 

And, since turtles are not locked into the grid like patches, you could sill do animated 3d vis by applying the right math. 






On Mon, Aug 1, 2022, 12:39 PM Donald Hawk <donal...@gmail.com> wrote:
Do I have to go to Netlogo 3D to have multiple non interacting patch layers? Think floors of a building. 

--

James Steiner

unread,
Aug 2, 2022, 10:08:48 AM8/2/22
to Donald Hawk, netlogo-users
Lol I meant pzcor and zcor. 

Also there's the possibility of meta views, where the world in much bigger than 1 floor,  and the floors are just different area of the world. Like a hundred floors would look like a 10x,10 grid of floors 

Simple math maps the x, y, and floor number to the grid coordinates of the world. 
Reply all
Reply to author
Forward
0 new messages