How to make the patch background move behind a turtle? - netlogo

I am working on a project to create a flight control simulator in NetLogo. I know the physics of a plane necessary for flight, but I don't understand how to incorporate that into code and how to create a turtle on a background of patches so that as I control the turtle (which performs the function of the plane) the background of patches moves (as if it were the sky). I don't know where to start especially with the coding. Any ideas, tips, hints? please.

I'm not sure if I completely understand but it sounds like you want to move the turtle (you already know how) but want the turtle to stay in the center of the view and the background to move behind it.
I think you would control the turtle as you have planned, but if you want to visualize it as you are describing with the patches moving behind it, you need to call
follow turtle 0
Where turtle 0 is the turtle you are moving as a plane. This just needs to be called once in some setup routine.

Related

Animation on top another resource agent animation 3D

How can I place an agent animation over another resource agent animation in a 2D simulation?
I already moved the order in the Palette but still the seized resource gets on top of the attached agent.
In the image below, the agent is the white triangle and the seize resource is the blue truck, I need to see the triangle on top of the blue truck. The truck doesn’t has a presentation item in the Palette I don’t know why, still it appears in the simulation.
Palette vs Animation
In the 3D animation everything looks correct because I have the Z coordinate set correctly, is the 2D animation the one with the issue.
You must ensure that your truck agent animation is part of Main as well.
Likely, you will need to have them in a custom agent population and your ResourcePool needs to add new units to it (you can set this up under the "Advanced" properties of the ResourcePool).
Then you can "layer" it below your white triangle using API calls as described in the help here.

Density Maps for Materials moving along Conveyors in Anylogic

I'd like to show congestion areas on a conveyor network by using the density map included into the Material Handling Library, but so far I haven't find a way to do so, as material agents movement cannot be tracked by the density map, but it only accepts transporters or pedestrians (both in free space movement mode).
So I thought I could create a "parallel" agent (for instance, a pedestrian) that could get attached to my material and move along with it. Then I could set the pedestrian visible property to "no" so that it does not show in the animation, or make it really small as an alternative approach.
The problem when doing the pickup/dropoff logic is that the pedestrian disappears from the scene when it gets picked up (although it's internally batched with the material) so the density map shows nothing.
Same thing happens if I try to seize/release a transporter, as they do not travel along the conveyor with the material agent.
Any idea on how to get this?
Thanks a lot in advance!
You won't be able to drag pedestrians, they actively move via PedMoveTo blocks. This is a creative idea but it will not work.
You will have to code your own heatmap using dynamically colored rectangles that you animate on top of conveyors. Doable, but might be more work than is really required for your purpose ;)

Netlogo barriers, walls, and drawn lines narrower than a patch

I'm working on a model of an event in a specific building. I have the floorplan. There's one issue: the building is large enough that if I make the walls take up a whole patch, making them easy to factor into pathfinding, the model is too large to run. So I have them narrower, and am treating them as turtles.
But people are still walking through walls. I want them to not walk through walls.
There's an intersection model in the library that means I can tell when someone has already walked into a wall, but that doesn't help with pathfinding. I can also draw lines where the walls are. But I'm not sure how to or even if it's possible to have lines register as locations.
Additionally, if I just use the whole patch that a wall occupies, that means there are no actual viable paths.
So: how can I make a turtle that is less than a tenth of a patch wide impermeable to other turtles using a pathfinding algorithm?
The workaround I tried ended up being the massively increased number of patches, which added granularity to the simulation, which was cool.
The fix ended up being taking my floorplan and turning it into a png of just the walls and then uploading that and making it so agents couldn't walk through patches that color.

Netlogo moving in a circle and stopping half way in the circle

not sure I have tried several ways to make the people move in a circle but they just don't go. Please help.
Here is my netlogo design, basically i have people standing in a circle but when I ask them to move, i do not know how to ask them to move in the circle.
When I hit the go button in netlogo, they do not even move. If I use fd 1, they just go everywhere, if i try to use the circle and distance they only go completely around the circle but never stop.
Thanks a Bunch,
R
See the circling example in the NetLogo Models Library:
http://ccl.northwestern.edu/netlogo/models/TurtlesCircling

Defining a vision cone in unity

I am attempting to implement a boids flocking model in unity.
I have managed to implement steering behaviours (separate, align, cohere) but I am currently using a fixed radius from the agent to define its neighbourhood (essentially a bubble around the agent). However, what I need to implement is a vision cone like the one detailed in this image:
Im unsure how I could implement this in unity. Could someone point me in the correct direction?
To add clarity, what I want to do is detect all other agents in a vision cone, but I'm unsure how to implement it. Currently I am just detecting all agents within a distance, though I need to ignore the agents behind the one doing detecting ( like in the picture) I'm not looking to visualise it, just detect the agents in that defined neighbourhood.
thanks
Detect all the agents in the circle, then check for every one of those the Vector3.Angle() between transform.forward and the direction to the agent.
(the direction from vector A to B is just B-A)