Reputation: 37
I am trying to create a service that varies depending on the resources that are used.
For example if a nurse were to carry out the service it could take 10 - 35 mins, whereas if this is carried out by another member of staff it could take 5-25 minutes.
I have had a go - as in the picture below, however, what I've written doesn't seem to be working.
Resource dependent delays
Any help would be massively appreciated!
Upvotes: 0
Views: 781
Reputation: 273
First, since the parameter "Delay time" accepts a value, you need to replace if-else statement with conditional expression "? :". The syntax is the following: condition ? value if true : value if false. Moreover, your should use another condition to check if the agent has a resource unit from "Nurse":
agent.resourceUnitOfPool(Nurse) != null ? triangular(10, 15, 35) :
triangular(5, 10, 25)
Upvotes: 1