How can i model "Conveyors" breakdown time in Anylogic? - anylogic

1-I am modeling a production line in Anylogic that has a group of Conveyors. Each Conveyor has it's own failures and breakdowns. How can i Create a pool of Resources from the existing Library "Conveyor".
2-Is there any way to attach "Conveyor" to "Resource pool"
I tried Conveyor in Material Handling list but i does not have Resource set so that i can attach a Resource pool

You may want to "agent-ify" your conveyors: Create a custom agent type MyConveyor that has 1 conveyor and some info on downtimes, etc.
Flag these are "Use as resources" in its properties.
Then, you can use them as resources in resource-pools.
However: This probably won't solve your immediate issue right away as it is a bit advanced.

enter image description herewhat you can do is to generate a failure token (Failure agent) that is associated to a conveyor (has a conveyor as a parameter)
Then you change the speed of the conveyor to 0
conveyor.setMaxSpeed(0,MPS);
Then the token will seize a resource and the resource will act accordingly
finally when the resource is released, you change the max speed to its original

Related

how to control 3D object of seized resource?

I have a truck agent that seizes a trailer resource from "trailer" resourcepoolblock (thanks to seize block). I want that both the agent both the resource make a rotation in the 3D animation. I did for the agent, while for the resource i tried:
"agent.resourceUnitsOfPool(trailer).trailer1.setRotation(-PI);"
But it does not work. What is the right command in order to control the 3D object of the resource?
Thanks for the help.
resourceUnitsOfPool returns a list of all resource agents seized. Assuming you're only seizing a single trailer, you could do the following.
agent.resourceUnitsOfPool(trailer).get(0).setRotation(-PI);
The above would refer to the agent and set its rotation. If you want to rotate a Shape3D object within the agent, just refer to it after the get(0).
Or you could use resourceUnitOfPool (which I assume you were trying to use. Notice unit, singular), which returns the first occurrence of resource unit of a given pool among the seized resource units, and then proceed in a similar manner.

Same resource from resource pool for subsequent process

There is a process, box enters station (i) and operator and machine are used for SETUP, then box moves to (ii) where only machine is used.
there is 1 - operator, but 2- machines.
there are 2 conveyer systems.
How to ensure that box uses same Machine resource in station (ii) as station (i)
**Or
Ensure the Machine is continually seized from station (i) to (ii)
To re-seize the same resource - When the box seizes a resource, set a variable equal to the resource that was seized. In the resource pool, you can see "on seize" and there is self, unit, agent. Agent is the one doing the seizing and unit is the one that got seized. For the second station, in the resources section, check "customize resource condition". Try something like agent.unitSeized == unit; where unitSeized is the variable you set up. See the help menu for this. You might have to play around a little on where this occurs, exact syntax.
To keep the resource seized, I would not use a station. There is no option to seize a resource with the built in station resource & release it later. I would use a position on conveyor and just handle everything manually. That is, convey to that POC, and then next block in your flowchart can be a seize. You can then delay for processing, add a convey for getting to the next POC on conveyor 2, delay for processing, release resource. This approach would work for your first case too. You can have much more control if you route to various positions, and then send to delays or other regular process blocks to get the behavior you want. If you take this approach, you could add decide blocks, so that it covers both of your cases via an input parameter.

Forklifts stop moving and freeze in place

I am facing an interesting problem with this warehouse model of mine. I have forklifts that move shipments around a network- the warehouse, and the model seems to be running fine until st some point forklifts start getting stuck at random location in the network for no reason. The longer I run the model the more forklifts are stuck. The are like completely frozen in place. At first I was defining the number of forklifts- resource pool capacity, using a schedule and I thought that might be the problem, so I went a head and changed it to constant capacity, and the problem still arises as you can see in this image.
As far the resource pool, the seize, and release blocks concerned; I kept the default settings and didn't change anything.
Here's a screenshot of the resource pool properties. I defined forklift as an agent and inside that agent is nothing but the image of a forklift and at the "use in flowchart as" box I set it to resource unit. I don't quite understand the 100 at the end of shift priority box, but I left it at the default value.
Here's a screenshot of one of seize blocks but all the block are similar
Similarly, this is screenshot of one of release blocks where the forklifts return to their home location after each task. Here I tried all the options from return to home every time to release from a given pool and choose the forklift pool or just releases the correspondent seize block, and that all didn't resolve the issue
Again, the model runs fine and only after 10% of the running time period this starts to happen. Any help would be appreciated.

How to change shift group size of resource pool dynamically during simulation in anylogic?

I am trying to use anylogic to model labor shortage in production. I have the workers set as a resource pool with the capacity defined using shift plan, defining the number of workers by different shift. I am trying to include a event module that changes labor capacity for each shift during the middle of simulation. However, anylogic showed me an error saying I cannot change shift group size dynamically. Is there any workaround to allow this to happen? Thank you.
You can recreate the schedule within an event each time you need to perform a change.
AnyLogic's API explains this quite well, see https://help.anylogic.com/index.jsp?topic=%2Fcom.anylogic.help%2Fhtml%2Fdata%2FSchedule_API.html (sample model or 'creating and initializing schedule programmatically on model startup')

Anylogic: how to individually address to resources within a Resource Pool

I am using Anylogic where I have just one ResourcePool made by just one Resource Type unit (created through the command "Resource Agent" in the Process Library).
I define the capacity of the ResourcePool, let's say, to 20 and I would like to have each of the single element (or some of them) within the Pool with a different value for the same parameter (e.g 3 units have parameter=1 , other 4 units parameter=2 ...).
First of all how can I set individually each of this parameter? Do I need to use a population of agent? If yes how can I do that? And how can I call the resourcePoolPopulation in other location within the model?
Is there a clevere way to do that?
Hope it is clear, thanks!
That is a weak spot of resource pools, IMO. They are designed to hold a homogeneous "soup" of similar resources and it is hard to pull in a specific element.
However, not impossible, there are various ways. You can create your resource agents manually in an agent population first and add them to the pool manually after creation. Then, in the service object, tick "manual resource unit choice" (or similar) and use a criteria that matches your resource params.