Home > OS >  AnyLogic: Changing ResourcePool based on programmatically created schedule
AnyLogic: Changing ResourcePool based on programmatically created schedule

Time:12-02

I refer to a similar problem enter image description here enter image description here

CodePudding user response:

To work with dynamic capacity of ResourcePool, I use a schedule shift by plan. in some cases it meets the need. The implementation of this is simple, in the schedule you give values 1,2,3 etc. They actually point to a position in the array.

Example of the schedule

And inside the ResourcePool you define it as follows:

Example of the ResourcePool by plane

In my example, at times when the schedule value is 4 the capacity of the ResourcePool is 0 and at other times it is as per my parameters.

CodePudding user response:

Change the "Kapaziät definiert" to "By schedule". Create a fake schedule object fakeSchedule (normally, not programmatically). Make sure it always returns 0 as the value.

Then, use this call for "Kapazität":

' mySchedule == null ? fakeSchedule : mySchedule`

This will tell the pool to use your schedule if it exists, else the fake one

  • Related