anylogic

Dynamic parameters in Anylogic


hope you're all well.

I'm new here.

I'm having some trouble working with dynamic parameters in Anylogic while developing a discrete simulation.

In resume: I want a delay to be dynamic and follow a triangular distribution, since it's the distribution that adjusts better for the delay time of the employees.

After researching and trying, I've been able to make the program work, but I'm not sure if it's ok.

Imagen 1: here is where I have set the parameter to be dynamic. Default value is a triangular distribution

Imagen 2: this is de delay I want it to be related to the parameter "tiempoAtFarm". I put the "()" sentence so that it calls the function. My doubt is; Why when I click on the delay, the parameter does not highlight in purple? as it happens with static parameters

When I run the program, it runs well with no errors, but I'm not sure if I'm doing the right thing.

Thank you so much.


Solution

  • You are doing it ok. In fact, you can skip the dynamic parameter and just type the code directly into the delay duration.

    Usually, we use functions: type the code into a function that returns a double, and call the function from the delay block.

    PS: You can test stuff like that via traceln(...) commands