Make a "Region Pool" based on cities distance - anylogic

I am building a simple Logistic Simulation with AnyLogic 7.1. I have a group of cities with a Pool for the Trucks. Each city has a different Pool because the number of trucks is based on the city population. I want to make a "Group Pool" based on distance, so I would add the Pools from the selected cities and make a "Region Pool" for that.
The distance that this "Group" will reach must be editable (for example in a variable)
Is that possible to be made with AnyLogic? If yes, please tell me where to start, I have a very begging level. Thank you.

Related

Selecting a set of attractors among available attractors

i want to make Pedestrians to select a specific attractors once they enter a waiting area where this area is a waiting area , this area has many attractors , how that can be done ?
The pedWait block has that option clearly defined:
you can choose a customer attractor choice and use areaNode local variable in the attractor choice in order to get the attractor you want. In this example i choose the first attractor (with index 0), but you will have to create your own logic in order to decide what is the suitable attractor for your incoming agent.

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 simulation how to add gas-station?

I have a smart city simulation project using Netlogo and I need to add a "Turtle Shapes" gas station in the tools but I dont know how can I put it in the street be cause I want the cars that I have in simulation to pass throw and take gasoline my question is how can I add the gas station and calculate the total consomation of gasoline by cars and thanks.
The next image shows the simulation but without gas-station!!
Wow really cool project! Basically you can see the gas station as a particular kind of patch, then if a car touch this patch his energy goes up to maximum. The answer now is: how the car knows where is the gas station? You can do something like that: everyone that pass near the gas station leave a scent of knowledge of where the gas station is and if for example a car is half empty fuel then it starts follow the scent where is more strong and arrives at the gas station. I do this for my ant colony in order to make return them to the nest from every point of the map and it works just fine. Here's my project on github, I just upload it for you

Creating pedestrians at random after every simulation in a given area

I would like to know if it is possible to create a random distribution of pedestrians at a given area each time I begin my simulation?
enter image description here
Create a Collection named allLocations of type AreaNode that contains all of your possible initialisation areas:
Use a process flow like the following with a PedSource:
Set the Area property in the PedSource to the following:
allLocations.get(uniform_discr(0, allLocations.size()-1))
This code randomly assigns one of the areas in the list to each agent as a start. You can modify this to fit your needs, with other distributions for example.
You can now see how Agents pop up randomly at the different locations:
The example model can be run and downloaded here.

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!