Search code examples
anylogic

Is there a way to stop Source Block to zero if the storage is full?


Screenshot Screenshot

I have two sources namely SourceDeliveryTTruck and SourcePallets. Arrival rate for the respective sources are 1 per minute for SourceDeliveryTTruck and SourcePallets to Call of inject() function.

The tricky part is when the truck reaches loading block, the call of inject function is called.

Now I am trying to stop the sourceDeliveryTTruck.set_rate(0) when the storage is full. Note that SourcePallets has the agent type Box.

Now during compiling I am getting the following error,

The method hasSpace() is undefined for the type Store.

I understand that since storage is related to box, and I am trying to stop the source of delivery trucks, which is causing the following error.

Do you have a turnaround solution to this?


Solution

  • So the solution to my problem is very simple. I was including the storing block in my code. All I had to do replace the storing block with the actual storage.