Skip to content

Commit

Permalink
Clang formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
guilpier-code committed Dec 11, 2024
1 parent ab106cc commit 0bfd94c
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 54 deletions.
4 changes: 2 additions & 2 deletions src/libs/antares/exception/LoadingError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ InvalidSolverSpecificParameters::InvalidSolverSpecificParameters(const std::stri
{
}

InvalidStudy::InvalidStudy(const std::string& study) :
LoadingError(std::string("The folder `") + study + "` does not seem to be a valid study")
InvalidStudy::InvalidStudy(const std::string& study):
LoadingError(std::string("The folder `") + study + "` does not seem to be a valid study")
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@

#include "antares/solver/optimisation/adequacy_patch_csr/count_constraints_variables.h"
#include "antares/solver/optimisation/adequacy_patch_csr/csr_quadratic_problem.h"
#include "solve_problem.h"
#include "antares/solver/simulation/adequacy_patch_runtime_data.h"

#include "solve_problem.h"

using namespace Yuni;

namespace Antares::Data::AdequacyPatch
Expand Down
5 changes: 2 additions & 3 deletions src/solver/optimisation/adequacy_patch_csr/solve_problem.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

#pragma once

#include "antares/study/parameters/adq-patch-params.h"

#include "antares/solver/optimisation/opt_structure_probleme_a_resoudre.h"
#include "antares/solver/optimisation/adequacy_patch_csr/hourly_csr_problem.h"
#include "antares/solver/optimisation/opt_structure_probleme_a_resoudre.h"
#include "antares/study/parameters/adq-patch-params.h"

using namespace Antares::Data::AdequacyPatch;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class HourlyCSRProblem
HourlyCSRProblem(const HourlyCSRProblem&) = delete;
HourlyCSRProblem& operator=(const HourlyCSRProblem&) = delete;


inline void setHour(int hour)
{
triggeredHour = hour;
Expand Down Expand Up @@ -124,6 +123,7 @@ class HourlyCSRProblem
// Costs
void setQuadraticCost();
void setLinearCost();

public:
// TODO [gp] : try to make these members private
double belowThisThresholdSetToZero;
Expand All @@ -145,7 +145,6 @@ class HourlyCSRProblem

std::map<int, double> rhsAreaBalanceValues;


// links between two areas inside the adq-patch domain
std::map<int, LinkVariable> linkInsideAdqPatch;
};
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ class UpdateMrgPriceAfterCSRcmd: public basePostProcessCommand
class DTGnettingAfterCSRcmd: public basePostProcessCommand
{
public:
DTGnettingAfterCSRcmd(PROBLEME_HEBDO* problemeHebdo,
AreaList& areas,
unsigned int numSpace);
DTGnettingAfterCSRcmd(PROBLEME_HEBDO* problemeHebdo, AreaList& areas, unsigned int numSpace);
void execute(const optRuntimeData&) override;

private:
Expand Down
2 changes: 1 addition & 1 deletion src/solver/optimisation/opt_appel_solveur_lineaire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static SimplexResult OPT_TryToCallSimplex(const OptimizationOptions& options,
solver = ORTOOLS_Simplexe(&Probleme, solver, keepBasis, options);
if (solver != nullptr)
{
ProblemeAResoudre->ProblemesSpx[NumIntervalle] = (void*)solver;
ProblemeAResoudre->ProblemesSpx[NumIntervalle] = (void*)solver;
}

measure.tick();
Expand Down
53 changes: 27 additions & 26 deletions src/solver/variable/include/antares/solver/variable/economy/all.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@
#include "pumping.h"
#include "renewableGeneration.h"
#include "reservoirlevel.h"
#include "spilledEnergy.h"
#include "thermalAirPollutantEmissions.h"
#include "unsupliedEnergy.h"
#include "unsupliedEnergyCsr.h"
#include "waterValue.h"
#include "spilledEnergy.h"

// By thermal plant
#include "nbOfDispatchedUnitsByPlant.h"
Expand Down Expand Up @@ -125,31 +125,32 @@ typedef // Prices
<Overflows // Hydraulic overflows
<WaterValue // Water values
<HydroCost // Hydro costs
<STSbyGroup<
STstorageInjectionByCluster<STstorageWithdrawalByCluster<
STstorageLevelsByCluster<STstorageCashFlowByCluster<
UnsupliedEnergy // Unsuplied Energy
<UnsupliedEnergyCSR // Unsupplied energy CSR
<DomesticUnsuppliedEnergy // Domestic Unsupplied Energy
<LMRViolations // LMR Violations
<SpilledEnergy // Spilled Energy
<LOLD // LOLD
<LOLD_CSR<
LOLP // LOLP
<LOLP_CSR<AvailableDispatchGen<DispatchableGenMargin<
DtgMarginCsr // DTG MRG CSR
<Marge<MaxMrgCsr<NonProportionalCost<
NonProportionalCostByDispatchablePlant // Startup cost +
// Fixed cost per
// thermal plant
// detail
<NbOfDispatchedUnits // Number of Units Dispatched
<NbOfDispatchedUnitsByPlant // Number of Units Dispatched
// by plant
<ProfitByPlant
// Links
<Variable::Economy::Links // All links
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<STSbyGroup<STstorageInjectionByCluster<STstorageWithdrawalByCluster<
STstorageLevelsByCluster<STstorageCashFlowByCluster<
UnsupliedEnergy // Unsuplied Energy
<UnsupliedEnergyCSR // Unsupplied energy CSR
<DomesticUnsuppliedEnergy // Domestic Unsupplied Energy
<LMRViolations // LMR Violations
<SpilledEnergy // Spilled Energy
<LOLD // LOLD
<LOLD_CSR<LOLP // LOLP
<LOLP_CSR<AvailableDispatchGen<DispatchableGenMargin<
DtgMarginCsr // DTG MRG CSR
<Marge<MaxMrgCsr<NonProportionalCost<
NonProportionalCostByDispatchablePlant // Startup
// cost +
// Fixed cost
// per
// thermal
// plant
// detail
<NbOfDispatchedUnits // Number of Units Dispatched
<NbOfDispatchedUnitsByPlant // Number of Units
// Dispatched by plant
<ProfitByPlant
// Links
<Variable::Economy::Links // All links
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
VariablesPerArea;

/*!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ struct VCardLOLD_CSR
>>>>>
ResultsType;

static constexpr uint8_t categoryDataLevel
= Category::DataLevel::area;
static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
& (Category::FileLevel::id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ struct VCardLOLP_CSR
//! The VCard to look for for calculating spatial aggregates
typedef VCardLOLP_CSR VCardForSpatialAggregate;

static constexpr uint8_t categoryDataLevel
= Category::DataLevel::area;
static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
& (Category::FileLevel::id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ struct VCardMAX_MRG_CSR
//! The VCard to look for for calculating spatial aggregates
typedef VCardMAX_MRG_CSR VCardForSpatialAggregate;

static constexpr uint8_t categoryDataLevel
= Category::DataLevel::area;
static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
& (Category::FileLevel::id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#pragma once

#include "../state.h"
#include <antares/series/series.h>

#include "../state.h"

namespace Antares::Solver::Variable::Economy
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ struct VCardOverallCostCsr
//! The VCard to look for for calculating spatial aggregates
typedef VCardOverallCostCsr VCardForSpatialAggregate;

static constexpr uint8_t categoryDataLevel
= Category::DataLevel::area;
static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
& (Category::FileLevel::id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ struct VCardUnsupliedEnergyCSR

//! The VCard to look for for calculating spatial aggregates
typedef VCardUnsupliedEnergyCSR VCardForSpatialAggregate;
static constexpr uint8_t categoryDataLevel
= Category::DataLevel::area;
static constexpr uint8_t categoryDataLevel = Category::DataLevel::area;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = ResultsType::categoryFile
& (Category::FileLevel::id
Expand Down
9 changes: 5 additions & 4 deletions src/solver/variable/max-mrg-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ void computeMaxMRG(double* maxMrgOut, const MaxMRGinput& in)
assert(h < HOURS_PER_YEAR && "calendar overflow");
if (niveau > OI[h])
{
maxMrgOut[h] = Math::Min(
niveau,
OI[h] + in.maxHourlyGenPower->getCoefficient(in.year, h + in.hourInYear)
- in.hydroGeneration[h]);
maxMrgOut[h] = Math::Min(niveau,
OI[h]
+ in.maxHourlyGenPower->getCoefficient(in.year,
h + in.hourInYear)
- in.hydroGeneration[h]);
SM += maxMrgOut[h] - OI[h];
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,4 +401,3 @@ BOOST_AUTO_TEST_CASE(check_adq_param_wrong_hurdle_cost)
auto p = createParams();
BOOST_CHECK_THROW(p.checkAdqPatchIncludeHurdleCost(false), Error::IncompatibleHurdleCostCSR);
}

0 comments on commit 0bfd94c

Please sign in to comment.