Agent Inheritance

You can inherit agent types from some other agent type. 

Let's give the example when this feature can be useful. Assume you have different vehicle types in your transportation model. All of them have common behavior and attributes and some different ones. Say, a lorry and a truck. Both have the same statecharts consisting of the same states. But while the common is the same, some aspects differ.

You can create one agent type Vehicle that will act as a base type for two other agent types: Lorry and Truck. There, on Lorry and Truck diagrams you can define the attributes specific for these vehicles using parameters. Also there you can set specific animation shapes. But all the things you define in Vehicle agent type (statechart, parameters, etc.) will be common for both classes that extend Vehicle: Lorry and Truck.

  To make the agent inherit from other agent type

  1. Select the agent type in the Projects view.
  2. In the Properties view, open the Advanced section and choose the base agent type from the Extends other agent combo box.

Demo model: Population Model with Connections and Disease Spread