Track driven distance of transporters in Anylogic - anylogic

I have modelled a fleet of AGVs as agents through TransporterFleet and TransportControl blocks.
The AGVs navigate in free space between different conveyors and their home locations.
Is it possible in Anylogic to track the driven distance for each AGV?

The Transporter API includes a getDistanceTravelled() function since version 8.5.2

Try using the "Logging" feature as that typically tracks the distance covered by agents in your model.
If it doesn't work for free-space AGVs, you have to record it manually (recurring event every x time-units)

Related

How to i make agents in AnyLogic avoid another moving agent?

I am trying to model an agent based model where a certain agent population of people avoid to get close to a single agent, a random moving VIP.
I have tried to useif (distanceTo(main.vip < restrictedArea)) ;moveTo(uniform(500),uniform(500))
The agent will, most of the time, move to its new random destination through the restricted area which i want to avoid
Either you use the Material-handling library (where the transporters have build-in collision avoidance).
Or you model it youself. For that, you need a cyclic event in your agent that constantly checks the distance to whatever other agent you are interested in. If below some threshold, you tell the agent to move elsewhere.
Note: the first option can be quite slow. The second is not trivial to implement. Less due to coding skills, more because having intelligent collision avoidance algorithms is not trivial

Custom defined transporters colliding

I've created a simple transporter (think of it like a box on wheels) and I have two separate TransporterFleets that each contain one of these simple transporter agents. In the TransporterFleet blocks I specify a "Min distance to obstacle" = 0.5 meters; however when the simulation runs, the two separate transporters go right over each other from time-to-time.
Note that I have two separate TransporterFleet blocks because each transporter has certain paths that it cannot take.
What can I modify/add so that these transporters will never collide?
i had the same issue and suggestion from AL support was to increase transporters deceleration. If you have default value (1 m/s2) than it could be possible that transportesr cant break fast enough...

Gathering statistics on a resourcePool

I want to get some statistics on some of the resources I have in AnyLogic. For instance, I have a forklift agent and a resourcePool of forklift and I want to get the hourly utilization and the total distance traveled by all forklifts in the pool. I know I can click on the resourcePool icon and see the utilization, but I want to get that with the traveled distance updated and saved every hour.
Sorry I'm new to this and took me few months of learning to get my model straight
Thank you
First, you must create an agent type for your resources. With that in place, you can record anything anytime using datasets or default AnyLogic logging capability.
See some example models using resource pools with custom agent types such as "Lead acid battery production" and many more.
PS: Recording distance travelled is done automatically if you apply default logging but it is a bit more involved if you want to do it manually.

Energy Consumption in Anylogic

I would like to analyse the electrical energy consumed by a furnace in a conveyor system. Is there a method or specific function to do this using Anylogic?
I've found little material surrounding this, so pointing in the right direction would be great.
Simple answer: There is no build-in functionality. But you can easily do this yourself.
If you want very high accuracy, you should check system dynamics (but this slows your model quite a bit).
If you want a simple approach, I can think of this:
create a variable elecConsumptionPerMin in your furnace agent
create an event consumeElec in your furnace that cyclically (every minute) adds to the total furnace consumption (another variable)
on model startup, ideally set myFurnace.consumeElec.suspend()
when the furnace starts producing, call ´myFurnace.consumeElec.resume()` to start consuming enegery
Obviously, you can refine this to the nth degree and you might also want to experiment with state charts. But this is the simple approach

Space between agents in discrete-event simulation

I have a question about space between agents. In my model I have agents generated from a source and then they enter a delay, after the delay the agents go into a a queue with a capacity of 1 but I have a preemption option. The agents that go into the preemption are supposed to move along a circled path (I used a delay block for this) but there should always be a certain space between the agents, e.g. 100 meters. How can I incorporate this in my model to make sure my agents are not too close to each other?
One way you can control the distance between your agents is to move them on a path using a dummy transporter instead of the moveTo block. Transporters allow you to define a minimum distance to obstacle that prevents the agents from getting too close to each other.
Two options if you mean the static queue with agents actually waiting:
1) if your queue size is 500 meters, define the maximum amount of agents allowed in that queue to 6 (so you have 100 meters of distance between each agent)
2) Use the PML settings block from the PML palette and define an initial capacity of animation location equal to 6 (if your queues are 500 meters)... but this applies to all the model, so maybe it won't be good enough.
If you want them to have 100 meters space while they are moving towards their objective through the path that represents the queue, then the answer depends heavily on your model and it cannot be answered with the info provided... you need in this case to control the agent movements adding some logic... but I don't know what logic is suitable for you.