How can I use the .getServicedEntity() method on a Resource Unit without casting the agent type?
问题 I built a custom block that, among other things, tells the resource entering portIn of the block to move to the resource's seizing unit. I use a moveTo block with the destination node as: (Node)((Cart)agent).getServicedEntity().getNetworkNode(); but I need to know the agent type and cast it into the method. I would like to make this a generic block that can be used in other models and with any Resource Unit. I've tried using generic parameters in the custom block then selecting the agent type