Search code examples
anylogic

NullPointerException on AnyLogic after agent drops off another agent at a Store block


I have this NullPointerException error coming up on my model. The task at hand is: the transporter must pick up the agent at a storage and store it at a different storage from a group of them(let's call it group A), filling the storages in group A from left to right. To do that the storage block has as assigned "Storage" the output of a funciton "getFreeStorage" that checks the empty storage from group A that's located the more to the left.

Block diagram of the process descirbed above

Properties of the store block

Properties of the storage block where I intend to store the pallet

When I run the model the transporter will pickup the pallet and take it to the storage in group A, store it and as it's leaving a NullPointerException shows up:

Exception during discrete event execution:
NullPointerException
java.lang.NullPointerException
    at com.anylogic.libraries.modules.level_system.LevelDataStorage.getLevelData(Unknown Source)
    at com.anylogic.libraries.material_handling.LevelSystem.<init>(Unknown Source)
    at com.anylogic.libraries.material_handling.MHLSettings.c(Unknown Source)
    at com.anylogic.libraries.material_handling.MHLSettings.b(Unknown Source)
    at com.anylogic.libraries.material_handling.Store.b(Unknown Source)
    at com.anylogic.libraries.material_handling.Store$17.onExit(Unknown Source)
    at com.anylogic.libraries.modules.rack_system_module.RackPutInternal.c(Unknown Source)
    at com.anylogic.libraries.modules.rack_system_module.RackPutInternal$1.onExit(Unknown Source)
    at com.anylogic.libraries.modules.rack_system_module.RackCommandExecutor.a(Unknown Source)
    at com.anylogic.libraries.modules.rack_system_module.RackCommandExecutor$6.onExit(Unknown Source)
    at com.anylogic.libraries.processmodeling.SelectOutputOut.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.SelectOutputOut$1.onExit(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutputBlock.c(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutputBlock$1.b(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.InPort.receiveImmediately(Unknown Source)
    at com.anylogic.libraries.processmodeling.InputBlock$1.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
    at com.anylogic.libraries.processmodeling.PlainTransfer$1.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
    at com.anylogic.libraries.processmodeling.PlainTransfer$1.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
    at com.anylogic.libraries.processmodeling.PlainTransfer$1.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutputBlock.forwardReadyEntityNotification(Unknown Source)
    at com.anylogic.libraries.processmodeling.InputBlock$1.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutputBlock.forwardReadyEntityNotification(Unknown Source)
    at com.anylogic.libraries.processmodeling.InputBlock$1.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutputBlock.forwardReadyEntityNotification(Unknown Source)
    at com.anylogic.libraries.processmodeling.InputBlock$1.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutputBlock$2.a(Unknown Source)
    at com.anylogic.libraries.processmodeling.OutputBlock$2.action(Unknown Source)
    at com.anylogic.libraries.processmodeling.AsynchronousExecutor_xjal$a.execute(Unknown Source)
    at com.anylogic.engine.LibraryEventHandler$f.execute(Unknown Source)
    at com.anylogic.engine.Engine.a(Unknown Source)
    at com.anylogic.engine.Engine.nd(Unknown Source)
    at com.anylogic.engine.Engine$f.run(Unknown Source)

So far I've tried:

  • creating a new transporter fleet
  • not using the function to select the storage, by instead using the usual input of "storageX" in the "Storage" field of the store block
  • trying a different agent as transporter
  • making the pallet move independetly worked with no errors (altough I really need the transporter to move to fullfill the model intended outcome)

Any tips on how to solve it will be greatly appreciated!


Solution

  • Using the "by transporter" both on the retrieve and store block solved the problem! What I was doing before was using "independently" on the retrieve block and "by transporter" on the store block.