Sophie
Sophie

Reputation: 21

Anylogic: How to model setup times (tool change) in ResourcePool based on a parameter of the agent?

Since I got great help with the last question and didn't find any helpful tips in the help/tutorials, I'll try again :) Simplified situation is:

My idea is to record the machine status as variable/parameter (MachineStatus). When a resource unit is seized (code executed "on seize"), then it is compared whether productID = machineStatus. If they are equal, then no delay, if they are different, then interrupt for a certain time. However, I have two or three problems:

Thanks for your help!

Upvotes: 1

Views: 388

Answers (1)

Sophie
Sophie

Reputation: 21

Maybe someone is interested in how I solved the problem (a little bit different from my idea):

  • Define a parameter MachineStatus and a function "RetoolingTime"
  • Value of DelayTime of my service block:

MachineStatus.equals(agent.productID) ? 30 : 30 + RetoolingTime(agent.productID, RetoolingTime)

Note that 30s is my normal processing time and in case I have to retool, there is an additional retooling-time, which is calculated by the function.

To get the retooling-time I wrote the code into the function body of the function RetoolingTime:

Code of RetoolingTime

Upvotes: 1

Related Questions