Anylogic-- How to assign firklift to specific worker? - simulation

I am using a forklift to store items into racks.
What I want to achieve is an agent (worker) going to the forklift, driving it and storing items into racks.

Related

Is there a way to use the material handling Library to assign a randomly generated list of items to a worker to collect from storage shelves

Essential, I aim to model the picker process in a warehouse. In my scenario a worker is given a randomly generated list of items to complete an order. The worker goes to the storage and complete the order. In my model each agent/worker only collects a single item per run and I'd like to know how to set each worker to randomly collect multiple items(say ten) in one run
I added the storage shelves and added the retrieval block and assigned worker agents to it. I did not know how to set up the picker scenario
If you use a RackSystem as shelves, so you can use the function myRackSystem.randomAgent() to select a random pallet from the RackSystem.
If when you generate your pallets you put them into a population, So you can use the function randomWhere( pallets, p -> p.weight > 1000 ) to select a random agent from a population and satisfying the specified condition.
Good luck!

How do i recreate a loading truck case with a limited number of trucks?

I have a warehouse with many palletrack which contains raw materials that have to be loaded on trucks and moved to a second warehouse. The loading zones (where trucks are loaded) are the green rectangular nodes (see image). The problem is that I don't know how to recreate the loading. If I use a seize then every single agent will seize a truck, but if I used the pickup block (like the pickup model tutorial), the source would create more trucks than I want(they are limited).
Any tips? (i want to say thanks to all the people who are helping me this week by the way)
Although there are many ways to model this I think the best option would be to batch your agents into truckloads and then to seize the trucks. Trucks must live inside a resource pool, so that you can have a fixed number of trucks.
Since you are using a network model I would then suggest you attach the truck to the batch you created and move it around and then detach the truck and release it afterward. You can however simply seize the truck and have the batch object use the animation of a truck.

How to create orders for picking process at warehouse operations using Anylogic

During the creation of a generalized warehouse model, I ran into a problem when trying to create an order event that can be used by order pickers to retrieve the products from the storages racks. Currently, I am using a source block which creates "orders" of a single type of pallet (1 to 5). The pickers each travel to pick up a pallet from the rack and transports them to the next location.
Question: How can I create an order consisting out of several pallets consisting of different types.
Question: How can I use a single picker (resource) to pick multiple pallets in a single run through the warehouse before transporting all the pallets to the next location (process).
Kind regards,
Stefan
Question 1
normally i would create a class for the higher level order (say Pickwave class).
And when instantiating it you need to save a list of actual picking orders(pallets) into it (say collection of type ArrayList<Order>).
And to process your pickwave you can use a loop which will steer your resource/transporter/picker to the next Order location until all orders are picked. If everything is picked you exit your loop and move to your next location
Question 2
you don't really pick the orders as you would normally pick them using RackPick block in 1-to-1 scenario. But as you have a refence to all your orders inside you pickwave object you can still control their location/animation programmatically.

A question about seizing more than one ressource in Anylogic

I'm working on a supply chain project with AnyLogic. In my model which is similar to product delivery example in AnyLogic examples, there are two agents which are Retailer and Fulfillment center. Both have their own vehicles. What I'm trying to do is to share vehicles so retailers and Fulfillment centers use the vehicles of each others. What I did is to create two Ressource Pool in each agent. So in the seize block as it shown below in picture, I added two ressource sets . In each statechart of each vehicle as it shown below and after delievering products, I informed my vehicle to go back to his initial location and in this case it can be Retailer or Fulfillment center. However after simulation, I got an error message in console that tells me that my agent which is the vehicle is trying to move to unknown source
If you put 2 ResourcePools into 2 agents, you have 4 pools in total. But you only want 1 shared pool, right?
Only add 1 ResourcePool to Main and use that from both agent's Seize elements. You will not be able to select the pool in the usual dropdown list (as there is no pool in either agent) but you can easily use the dynamic code to specify it. Note that the code below assumes both agents are embedded in Main:

Customize resource choice to transport the pallets with a specific forklift

I would like to store pallets with the forklift where id=1. I create a database with the different IDs and connect it with my forklift population. After that I create a custom resource choice condition where the forklift with id=1 should store the pallets. It doesn't work, the process stuck and the forklift doesn't move.
database
agentpopulation
resourcepool
rackstore_resourcechoicecondition
this is the typical error in which you created a population of Forklifts and then you think they will magically become part of your resourcepool... but they don't... they are just forklifts that will not even show in your simulation and will do nothing... the forklifts that are shown in your simulation are the ones generated throught the resourcepool NOT using the database... using custom population doesn't mean that the resourcepool will use the population you created with your database.
SOLUTION
To do what you want to do, first be SURE to erase that population you just created... forklifts will be nothing but a resource type
Second be sure that your database doesn't have the same name than your forklift agent type or population.
Then in your resourcepool capacity use:
(int) selectFrom(forklifts_db).count()
note that im using forklifts_db as your database to be sure you are using a different name
Then on new unit, use this
((Forklift)unit).id=(int) selectFrom(forklifts_db)
.where(forklifts_db.id.goe(self.size()))
.firstResult(forklifts_db.id);