I am trying to write code for my Anylogic discrete events model which injects a specific number of agents, and then after 4 weeks, this injected number of agents is conditional on other numbers of agents in the model (circled in red on the screenshot). One of the sources of agents that I want to account for is a Double (it is on a slider), and the inject call will not accept it, it only wants int values.
weeklyLeavingNursing = 0;
if (time()<4) {
enterHerd.inject(10);
}
else {
enterHerd.inject(10 - (slider.getValue() + weeklyLeavingOpen + weeklyLeavingNursing));
}
Is there a way to write the code with both int and Double values? Any ideas would be greatly appreciated.