Search code examples
anylogicdiscrete

Replacement subjects stop for no reason in Anylogic


I am having a problem keeping my Gilt Replacement Rate slider continuing to add new animals to my model. I have added in a giltQuarantine delay of 8 weeks just after the source block, which helps to visualize how the gilt replacement rate is working.

Everything is working, initially; however, after several weeks, the giltQuarantine delay drops to 0, and no new gilts enter the herd. The Gilt Replacement Rate adds the desired amount to the model, each week, with no stop time listed.

At around 30 weeks, the number of agents in the giltQuarantine delay begins to decline and finally becomes 0, while the number of sows in the system is only 167. It should be steadily increasing to 1000 sows.

I cannot see why this is happening, as I should have a consistent supply of gilts entering the herd each week, which the variable giltReplacement says is happening (see Model running at 54 weeks (screenshot 4)).

I also tried increasing the Gilt Replacement Rate, which worked for several weeks, but then also declined as the number of sows in the system reached 1024. I want my herd size to remain stable at 1000.

Is there any reason that would be causing this decline in replacement animals?

Complete flow for sow model Gilt Replacement Rate slider information enterHerd Source information Model running at 54 weeks


Solution

  • Probably because you limit the total number of arrivals in enterHerd to breedingHerd. Remove the limit and test it.

    Also, you can see current rates and other charactistics of flow chart blocks by clicking on them at runtime. Maybe that helps you pinpoint the issue further.

    if nothing works, simplify your setup. It is already fairly complex. If you run into this issue now without knowing what causes it, it shows that you do not follow a good modelling approach (add 1 tiny feature, test everything, repeat) :)