How to set agents speed according to the road they are on? - anylogic

I am working on a project using Anylogic and i was wondering if there is a way to set the agents speed according to the road they are on.
I am working with the GIS map, where I have some GIS regions which the car agent moves from one region to another through the moveTo() function. For this project I am using the Anylogic default routing provider.
I expected the agents to use the road's speed limits, but I realized they are moving with their "inicial speed" with a constant speed. Does anybody know how to set my cars speed according to the road they are on?
Thanks a lot!!

Related

How to set the throttle input of a vehicle in UE4 using acceleration/speed data from SUMO?

Hi everyone (and thank you in advance)!
I have successfully connected SUMO into UE4 using network sockets, with the intention of using UE4's superior graphics to run my SUMO simulation. I have managed to get the location, speed, angle, and acceleration (amongst other bits of information) of each of the SUMO vehicles across to UE4, and assigned this information to different vehicles in UE4 (i.e. each SUMO vehicle has a replica in UE4).
I have (I am pretty sure) managed to replicate the steering in SUMO in UE4, and I have managed to ensure that vehicles start at the same location in both programmes, but I am confused as to how I can match the speeds of the vehicles in UE4 and SUMO so that the vehicles are at the same location at the same time (which they need to be as they are turning at the same time).
Unless I have missed something really basic (I may have as I am fairly new to UE4 and SUMO), I don't think that there is a set velocity node for vehicles, whilst I don't think that the "Move to" node works for skeletal meshes. Of course, I could use the "Set Actor Location and Rotation" node, however, for vehicles, I have to teleport the object, which defeats the point of creating a realistic-looking simulation.
So... my question is, in short, "Is there a way of taking a speed/acceleration value and using this value to set the speed a vehicle moves at in UE4?"
I have not found a direct way of setting the velocity of the vehicle actors from SUMO, but a workaround, albeit a slightly annoying solution, is to use static meshes for the vehicles instead. Using the positional "x" and "y" information that SUMO outputs, one can then use the "Move Component To" node in UE4 over time delta (which is the frequency information is sent from SUMO) to get the vehicle static meshes to move in a way that looks similar to how a vehicle would move.

Make agent face other agent upon MoveTo arrival?

I have a warehouse model where "Picker" agents move along the Y-axis to reach the front of a "picking slot" agent.
I would like to make it so that upon arrival in front of the picking slot, the Picker agents face the picking slot.
I am aware of the "Set rotation upon arrival" feature of the MoveTo blocks, but I am having trouble making sense out of it. What sort of value should I input here?
Is it possible to dynamically define the rotation according the the agents' relative location to each other? If so, how should I go about it? Some of the slots are on the left of the picker, and others on the right.
Thank you.
Please have a look at the Wholesale Warehouse example in the sample models (help section of AnyLogic). There they use agent.agent_image.setRotation(-PI) and then turn it into initial position with agent_image.setRotation(0) You can use this dynamically and with if conditions in your blocks.

Netlogo - agent travels along the link

I am modelling another project concerning the warehouse operations. In this particular instance, I have to visualize the warehouse layout of the storage space. I plan to define a number of links as routes where the agents (forklift truck) can travel along with in the warehouse.
For each link, there is a distance associated with. It’s not the link length as the distance but a distance attributes user defined. If I set a forklift truck driving speed, how do I reflect it accurately in the model with the use of command like fd (or forward) and jump. How do I specify the unit of measure in jump or fd in association with the distance defined in the link to ensure the forklift truck is moving in a correct distance per tick given the speed and distance.
A simple demo would be highly appreciated! Great thanks!

Simulating p2p model in NetLogo

I want to use a problem with P2P method in Netlogo.
I modified Uri Wilensky Traffic Grid model. Every light has its knowledge about number of its car (who are waiting at light).
I want to count all number of car without global number, just asking light by light (between neighbors)
Somebody can help me? How can I count all agent or patch without global variable or functions with peer-to-peer?

Dynamic Obstacles in AnyLogic

I am modelling a crowd simulation in AnyLogic where the people throng around a vehicle which moves in time. Since the vehicle is an obstacle, pedestrians should not get within it.
As walls are treated as obstacles in AnyLogic, I decided to use walls for defining the vehicle.
However the problem is walls are static elements and their position cannot be changed at run-time. So is there any solution or a viable alternative for the problem described ?
UPDATE
If I model the vehicle as a pedestrian instead and use a large diameter, peds still manage to get inside it. Moreover, since vehicle is now a type of pedestrian its movement is not straight, and deviates from its path due to collision with others peds.
If you make pedSource and vehicleSource both flow into a single pedGoTo, the Agents they produce will bounce off one another regardless of their type.