When thinking conceptually of Agent-Based Models, it is quite natural to think of types of agents as classes of objects, with subclasses for specialization.
NetLogo also supports this idea for one level of subclassing: turtles and named breeds.
But what if we have more than just one level of inheritance (subclassing)?
For example, in one of the models that I used in an introduction, I had a conceptual class hierarchy as follows:
+--------------+
+---| factory |
+---------+ | +--------------+
+---| company |<|---+
| +---------+ | +--------------+
| +---| distr-center |
+--------+ | | +--------------+
| turtle |<|---+ |
+--------+ | | +--------------+
| +---| outlet |
| +--------------+
| +---------+
+---| truck |<|--- (more subclasses)
+---------+
Then, we can either create breeds at the first level for companies and trucks,
or at the second level for factories, distr-centers, outlets, and subclasses of trucks
(or use different levels in different branches), but not both.
Both choices have their own complications.
Now, it would be nice if we could declare them all as breeds with the proper “is-a” relation.
My proposal is adding a breeded breed primitive:
breed [companies company]
company-breed [factories factory]
company-breed [distr-centers distr-center]
company-breed [outlets outlet]
turtle-breed [trucks truck] ;; alternative name for breed to emphisaze "subclass of turtle"
truck-breed [lorries lorry]
We could do something similar for link breeds:
undirected-link-breed [roads road] ;; no alternative name needed
road-breed [highways highway]
directed-link-breed [fans fan]
fan-breed [groupies groupie]
Once this mechanism is in place, there is no limit to the levels of subclassing.
We can declare -owns at each level, and have procedures specific for any breed – as shown in its tagging comment.
(For “breeded reporters” we would need another mechanism. A module mechanism might help here.)