Trasporters are jammed at a specific location in AnyLogic - anylogic

I hope you are having a great day.
Recently, I tried to build an AnyLogic model with free-space transporters, but I encountered an unexpected situation as shown below.
I thought that there is no logical reason why all the transporters are jammed in a specific position. Is there any solution or possible reason for this situation? I have attached my model for your information.
Thank you for reading this question.

The problem with the traffic jam appears to be due to the fact that there are two few attractors available for the transporters to place the items and then they get stuck waiting for an attractor to become available...
When running your model as-is I get a jam in the stage one area
And in the logic blocks, I can see that the transports are stuck in the "Move By Transporter" block.
If I assume the attractors are set to 4 for a reason I would suggest the following logic - similar to what is described here
You create a list of all the attractors available. See the neat trick in AnyLogic where if you select a bunch of objects and then right-click on them you can automatically create a collection.
You can call it something like attractorsAvailabeStage1
And create a new map to store the WIP agents that will be occupying the attractors
And have a function that will provide the available attractors.
Change the move by transporter option to move to an attractor
And also return the attractor as available once it gets moved from its location
Now you only need to prevent mew agents from entering the area if there is no more attractors left or agents on their way to the attractors
I tested it and it works great for stage 1 you need to do it for all the stages.
On second thought....
seeing that you do have resource pools and service blocks. You can achieve the same logic I described by having resources first size the locations, then go to the transport block, and then be delayed
You first seize the space in the stage, then you move to the space, then you delay it.... then you wait, then seize the space in stage 2, then move there, then release stage 1.
I would go for the latter option

Related

Considering differences in the same materials - Stations

I am trying to simulate a manufacturing assembly process, where material items are processed following an unique line. In the quality control stations, when a failure is detected, the object is sent to the repair area (by a truckpallet) and, when it is repaired, the same resource takes it and puts it at the start of the line. Until this point, I already programmed it.
The problem is the following: when it is a repaired object, is has to follow the same conveyor but with no stops in the stations. The object must enter a station and leave it, with no delays (as the works related with the stations have already been made).
I thought the best would be to consider the difference (repaired vs. not repaired) in the Agent, but then I can't work with it in the Main agent... I have also tried alternative solutions, for example defining variables in each station 1 and consider that in the stations delays and in the following station:
triangular( 109.1*delay_bec, delaytime_bec*delay_bec, 307.6*delay_bec)
Actions - in finished process:
if(delay_bec==0){
delay_headers=0;
delay_bec=1;}
But nothing worked... Any help?
I thought the best would be to consider the difference (repaired vs. not repaired) in the Agent, but then I can't work with it in the Main agent...
This is actually the correct approach. You need to create a custom agent type, give in a boolean variable isRepaired (or similar) and then in the delay you can dynamically adjust the duration using that characteristic:
agent.isRepaired ? 0. : 100
This will delay normal agents by 100 time units and repaired agents not at all.
Obviously, you must make sure that the agents flowing through the flow blocks are of your custom agent type (see the help how to do that)

How can I use rackPick block to seize more than one item at once? - Anylogic

I'm developing a project with Anylogic and I have an AGV with a Kuka cobot on top of it (a sort of mechanical arm used to pick item from a shelf, in this case) which should pick some items from a rack store. I would like the cobot to pick more than one single item at once.
The blocks I already put are shown in the picture and I thought that specifying "seize whole set at once" in the rackPick block would have helped but it did not.
Could you help me, please?
Thank you in advance.
The RackPick logic is agent-centric, i.e. the items in the rack are the active entities. They, essentially "pick themselves", optionally using your robot as a help.
So if you want your robot to pick several, it is best to batch your agents together before putting them into a rack (using Batch) and then let your robot pick that batch agent. You can unbatch into the original agents afterwards.
PS: That "seize whole set at once" option is again from the agent perspective: if it would need several resources to be picked, then this option would have an effect. In your case, with only needing 1 robot, it is meaningless

Avoiding collisions with other objects while moving an Agent to a specific destination

I have in my model some free-moving agents, which travel to specific nodes. I use the function...
moveTo(node)
...to specify the node an agent should visit. Using this function, the agent travels the shortest path to the node. However, the model layout contains areas (i.e. image files), which the agent should not pass. Right now, the agents may travel through these areas to reach their destination. Now I'm wondering, whether there is an easy way to permit an agent to enter specific areas in the model, when traveling to a node.
I already took a look at the example model "Wandering Elephants" where the elephants are permitted to walk through areas with water. The solution there is, that if an elephant meets water in the direction it's currently heading, it randomly searches for another direction, until it finds one without water. However, this approach doesn't really fit to my problem, as the elephants in the model wander around without any specific destination. I'm searching for a method, which works for an agent that travels to a specific point. In the best case, the agent would search the shortest path around the obstacle to reach its destination.
Edit 1: The following figure shows my problem in a nutshell. On the left side is my model structure, while on the right side the state chart of my custom agent. What is happening in the model: The 3 sources are producing agents, which will be delayed for an uncertain time (delay stops with stopDelay()). Everytime an agent enters a delay, the delay is added to the collection request. My customagent check requests in a loop until the collection contains at least one request. Then, the customagent randomly selects a request (i.e. delay object) to serve. Each delay is associated with a node (the collection processNodes maps delays to nodes). Now, I want to cast my customagent to a Transporter and move it to the corresponding node. The agent should avoid collisions with the stripped walls in the model. I want to avoid any seizing and releasing of resources. I just want to adapt the behaviour of the Transport agent from the material handling library to my agent.
Edit 2:
In my current testbed, my custom agent does not consider node 1 or node 2. For testing, the agent should only try to reach node without any collisions.
I found a sufficient work-around. Not exactly what I wanted, but it works. Against my initial intention, I use now seize and release for transports. However, I added a hold-block in front of each seized-block and only a resource, which decides to serve the process, is able to unblock the corresponding hold. The on-enter control of the unblocked hold ensures that the hold is directly blocked again as soon as a single agent flows through. For the case that other users are also interested in the solution, I attached the flow-chart of the process and the state-chart of the Transporter-Agent. The system structure is quite the same as in my initial question.
There is no build-in way unless you use transporters from the Material handling library (or pedestrians). These can do what you need.
So easiest might be to convert you agents to transporters temporarily.
Otherwise, you will have to code something yourself...

Rackstore and rackpick multiple agents at a time in anylogic

I am trying to develop a model that essentially shows the movement of material in the warehouse.
I want the rackstore block to move multiple boxes at a time in the rack using crane. In the current model, crane takes one box at a time, stores it in the rack and comes back to take next box.
Not sure if RackStore supports that, but as always, you can find a solution in AnyLogic.
One simple fix: bundle your packages together into 1 agent using the batch object. Then, they stay together until being taken out by the crane at the end (via RackPick) and you can un-batch them to their original agents. Have a look at some example models using batching.
cheers
Depending on the details of your model, one option is to use batch as Benjamin stated, but I think I feel the pickup dropoff blocks would work better because with the dropoff you can drop the boxes one by one, while the batch forces you to separate all the boxes at once...
So with the rackstore you can't do this, but if you use the pickup and then dropoff, you will have to store somewhere in your model what rack positions are free though, because when you move the crane you will have to choose the rack position yourself, while the rackstore does it automatically...
Nevertheless, the batch may also work... it depends on the details of your model

Moving one agent within another agent in Anylogic

I am making simple distribution center in Anylogic.I did make truck agent and i am able to move it from one gis point to another gis point.
But I want to load some other agents(Let's say banana agent) into my truck agent and then trucks start their journey(if truck is full of banana).How can i do this?
I hope you have already solved your problem from almost a year ago. However, since there is no specific answer, I'll leave it here for anyone who might get stuck with the same problem.
Anylogic's Process Modelling Library (PML) has an element called Pickup and its opposite, Dropoff. This is used to do exactly what you asked: to load some element into a transporter (either a truck, a forklift, or even a person).
To use the block as you asked you would need a topology like in the picture:
The Queue elements are necessary to hold elements until the pickup occurs.
The Pickup element might pick elements in three modes:
While a given condition is True;
An exact amount (if available);
All available agents.
I'm assuming all trucks must be completely filled up to its maximum capacity. Hence, the chosen mode will be the second one where the exact amount will be TruckCapacity, a parameter of agent Truck.
The selected mode picks up agents (in this case Bananas) up to the desired amount. However, if nothing is available or the present amount is inferior to the desired, the native behavior of the Pickup block is to allow the container element to simply go through it and pick only what's available.
To prevent such behavior, I've created a restricted area where only 1 Truck can be at a time. Additionally, the Hold block WaitFullyLoaded (set to initially blocked) forces the container agent Truck to be fully loaded. Whenever a Banana enters the Queue waitTruck, a verification is performed to check if 1 Truck can be filled. If so, allows passage for that one truck:
if(self.size()/TruckCapacity>=1){
WaitFullyLoaded.unblock();
}
To block WaitFullyLoaded again, when the truck passes through the restrictedAreaEnd block, it performs WaitFullyLoaded.block();
The main idea is this. However, many features can be added and changed.
Hope this helps,
Luís