Antares_Simulator
Antares_Simulator copied to clipboard
Remove variable numSpace
Basically, we have structures whose member data is duplicated for multi-threading, and indexed by numSpace, the thread number.
My advice would be to confine this numSpace
variable to the highest level, so that this implementation detail doesn't leak everywhere. I think this work will mainly concern the code that generates the output, which is where most occurrences of numSpace
are found. There are also a few in the hydro heuristics code.
Example (src/solver/variable/economy/inflow.h)
void initializeFromStudy(Data::Study& study)
{
pNbYearsParallel = study.maxNbYearsInParallel;
InitializeResultsFromStudy(AncestorType::pResults, study);
pValuesForTheCurrentYear = new VCardType::IntermediateValuesBaseType[pNbYearsParallel];
for (unsigned int numSpace = 0; numSpace < pNbYearsParallel; numSpace++)
pValuesForTheCurrentYear[numSpace].initializeFromStudy(study);
// Next
NextType::initializeFromStudy(study);
}