-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add NetPosition constraint & variable
- Loading branch information
Showing
10 changed files
with
142 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
** Copyright 2007-2024, RTE (https://www.rte-france.com) | ||
** See AUTHORS.txt | ||
** SPDX-License-Identifier: MPL-2.0 | ||
** This file is part of Antares-Simulator, | ||
** Adequacy and Performance assessment for interconnected energy networks. | ||
** | ||
** Antares_Simulator is free software: you can redistribute it and/or modify | ||
** it under the terms of the Mozilla Public Licence 2.0 as published by | ||
** the Mozilla Foundation, either version 2 of the License, or | ||
** (at your option) any later version. | ||
** | ||
** 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 | ||
** Mozilla Public Licence 2.0 for more details. | ||
** | ||
** You should have received a copy of the Mozilla Public Licence 2.0 | ||
** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>. | ||
*/ | ||
|
||
#include "antares/solver/optimisation/constraints/NetPosition.h" | ||
|
||
void NetPosition::add(int pdt, int pays) | ||
{ | ||
int interco = data.IndexDebutIntercoOrigine[pays]; | ||
while (interco >= 0) | ||
{ | ||
builder.NTCDirect(interco, 1.0); | ||
interco = data.IndexSuivantIntercoOrigine[interco]; | ||
} | ||
|
||
interco = data.IndexDebutIntercoExtremite[pays]; | ||
while (interco >= 0) | ||
{ | ||
builder.NTCDirect(interco, -1.0); | ||
interco = data.IndexSuivantIntercoExtremite[interco]; | ||
} | ||
|
||
ConstraintNamer namer(builder.data.NomDesContraintes); | ||
namer.UpdateTimeStep(builder.data.weekInTheYear * 168 + pdt); | ||
namer.UpdateArea(builder.data.NomsDesPays[pays]); | ||
namer.NetPosition(builder.data.nombreDeContraintes); | ||
|
||
builder.NetPosition(pays, 1.0); | ||
builder.equalTo().build(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/solver/optimisation/include/antares/solver/optimisation/constraints/NetPosition.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
** Copyright 2007-2024, RTE (https://www.rte-france.com) | ||
** See AUTHORS.txt | ||
** SPDX-License-Identifier: MPL-2.0 | ||
** This file is part of Antares-Simulator, | ||
** Adequacy and Performance assessment for interconnected energy networks. | ||
** | ||
** Antares_Simulator is free software: you can redistribute it and/or modify | ||
** it under the terms of the Mozilla Public Licence 2.0 as published by | ||
** the Mozilla Foundation, either version 2 of the License, or | ||
** (at your option) any later version. | ||
** | ||
** 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 | ||
** Mozilla Public Licence 2.0 for more details. | ||
** | ||
** You should have received a copy of the Mozilla Public Licence 2.0 | ||
** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>. | ||
*/ | ||
#pragma once | ||
#include "ConstraintBuilder.h" | ||
|
||
struct NetPositionData | ||
{ | ||
std::vector<CORRESPONDANCES_DES_CONTRAINTES>& CorrespondanceCntNativesCntOptim; | ||
const std::vector<int>& IndexDebutIntercoOrigine; | ||
const std::vector<int>& IndexSuivantIntercoOrigine; | ||
const std::vector<int>& IndexDebutIntercoExtremite; | ||
const std::vector<int>& IndexSuivantIntercoExtremite; | ||
}; | ||
|
||
/*! | ||
* represent 'Net Position' constraint type | ||
*/ | ||
|
||
class NetPosition: public ConstraintFactory | ||
{ | ||
public: | ||
NetPosition(ConstraintBuilder& builder, NetPositionData& data): | ||
ConstraintFactory(builder), | ||
data(data) | ||
{ | ||
} | ||
|
||
/*! | ||
* @brief Add variables to the constraint and update constraints Matrix | ||
* @param pdt : timestep | ||
* @param pays : area | ||
*/ | ||
|
||
void add(int pdt, int pays); | ||
|
||
private: | ||
NetPositionData& data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters