Hi,
I am implementing many agents in my simulation and I need to keep an eye on efficient programming. Which way is more
efficient to use:
- to create one agent-class and assign each agent its sub-classes (all are victims, but some are in high danger, some
medium, some low etc) within the agent class ->this results in many variables and parameters in the agent class that
each agent carries around (some of which are not needed for each agent)
- or to create different agent classes with direct parameter allocation - more classes but less variables and
parameters within each class.
Are there clear tendencies which way to follow?
cheers and thanks in advance
Ben
Victor — 08.07.10
Ben, the rule of thumb is the following. If agents of different types have different behaviour and/or specific
parameters, it would be better to create an active object class for each agent type.