79621494

Date: 2025-05-14 12:46:51
Score: 0.5
Natty:
Report link

In general, agent inheritance is designed for reusing basic Java features like parameters, variables, and functions. However, it does not support ports or editing inherited process flowcharts. As a result, the inheritance may not be the best approach when creating custom blocks or libraries.
As an alternative, consider adding an instance of the "Process" agent type into the "RateControlledProcess" agent type. This is also how AnyLogic library blocks are developed — when a block from the Process Modeling Library or another library is needed while creating a new one, it is typically embedded and reused within the new block. In other words, we relay on a composition approach rather than inheritance (https://www.digitalocean.com/community/tutorials/composition-vs-inheritance)

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Tatiana Gomzina