Skip to content
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

refactor constraint construction #1627

Merged
merged 177 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
433b799
start
a-zakir Sep 2, 2023
bca6733
add FictitiousLoad
a-zakir Sep 2, 2023
adbd363
shortTermStorageLevel
a-zakir Sep 2, 2023
79136ac
flowDissociation
a-zakir Sep 2, 2023
60ea81c
bindingConstraintHour
a-zakir Sep 2, 2023
e4298f9
ghost
a-zakir Sep 3, 2023
c96df9c
this is not only about constraint builder
a-zakir Sep 3, 2023
1af5ead
pay attention to the time step
a-zakir Sep 3, 2023
1d33989
specific issue
a-zakir Sep 3, 2023
3f9f115
bug free
a-zakir Sep 3, 2023
7b2406e
smooth green?
a-zakir Sep 3, 2023
3b0c0d5
M&M
a-zakir Sep 3, 2023
bcc63e7
Max Pumping ok?
a-zakir Sep 3, 2023
a2de6d7
Area Hydro Level (_-_)
a-zakir Sep 3, 2023
b7b022c
finally
a-zakir Sep 3, 2023
317bdb5
basic
a-zakir Sep 3, 2023
fcef054
tiny
a-zakir Sep 3, 2023
2364b35
clean code
a-zakir Sep 4, 2023
507e355
add {PMin,PMax}DispatchableGeneration
a-zakir Sep 5, 2023
854ca38
clean code
a-zakir Sep 5, 2023
3029f79
ConsistenceNODU ok
a-zakir Sep 5, 2023
78dab46
NbUnitsOutageLessThanNbUnitsStop
a-zakir Sep 5, 2023
22862bd
NbDispUnitsMinBoundSinceMinUpTime
a-zakir Sep 5, 2023
afd0808
MinDownTime
a-zakir Sep 5, 2023
89584b0
setup Access Control
a-zakir Sep 6, 2023
d7e197d
remove comments
a-zakir Sep 6, 2023
a956ab9
remove comments
a-zakir Sep 6, 2023
34e9559
treat major code smells
a-zakir Sep 6, 2023
c81b801
treat major code smells 2
a-zakir Sep 6, 2023
1e65059
more on major code smells
a-zakir Sep 6, 2023
692a8a8
update after review
a-zakir Sep 7, 2023
7f8054d
about objects lifetime
a-zakir Sep 11, 2023
5a047c0
(does not compile) cut into small pieces
a-zakir Sep 11, 2023
bd394e3
Revert "(does not compile) cut into small pieces"
a-zakir Sep 11, 2023
676c0a4
aesthetic
a-zakir Sep 13, 2023
1a29e44
remove comment
a-zakir Sep 13, 2023
fa422d6
smart move
a-zakir Sep 13, 2023
cee5edb
**** move
a-zakir Sep 13, 2023
a44c65e
shallow
a-zakir Sep 13, 2023
687d879
customize error exception
a-zakir Sep 13, 2023
9433f0a
work on "group 1"
a-zakir Sep 16, 2023
ee2c51f
fix
a-zakir Sep 16, 2023
7364bd5
update
a-zakir Sep 16, 2023
f01decd
small
a-zakir Sep 18, 2023
5932373
group of constraint
a-zakir Sep 18, 2023
3c16029
from free function to class (LinearProblemMatrixBuilder)
a-zakir Sep 18, 2023
3622cfb
update LinearProblemMatrixBuilder class
a-zakir Sep 18, 2023
84b7e0e
fix
a-zakir Sep 18, 2023
a653ada
continue to group
a-zakir Sep 18, 2023
8ed7085
implement week binding constraints group
a-zakir Sep 19, 2023
688b36d
add HydroPowerGroup
a-zakir Sep 19, 2023
9b6de6c
builder as ctor parameter
a-zakir Sep 19, 2023
8256c26
builder as ctor parameter
a-zakir Sep 19, 2023
ea87d43
update
a-zakir Sep 19, 2023
1321445
clean
a-zakir Sep 19, 2023
bb5e1b6
int is not a bool
a-zakir Sep 19, 2023
b3b9c1f
add Hydro Smoothing group
a-zakir Sep 19, 2023
b2a2988
MinMaxHydroPowerGroup
a-zakir Sep 19, 2023
065632a
rename
a-zakir Sep 20, 2023
496c1bb
new MaxPumpingGroup
a-zakir Sep 20, 2023
6533cab
AreaHydroLevelGroup
a-zakir Sep 20, 2023
086f72a
God commit
a-zakir Sep 27, 2023
03c246a
new FictitiousLoad
a-zakir Sep 27, 2023
f2e6166
New ShortTermStorageLevel
a-zakir Sep 27, 2023
0c9a8ca
New FlowDissociation
a-zakir Sep 27, 2023
fced3d6
NEw BindingConstraintHour
a-zakir Sep 27, 2023
ae4b0e0
delete copies
a-zakir Sep 27, 2023
eb0d6e8
New BindingConstraintDay
a-zakir Sep 27, 2023
3651700
about includes
a-zakir Sep 27, 2023
0d1e4bc
New BindingConstraintWeek
a-zakir Sep 27, 2023
5cfa55c
includes...
a-zakir Sep 27, 2023
7377886
HydroPower
a-zakir Sep 27, 2023
76d4039
include.......
a-zakir Sep 27, 2023
fce50aa
new HydroPowerSmoothingUsingVariationSum
a-zakir Sep 27, 2023
a5fb74d
new HydroPowerSmoothingUsingVariationMaxDown
a-zakir Sep 27, 2023
9f5bccf
new HydroPowerSmoothingUsingVariationMaxUP
a-zakir Sep 27, 2023
65ee688
MinHydroPower
a-zakir Sep 27, 2023
932d5c9
MaxHydroPower
a-zakir Sep 27, 2023
6d5bef6
MaxPumping
a-zakir Sep 27, 2023
f308c96
new AreaHydroLevel
a-zakir Sep 27, 2023
63b3040
setup FinalStockGroup
a-zakir Sep 27, 2023
0cc3d45
fix
a-zakir Sep 27, 2023
62241f8
shrink method: linear problem run
a-zakir Sep 27, 2023
958ae3a
decomposition
a-zakir Sep 27, 2023
2e6352e
remove duplicated includes
a-zakir Sep 27, 2023
8ea67a8
update
a-zakir Sep 27, 2023
cbc4059
make FinalStockGroup is built
a-zakir Sep 27, 2023
d42fcca
just stay up-to-date
a-zakir Oct 6, 2023
09760f3
merge conflict fix
a-zakir Oct 6, 2023
1c62402
Merge branch 'develop' into feature/reshape-constraint-construction
a-zakir Nov 3, 2023
4a17f03
new P{Min, Max}DispatchableGeneration & PMinMaxDispatchableGeneration…
a-zakir Nov 6, 2023
312a3a5
renew StartUpCosts
a-zakir Nov 6, 2023
b599a35
add NbUnitsOutageLessThanNbUnitsStopGroup
a-zakir Nov 6, 2023
5efb48c
minuptime
a-zakir Nov 7, 2023
87ba06a
remove copy error
a-zakir Nov 7, 2023
0947de7
new LinearProblemMatrixStartUpCosts
a-zakir Nov 7, 2023
1f7eddb
fix
a-zakir Nov 7, 2023
985d063
fix 2
a-zakir Nov 7, 2023
d270e8c
update CmakeLists.txt
a-zakir Nov 7, 2023
4a30f57
fix
a-zakir Nov 7, 2023
f867b95
include errors
a-zakir Nov 7, 2023
62add4f
fix read-write data
a-zakir Nov 7, 2023
bd9a530
add documentation
a-zakir Nov 7, 2023
5aadd06
add doc for StartUpCosts group of constraints
a-zakir Nov 7, 2023
1a37a86
remove deprecated
a-zakir Nov 7, 2023
6aa9d35
work on CsrQuadraticProblem / CsrFlowDissociation
a-zakir Nov 9, 2023
737b87c
missing include
a-zakir Nov 9, 2023
cc5b442
Update CsrFlowDissociation.h
a-zakir Nov 9, 2023
7d22d33
get rid of old code
a-zakir Nov 9, 2023
b74118a
inline function
a-zakir Nov 9, 2023
a55cd5c
CsrAreaBalance new way & rename
a-zakir Nov 9, 2023
921b322
fix : CsrAreaBalance = Group
a-zakir Nov 9, 2023
690349c
logic issue
a-zakir Nov 9, 2023
a90e7bd
fix doubled NegativeUnsuppliedEnergy
a-zakir Nov 9, 2023
47c92f1
:snake: CsrBindingConstraintHour :boom:
a-zakir Nov 9, 2023
31077ac
method call syntax
a-zakir Nov 9, 2023
34f0aef
remove old logs
a-zakir Nov 10, 2023
7df7f6e
remove old code
a-zakir Nov 10, 2023
473ee98
update QuadraticProblemMatrix
a-zakir Nov 10, 2023
293e87d
remove copy error
a-zakir Nov 10, 2023
5d05312
;
a-zakir Nov 10, 2023
f00844d
unused params
a-zakir Nov 10, 2023
039e180
add return type
a-zakir Nov 10, 2023
1514cec
it's :running:
a-zakir Nov 10, 2023
d632bf3
update
a-zakir Nov 10, 2023
7e49fe6
fix
a-zakir Nov 10, 2023
6154e44
remove old Style Constraint Builder
a-zakir Nov 13, 2023
599e749
ConstraintBuilder is the New ConstraintBuilder
a-zakir Nov 13, 2023
0ed0bee
rename file
a-zakir Nov 13, 2023
072ca6e
rename classes
a-zakir Nov 13, 2023
e98d6f6
keep renaming
a-zakir Nov 13, 2023
7de521b
rename new_exportPaliers
a-zakir Nov 13, 2023
ec4772b
transform shared_ptr data to ref: first try
a-zakir Nov 13, 2023
dde5d3e
FictitiousLoadData as ref
a-zakir Nov 13, 2023
84826d5
shortTermStorageLevelData :floppy_disk:
a-zakir Nov 13, 2023
f267c9a
FlowDissociationData
a-zakir Nov 13, 2023
2922556
BindingConstraintHourData
a-zakir Nov 13, 2023
0079281
bindingConstraintDayData
a-zakir Nov 13, 2023
68ba741
BindingConstraintWeekData
a-zakir Nov 13, 2023
59c0993
HydroPowerData
a-zakir Nov 13, 2023
ca3f587
Min/Max/HydroPowerData
a-zakir Nov 13, 2023
c70a3a0
MaxPumpingData
a-zakir Nov 13, 2023
109b725
AreaHydroLevelData
a-zakir Nov 13, 2023
c4cc825
data as ctor parameter
a-zakir Nov 13, 2023
30c8257
perf issue
a-zakir Nov 13, 2023
389cec5
fix perf issue
a-zakir Nov 13, 2023
e885483
small change
a-zakir Nov 13, 2023
6d2dcd0
updates
a-zakir Nov 13, 2023
d385be6
about FlowDissociationData
a-zakir Nov 13, 2023
6a463a0
optimized loop in bindingConstraintHour
a-zakir Nov 13, 2023
4f07212
remove empty line
a-zakir Nov 13, 2023
fcc3a71
continue refactor
a-zakir Nov 13, 2023
8d84c8e
re-work binding Constraint Week Data
a-zakir Nov 13, 2023
4fd81f8
move HydroPowerData to ctor
a-zakir Nov 13, 2023
b1d4871
set data once for {Min, Max}HydroPower
a-zakir Nov 14, 2023
53b72d8
skip windows & sonar
a-zakir Nov 14, 2023
26449a2
same for MaxPumping
a-zakir Nov 14, 2023
0f39ad4
we're ok AreaHydroLevelGroup
a-zakir Nov 14, 2023
41bf732
ok FinalStockGroup
a-zakir Nov 14, 2023
65fb1fa
fix
a-zakir Nov 14, 2023
16e9f0e
update StartUpCosts Group
a-zakir Nov 14, 2023
924b649
fix constraint index
a-zakir Nov 14, 2023
fc1ccd3
changes
a-zakir Nov 14, 2023
8a6887c
CsrAreaBalance
a-zakir Nov 14, 2023
2c17e51
no shared_ptr of data anymore!
a-zakir Nov 14, 2023
213463d
test MinDownTime elsewhere
a-zakir Nov 14, 2023
c665732
test NbDispUnitsMinBoundSinceMinUpTime out of it's inner loop
a-zakir Nov 14, 2023
7908b15
test NbUnitsOutageLessThanNbUnitsStop out of it's inner loop
a-zakir Nov 14, 2023
61a1c1d
big one
a-zakir Nov 14, 2023
28c7eb1
shared????
a-zakir Nov 14, 2023
8bbd2e9
reactivate w&s
a-zakir Nov 15, 2023
c469974
reshape constraint construction (#1815)
a-zakir Dec 13, 2023
912e3d3
new & newer
a-zakir Dec 13, 2023
4212098
@guilpier-code's remark
a-zakir Dec 15, 2023
a53474a
typo
a-zakir Dec 15, 2023
f2ed940
from PR
a-zakir Dec 15, 2023
8462829
move unrelated jobs from LinearProblemMatrix
a-zakir Dec 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 53 additions & 3 deletions src/solver/optimisation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ set(RTESOLVER_OPT
opt_numero_de_jour_du_pas_de_temps.cpp
opt_construction_variables_optimisees_quadratique.cpp
opt_decompte_variables_et_contraintes.cpp
opt_construction_matrice_des_contraintes_cas_quadratique.cpp
opt_construction_matrice_des_contraintes_cas_lineaire.cpp
opt_construction_matrice_des_contraintes_outils.cpp
opt_gestion_des_bornes_cas_lineaire.cpp
opt_verification_presence_reserve_jmoins1.cpp
Expand All @@ -29,7 +27,6 @@ set(RTESOLVER_OPT
opt_liberation_problemes_simplexe.cpp
opt_restaurer_les_donnees.cpp
opt_gestion_des_couts_cas_quadratique.cpp
opt_construction_contraintes_couts_demarrage.cpp
opt_construction_variables_couts_demarrages.cpp
opt_gestion_des_bornes_couts_demarrage.cpp
opt_gestion_des_couts_couts_demarrage.cpp
Expand Down Expand Up @@ -66,13 +63,22 @@ set(RTESOLVER_OPT
adequacy_patch_csr/csr_quadratic_problem.cpp
adequacy_patch_csr/count_constraints_variables.h
adequacy_patch_csr/count_constraints_variables.cpp
adequacy_patch_csr/constraints/CsrFlowDissociation.h
adequacy_patch_csr/constraints/CsrFlowDissociation.cpp
adequacy_patch_csr/constraints/CsrAreaBalance.h
adequacy_patch_csr/constraints/CsrAreaBalance.cpp
adequacy_patch_csr/constraints/CsrBindingConstraintHour.h
adequacy_patch_csr/constraints/CsrBindingConstraintHour.cpp

opt_period_string_generator_base.h
opt_rename_problem.h
opt_rename_problem.cpp


constraints/ConstraintBuilder.cpp
constraints/ConstraintBuilder.h
constraints/constraint_builder_utils.cpp
constraints/constraint_builder_utils.h
constraints/AreaBalance.h
constraints/AreaBalance.cpp
constraints/FictitiousLoad.h
Expand Down Expand Up @@ -120,6 +126,50 @@ set(RTESOLVER_OPT
constraints/MinDownTime.h
constraints/MinDownTime.cpp

ProblemMatrixEssential.h
ProblemMatrixEssential.cpp
LinearProblemMatrixStartUpCosts.h
LinearProblemMatrixStartUpCosts.cpp
LinearProblemMatrix.h
LinearProblemMatrix.cpp
QuadraticProblemMatrix.h
QuadraticProblemMatrix.cpp
constraints/ConstraintGroup.h
constraints/Group1.h
constraints/Group1.cpp
constraints/BindingConstraintDayGroup.h
constraints/BindingConstraintDayGroup.cpp
constraints/BindingConstraintWeekGroup.h
constraints/BindingConstraintWeekGroup.cpp
constraints/HydroPowerGroup.h
constraints/HydroPowerGroup.cpp
constraints/HydraulicSmoothingGroup.h
constraints/HydraulicSmoothingGroup.cpp
constraints/MinMaxHydroPowerGroup.h
constraints/MinMaxHydroPowerGroup.cpp
constraints/MaxPumpingGroup.h
constraints/MaxPumpingGroup.cpp
constraints/AreaHydroLevelGroup.h
constraints/AreaHydroLevelGroup.cpp
constraints/FinalStockGroup.h
constraints/FinalStockGroup.cpp
constraints/AbstractStartUpCostsGroup.h
constraints/AbstractStartUpCostsGroup.cpp
constraints/PMinMaxDispatchableGenerationGroup.h
constraints/PMinMaxDispatchableGenerationGroup.cpp
constraints/ConsistenceNumberOfDispatchableUnitsGroup.h
constraints/ConsistenceNumberOfDispatchableUnitsGroup.cpp
constraints/NbUnitsOutageLessThanNbUnitsStopGroup.h
constraints/NbUnitsOutageLessThanNbUnitsStopGroup.cpp
constraints/NbDispUnitsMinBoundSinceMinUpTimeGroup.h
constraints/NbDispUnitsMinBoundSinceMinUpTimeGroup.cpp
constraints/MinDownTimeGroup.h
constraints/MinDownTimeGroup.cpp
constraints/ExchangeBalance.h
constraints/ExchangeBalance.cpp
constraints/ExchangeBalanceGroup.h
constraints/ExchangeBalanceGroup.cpp

)


Expand Down
73 changes: 73 additions & 0 deletions src/solver/optimisation/LinearProblemMatrix.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
** Copyright 2007-2023 RTE
** Authors: Antares_Simulator Team
**
** This file is part of Antares_Simulator.
**
** Antares_Simulator is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** There are special exceptions to the terms and conditions of the
** license as they are applied to this software. View the full text of
** the exceptions in file COPYING.txt in the directory of this software
** distribution
**
** Antares_Simulator is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Antares_Simulator. If not, see <http://www.gnu.org/licenses/>.
**
** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions
*/

#include "LinearProblemMatrix.h"
#include "opt_export_structure.h"
#include "antares/solver/utils/filename.h"
#include "opt_fonctions.h"
#include "LinearProblemMatrixStartUpCosts.h"

using namespace Antares::Data;

LinearProblemMatrix::LinearProblemMatrix(PROBLEME_HEBDO* problemeHebdo,
ConstraintBuilder& builder) :
ProblemMatrixEssential(problemeHebdo),
builder_(builder),
group1_(problemeHebdo, builder),
a-zakir marked this conversation as resolved.
Show resolved Hide resolved
bindingConstraintDayGroup_(problemeHebdo, builder),
bindingConstraintWeekGroup_(problemeHebdo, builder),
hydroPowerGroup_(problemeHebdo, builder),
hydraulicSmoothingGroup_(problemeHebdo, builder),
minMaxHydroPowerGroup_(problemeHebdo, builder),
maxPumpingGroup_(problemeHebdo, builder),
areaHydroLevelGroup_(problemeHebdo, builder),
finalStockGroup_(problemeHebdo, builder)
{
constraintgroups_ = {&group1_,
&bindingConstraintDayGroup_,
&bindingConstraintWeekGroup_,
&hydroPowerGroup_,
&hydraulicSmoothingGroup_,
&minMaxHydroPowerGroup_,
&maxPumpingGroup_,
&areaHydroLevelGroup_,
&finalStockGroup_};
}

void LinearProblemMatrix::Run()
a-zakir marked this conversation as resolved.
Show resolved Hide resolved
{
InitializeProblemAResoudreCounters();

ProblemMatrixEssential::Run();
a-zakir marked this conversation as resolved.
Show resolved Hide resolved

if (problemeHebdo_->OptimisationAvecCoutsDeDemarrage)
{
LinearProblemMatrixStartUpCosts(problemeHebdo_, false, builder_).Run();
}

return;
}
63 changes: 63 additions & 0 deletions src/solver/optimisation/LinearProblemMatrix.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
** Copyright 2007-2023 RTE
** Authors: Antares_Simulator Team
**
** This file is part of Antares_Simulator.
**
** Antares_Simulator is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** There are special exceptions to the terms and conditions of the
** license as they are applied to this software. View the full text of
** the exceptions in file COPYING.txt in the directory of this software
** distribution
**
** Antares_Simulator is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Antares_Simulator. If not, see <http://www.gnu.org/licenses/>.
**
** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions
*/
#pragma once
#include "opt_structure_probleme_a_resoudre.h"
#include "sim_structure_probleme_economique.h"
#include "ProblemMatrixEssential.h"
#include "constraints/ConstraintGroup.h"
#include "constraints/Group1.h"
#include "constraints/BindingConstraintDayGroup.h"
#include "constraints/BindingConstraintWeekGroup.h"
#include "constraints/HydroPowerGroup.h"
#include "constraints/HydraulicSmoothingGroup.h"
#include "constraints/MinMaxHydroPowerGroup.h"
#include "constraints/MaxPumpingGroup.h"
#include "constraints/AreaHydroLevelGroup.h"
#include "constraints/FinalStockGroup.h"

#include <antares/study/study.h>

using namespace Antares::Data;
class LinearProblemMatrix : public ProblemMatrixEssential
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should call this class LP_ConstraintGroupList (see review of ProblemMatrixEssential.h)

{
public:
explicit LinearProblemMatrix(PROBLEME_HEBDO* problemeHebdo, ConstraintBuilder& builder);

void Run() override;
Copy link
Contributor

@guilpier-code guilpier-code Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a consequence of ProblemMatrixEssential.h's review, we don't need run() here.


private:
ConstraintBuilder& builder_;
Group1 group1_;
a-zakir marked this conversation as resolved.
Show resolved Hide resolved
BindingConstraintDayGroup bindingConstraintDayGroup_;
BindingConstraintWeekGroup bindingConstraintWeekGroup_;
HydroPowerGroup hydroPowerGroup_;
HydraulicSmoothingGroup hydraulicSmoothingGroup_;
MinMaxHydroPowerGroup minMaxHydroPowerGroup_;
MaxPumpingGroup maxPumpingGroup_;
AreaHydroLevelGroup areaHydroLevelGroup_;
FinalStockGroup finalStockGroup_;
};
47 changes: 47 additions & 0 deletions src/solver/optimisation/LinearProblemMatrixStartUpCosts.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
** Copyright 2007-2023 RTE
** Authors: Antares_Simulator Team
**
** This file is part of Antares_Simulator.
**
** Antares_Simulator is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** There are special exceptions to the terms and conditions of the
** license as they are applied to this software. View the full text of
** the exceptions in file COPYING.txt in the directory of this software
** distribution
**
** Antares_Simulator is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Antares_Simulator. If not, see <http://www.gnu.org/licenses/>.
**
** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions
*/
#pragma once
#include "LinearProblemMatrixStartUpCosts.h"
using namespace Antares::Data;

LinearProblemMatrixStartUpCosts::LinearProblemMatrixStartUpCosts(PROBLEME_HEBDO* problemeHebdo,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review of the associated header file and remove this class.

bool Simulation,
ConstraintBuilder& builder) :
ProblemMatrixEssential(problemeHebdo),
simulation_(Simulation),
pMinMaxDispatchableGenerationGroup_(problemeHebdo, simulation_, builder),
consistenceNumberOfDispatchableUnitsGroup_(problemeHebdo, simulation_, builder),
nbUnitsOutageLessThanNbUnitsStopGroup_(problemeHebdo, simulation_, builder),
nbDispUnitsMinBoundSinceMinUpTimeGroup_(problemeHebdo, simulation_, builder),
minDownTimeGroup_(problemeHebdo, simulation_, builder)
{
constraintgroups_ = {&pMinMaxDispatchableGenerationGroup_,
&consistenceNumberOfDispatchableUnitsGroup_,
&nbUnitsOutageLessThanNbUnitsStopGroup_,
&nbDispUnitsMinBoundSinceMinUpTimeGroup_,
&minDownTimeGroup_};
}
58 changes: 58 additions & 0 deletions src/solver/optimisation/LinearProblemMatrixStartUpCosts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
** Copyright 2007-2023 RTE
** Authors: Antares_Simulator Team
**
** This file is part of Antares_Simulator.
**
** Antares_Simulator is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** There are special exceptions to the terms and conditions of the
** license as they are applied to this software. View the full text of
** the exceptions in file COPYING.txt in the directory of this software
** distribution
**
** Antares_Simulator is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Antares_Simulator. If not, see <http://www.gnu.org/licenses/>.
**
** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions
*/
#pragma once
#include "opt_structure_probleme_a_resoudre.h"
#include "sim_structure_probleme_economique.h"
#include "constraints/ConstraintGroup.h"
#include "ProblemMatrixEssential.h"
#include "opt_structure_probleme_a_resoudre.h"

#include "constraints/PMinMaxDispatchableGenerationGroup.h"
#include "constraints/ConsistenceNumberOfDispatchableUnitsGroup.h"
#include "constraints/NbUnitsOutageLessThanNbUnitsStopGroup.h"
#include "constraints/NbDispUnitsMinBoundSinceMinUpTimeGroup.h"
#include "constraints/MinDownTimeGroup.h"

#include <antares/study/study.h>

using namespace Antares::Data;

class LinearProblemMatrixStartUpCosts : public ProblemMatrixEssential
a-zakir marked this conversation as resolved.
Show resolved Hide resolved
{
public:
explicit LinearProblemMatrixStartUpCosts(PROBLEME_HEBDO* problemeHebdo,
bool Simulation,
ConstraintBuilder& builder);

private:
bool simulation_ = false;
PMinMaxDispatchableGenerationGroup pMinMaxDispatchableGenerationGroup_;
ConsistenceNumberOfDispatchableUnitsGroup consistenceNumberOfDispatchableUnitsGroup_;
NbUnitsOutageLessThanNbUnitsStopGroup nbUnitsOutageLessThanNbUnitsStopGroup_;
NbDispUnitsMinBoundSinceMinUpTimeGroup nbDispUnitsMinBoundSinceMinUpTimeGroup_;
MinDownTimeGroup minDownTimeGroup_;
};
47 changes: 47 additions & 0 deletions src/solver/optimisation/ProblemMatrixEssential.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
** Copyright 2007-2023 RTE
** Authors: Antares_Simulator Team
**
** This file is part of Antares_Simulator.
**
** Antares_Simulator is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** There are special exceptions to the terms and conditions of the
** license as they are applied to this software. View the full text of
** the exceptions in file COPYING.txt in the directory of this software
** distribution
**
** Antares_Simulator is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Antares_Simulator. If not, see <http://www.gnu.org/licenses/>.
**
** SPDX-License-Identifier: licenceRef-GPL3_WITH_RTE-Exceptions
*/
#include "ProblemMatrixEssential.h"

ProblemMatrixEssential::ProblemMatrixEssential(PROBLEME_HEBDO* problemeHebdo) :
problemeHebdo_(problemeHebdo)
{
}

void ProblemMatrixEssential::Run()
{
for (auto& group : constraintgroups_)
{
group->BuildConstraints();
}
}

void ProblemMatrixEssential::InitializeProblemAResoudreCounters()
{
auto& ProblemeAResoudre = problemeHebdo_->ProblemeAResoudre;
ProblemeAResoudre->NombreDeContraintes = 0;
ProblemeAResoudre->NombreDeTermesDansLaMatriceDesContraintes = 0;
}
Loading