averbraeck / opentrafficsim

Open Source Multi-Level Traffic Simulator
BSD 3-Clause "New" or "Revised" License
29 stars 11 forks source link

Change Type from abstract class to interface? #49

Closed WJSchakel closed 1 year ago

WJSchakel commented 1 year ago

Class Type is stateless and has a single method that could be implemented as default. This would make Type inheritance more modular.

WJSchakel commented 1 year ago

Type is now an interface. The default isType() method relies on equals to be implemented. This is currently the case for all types, except for LaneBasedAbstractPerceptionCategory and sub-classes. Perception will be streamlined later.