I am new to Anylogic and I am trying to build a sorting and palettizing model with conveyors ...
For the palettizing part, I used the "Palettizing Conveyor" example model and associated the relevant blocks to my model, but while the Pallet is entering the palettizing station or node, the model crashes and throws the error:
Exception during discrete event execution class sorting_conveyors.Pallet cannot be cast to class sorting_conveyors.PalletLayer (sorting_conveyors.Pallet and sorting_conveyors.PalletLayer are in unnamed module of loader 'app') java.lang.ClassCastException: class sorting_conveyors.Pallet cannot be cast to class sorting_conveyors.PalletLayer (sorting_conveyors.Pallet and sorting_conveyors.PalletLayer are in unnamed module of loader 'app') at sorting_conveyors.Main$22.agentLocation(Main.java:1)
The entire log can be read after trying the my model in the link : https://drive.google.com/file/d/1u84kvD9JbspLhUxaMcgHWrB2BocNSkmk/view?usp=sharing
Unfortunately, the error messages seems to be targeted to Java geeks only and does not advise you where to go to solve it.
Please any hint or a solution to solve the problem, it took me a more than a day searching for a fault but in vain.
On 'emptyPalletConveyor', changing the Material item type to 'Pallet' rather than 'Agent' fixed the bug for me.