0
votes

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

[1]

Any help would be massively appreciated!

1

1 Answers

1
votes

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)