-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DO NOT MERGE - FOR EXECUTABLES ONLY RTEi #1190
Changes from all commits
6c4e8e7
c370f3a
1d11797
8c0356e
9f5edd7
9cf673f
699e262
3c9e642
b3d6fd5
a2c413b
d8807ff
fcbc6c5
f4461c3
c692f55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,27 +45,33 @@ AdequacyPatchOptimization::AdequacyPatchOptimization(PROBLEME_HEBDO* problemeHeb | |
} | ||
void AdequacyPatchOptimization::solve(uint weekInTheYear, int hourInTheYear) | ||
{ | ||
problemeHebdo_->adqPatchParams->AdequacyFirstStep = true; | ||
OPT_OptimisationHebdomadaire(problemeHebdo_, thread_number_); | ||
// problemeHebdo_->adqPatchParams->AdequacyFirstStep = true; | ||
// OPT_OptimisationHebdomadaire(problemeHebdo_, thread_number_); | ||
|
||
// never set AdequacyFirstStep to True and skip the islanding optimization | ||
Comment on lines
+48
to
+51
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need to change the definition of this class (revert all changes). We made a nice factory method just for that, see file src/solver/optimisation/base_weekly_optimization.cpp. Just return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I saw that. Nice. I agree it's a proper way to do it. |
||
problemeHebdo_->adqPatchParams->AdequacyFirstStep = false; | ||
|
||
for (int pays = 0; pays < problemeHebdo_->NombreDePays; ++pays) | ||
{ | ||
if (problemeHebdo_->adequacyPatchRuntimeData->areaMode[pays] | ||
== Data::AdequacyPatch::physicalAreaInsideAdqPatch) | ||
memcpy(problemeHebdo_->ResultatsHoraires[pays]->ValeursHorairesDENS, | ||
problemeHebdo_->ResultatsHoraires[pays]->ValeursHorairesDeDefaillancePositive, | ||
problemeHebdo_->NombreDePasDeTemps * sizeof(double)); | ||
else | ||
// if (problemeHebdo_->adequacyPatchRuntimeData->areaMode[pays] | ||
// == Data::AdequacyPatch::physicalAreaInsideAdqPatch) | ||
// memcpy(problemeHebdo_->ResultatsHoraires[pays]->ValeursHorairesDENS, | ||
// problemeHebdo_->ResultatsHoraires[pays]->ValeursHorairesDeDefaillancePositive, | ||
// problemeHebdo_->NombreDePasDeTemps * sizeof(double)); | ||
// else | ||
memset(problemeHebdo_->ResultatsHoraires[pays]->ValeursHorairesDENS, | ||
0, | ||
problemeHebdo_->NombreDePasDeTemps * sizeof(double)); | ||
} | ||
|
||
// no need to copy results/column ENS - > DENS, just set all DENS to zero | ||
|
||
// TODO check if we need to cut SIM_RenseignementProblemeHebdo and just pick out the | ||
// part that we need | ||
::SIM_RenseignementProblemeHebdo(*problemeHebdo_, weekInTheYear, thread_number_, hourInTheYear); | ||
OPT_OptimisationHebdomadaire(problemeHebdo_, thread_number_); | ||
// ::SIM_RenseignementProblemeHebdo(*problemeHebdo_, weekInTheYear, thread_number_, hourInTheYear); | ||
// no need to refresh anything now | ||
// do normal optimization | ||
OPT_OptimisationHebdomadaire(problemeHebdo_, thread_number_); // thread_number_is const and is = 0 | ||
} | ||
|
||
} // namespace Antares::Solver::Optimization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful,
ValeursHorairesDENS[hour] = 0
, see src/solver/optimisation/adequacy_patch_local_matching/adequacy_patch_weekly_optimization.cpp.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm positive we are good here. According to spec:
s0 PTO=DENS not PTO=ENS.
if ValeursHorairesDENS[hour] = 0 function calculateQuadraticCost will just return zero. It will not try to divide with zero.
If you meant that by this point in the code the column DENS is going to be all zeros, It is not the case. Zeros are overwritten for areas inside adq-patch in
src/solver/optimisation/post_process_commands.cpp line 231
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, LGTM