ANYLOGIC Seize Resources - anylogic

I would like the agent from source 1 to use tool1 and tool2. What code should I write in seize block in order to achieve it?
As seen in picture

None. You setup the seize object to use both in a way that you require. You can seize from several resource pools directly using the Seize properties.
The help is your friend:

Related

My goal is that all resources of a resourcePool perform an action at a specific time. How do I create this iteration?

I am simulating a hospital stay with anylogic, on multiple levels. Each level has its own staff, represented by different ResourcePool (doctor, nurses, OSS) I created the flowchart of the actions concerning the patient. Now I would like, at a specific time (lunch and dinner), the OSS do tour the patients.
How do I set up that all OSS of a ResourcePool go to the rooms?
I would like to create a very small parallel flowchart, with sieze, moveTo, delay and release.
TNX
Easiest way is to use the "Downtime" element to prescribe your resources to do some action, see image below:
Under the "task type" selection, you can send them to a separate flow chart using a "ResourceTaskStart" element and they will do what you put downstream of that (moveto, delay...). Make sure to finish that with a ResourceTaskEnd block.
PS: The "Downtime" block can easily be triggered via a schedule. Make sure to read the help on that block (and the ResourceTaskStart/End blocks) and study the example models that use those.

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

How do I seize a subset of seized resources?

I have a pool of 25 agents (Operators). When an Order is generated, I seize a few Operators and move them to one of many different ProductionSuites as determined by a parameter in the Order.
Within the ProductionSuite, I have a variable of type ResourcePool that I would like to use to have these Operators perform tasks.
In the main window, I put this code in the "On seize unit:" code box:
agent.assignedSuite.suiteOperatorPool.addAgentToContents(unit);
but this triggers a NullPointerException error. Am I using the addAgentToContents method incorrectly?
You have not initialized your suiteOperatorPool variable, it's "initial value" field is empty. Hence, this is just an empty shell of type ResourcePool that cannot do anything, including adding agents to it.
You would need to initialize it properly using the ResourcePool API, but I don't think that is possible.
Also, you cannot have resources be part of 2 resource pools, as you are trying to do. You should think of a different way to solve your problem. Maybe rephrase the issue so we can think of alternatives. You might not need a RP at all but just use pure agent functionality...?

How to see where the agent is stored. Anylogic

In the rackStore block, functionRack determines where the agent is stored (which can be one of three PalletRacks).
However in the rackPick block , I do not know how to specify the "Pallet rack / Rack system" field, and my search of the examples/handbook/other questions and guessing has been unsuccessful.
If you could help me out, I would be very grateful.
Thanks in advance
extract
Put RackSystem block at Main, select all the pallet racks in the block properties. Then, go to RackPick properties, specify the RackSystem block. There are couple of example model: Wholesale Warehouse and Distribution Center, find them in Help - Example Models.

Anylogic How to seize multiple patients (2-3) with a single doctor

I'm wondering how to use a seize function in Anylogic.
I would like to a doctor (resource) can seize multiple patients (coming from sources) at a time.
You can't seize multiple agents with one resource without doing some sort of trick, and the trick depends on your problem... This is an example where you batch and unbatch agents before and after the seize.
Be careful on how you release the resource if you are separating the patients with the unbatch.