If you exploit objects and classes, they can greatly assist you in organizing the information needed to solve your problem. They can even be a great help in the implementation itself. In small scale examples (like the ones in this manual), object orientation may seem like overkill, but its generality rapidly becomes advantageous in real-world problems.
Besides the conventional benefits of inheritance, using objects and enumerated variables in Solver offers at least the following additional advantages:
-
You can group all data about the same entity in the same object. This grouping means that you avoid splitting entity data over vectors and then having to index those vectors to retrieve those data.
-
You can define and post class constraints on any class of objects.