Thank you for your reply. I added 1 resourcepool and a Doctor agent with name and schedule parameters. I am still encountering initialisation error. Could you please explain step by step if i need to do more or a different approach? Should i use a doctor population or should i change doctors' names from string to integer?
I have written a list to the Main's On startup section as :
List<Doctor> doctorList = new ArrayList<>(Arrays.asList(
new Doctor("doctorX", schedule_doctorX),
new Doctor("doctorY", schedule_doctorY),
new Doctor("doctorZ", schedule_doctorZ)
));
doctorPool.set_capacity(doctorList.size());
doctorPool.resourceUnits().clear();
doctorPool.resourceUnits().addAll(doctorList);
and added a "createDoctor" function
Doctor doctor = new Doctor();
doctor.name = name;
doctor.schedule = schedule;
return doctor;
also on seize block, i used your code but the simulation cant be initialized with the error of:
Error during model startup:
UnsupportedOperationException
java.lang.UnsupportedOperationException
at java.base/java.util.AbstractList.add(AbstractList.java:153)
at java.base/java.util.AbstractList.add(AbstractList.java:111)
at java.base/java.util.AbstractCollection.addAll(AbstractCollection.java:336)
at multiple_pathyways_mech.Main.onStartup(Main.java:4087)
at com.anylogic.engine.Agent.h(Unknown Source)
at com.anylogic.engine.Agent.start(Unknown Source)
at com.anylogic.engine.Engine.start(Unknown Source)
at com.anylogic.engine.ExperimentSimulation.e(Unknown Source)
at com.anylogic.engine.ExperimentSimulation.run(Unknown Source)
at com.anylogic.engine.ExperimentSimulation.h(Unknown Source)
at com.anylogic.engine.internal.m$m.run(Unknown Source)