Basically, I have the following problem: I have to model specialties of several hospitals in Anylogic, and analize what happens when one of more specialties are closed.
The problem is that the number of combinations of hospital-specialty is very high (around 1000), so i'm searching for a way to do it "dynamically/programmatically".
In other words, I'm searching for a way to create automatically a resourcePool (and a Schedule attached to it), without the need to create the resource in Anylogic MANUALLY. For example, something like this
//An arraylist of names of hospitals
for (String hospitalCode : hospitals) {
for(String specialtyCode : specialtiesCodes) {
ResourcePool res = new ResourcePool();
res.setName(hospitalCode + "_" + specialtyCode);
Schedule schedule = new Schedule();
//Set the type of the schedule along with other parameters. This will be used
//to set the capacity of the resourcePool res
schedule.setParameters(type, capacity, ...);
res.attachSchedule(schedule); //Connects the schedule to the resource
schedule.create();
res.create() //Creates the resources in the Main panel of Anylogic
}
}
Furthermore, in this picture I have several specialties (they are modeled as resourcePool, because the capacity and the delay time are essential for the problem I have to model)
An example of the modeled problem
You can see that I have created a bunch of resourcePools and Schedules, but I have done this manually.
I have also tried to copy/paste some resourcePools, but there is no way to change the name of a resourcePool. I have also seen the Java API but I have not found a solution.