Antares_Simulator
Antares_Simulator copied to clipboard
Districts : simplifying the code
Type SetsOfAreas (see study.h) is used to print aggregated results for a group of areas. Its friend SetsOfLinks is defined but never used. We remove it and make subsequent simplifications :
- [x] class Sets no longer needs to be a template class, or have template methods (So sets.hxx is removed, and sets.cpp is created)
- [x] class SetHandlerAreas (specific operations very much related to sets of areas) needs to be moved from Study code area into sets.h/.cpp
What should be done in the future :
- [ ] class SetHandlerAreas should be questioned as a class : does it constitute a cohesive code entity ? Should it not be integrated to class Sets ? What should we do with its code so that Sets are clearer and simpler (next point may give a solution for this point) ?
- [ ] class Sets should be refactored : indeed, it contains many private std::vectors / std::maps (pMap, pOptions, pByIndex, ...), associating a property to a set of area. We make many loops over these containers. This is chaotic design. Instead, we should define a class Set (for a single set), and make existing class Sets a collection of Set. Properties of a set should be contained in class Set. Besides the fact it would be more natural and clear, I suspect it would cause many simplifications and code reductions.