Open sylvlecl opened 1 year ago
Description
Class ISimulation has a complex design for no added value: it inherits from a template implementation type, which contract is not explicit.
ISimulation
Instead, we should use a very simple design with composition:
class Simulation { public: ... private: std::unique_ptr<SimulationImpl> implementation; }; class SimulationImpl { public: virtual void setNbPerformedYearsInParallel(uint nbMaxPerformedYearsInParallel) = 0; bool simulationBegin() = 0; bool year(Progression::Task& progression, Variable::State& state, uint numSpace, yearRandomNumbers& randomForYear, std::list<uint>& failedWeekList, bool isFirstPerformedYearOfSimulation) = 0; void incrementProgression(Progression::Task& progression) = 0; void simulationEnd() = 0; void prepareClustersInMustRunMode(uint numSpace) = 0; void initializeState(Variable::State& state, uint numSpace) = 0; }; class Economy : public SimulationImpl { ... }; class Adequacy : public SimulationImpl { ... };
would reduce compile time
Description
Class
ISimulation
has a complex design for no added value: it inherits from a template implementation type, which contract is not explicit.Instead, we should use a very simple design with composition: