Skip to content

Commit

Permalink
Split headers
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Dec 10, 2024
1 parent 2ac26ae commit 9c35c9d
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 59 deletions.
1 change: 1 addition & 0 deletions src/libs/antares/study/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ set(SRC_STUDY_PART_THERMAL
include/antares/study/parts/thermal/ecoInput.h
parts/thermal/ecoInput.cpp
include/antares/study/parts/thermal/cluster.h
include/antares/study/parts/thermal/cost_provider.h
include/antares/study/parts/thermal/cluster.hxx
parts/thermal/cluster.cpp
parts/thermal/scenarized_cost_provider.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#include "../../fwd.h"
#include "../common/cluster.h"
#include "cost_provider.h"
#include "defines.h"
#include "ecoInput.h"
#include "pollutant.h"
Expand Down Expand Up @@ -64,60 +65,6 @@ enum class LocalTSGenerationBehavior
forceNoGen
};

class CostProvider
{
public:
virtual ~CostProvider() = default;
virtual double getOperatingCost(uint serieIndex, uint hourInTheYear) const = 0;
virtual double getMarginalCost(uint serieIndex, uint hourInTheYear) const = 0;
virtual double getMarketBidCost(uint hourInTheYear, uint year) const = 0;
};

class ThermalCluster;

class ConstantCostProvider: public CostProvider
{
public:
explicit ConstantCostProvider(const ThermalCluster& cluster);
virtual ~ConstantCostProvider() = default;
double getOperatingCost(uint serieIndex, uint hourInTheYear) const override;
double getMarginalCost(uint serieIndex, uint hourInTheYear) const override;
double getMarketBidCost(uint hourInTheYear, uint year) const override;

private:
const ThermalCluster& cluster;
};

class ScenarizedCostProvider: public CostProvider
{
public:
explicit ScenarizedCostProvider(const ThermalCluster& cluster);
virtual ~ScenarizedCostProvider() = default;
double getOperatingCost(uint serieIndex, uint hourInTheYear) const override;
double getMarginalCost(uint serieIndex, uint hourInTheYear) const override;
double getMarketBidCost(uint hourInTheYear, uint year) const override;

private:
/*!
** \brief Production Cost, Market Bid Cost and Marginal Cost Matrixes - Per Hour and per Time
*Series
*/
struct CostsTimeSeries
{
std::array<double, HOURS_PER_YEAR> productionCostTs;
std::array<double, HOURS_PER_YEAR> marketBidCostTS;
std::array<double, HOURS_PER_YEAR> marginalCostTS;
};

void resizeCostTS();
void ComputeMarketBidTS();
void MarginalCostEqualsMarketBid();
void ComputeProductionCostTS();

std::vector<CostsTimeSeries> costsTimeSeries;
const ThermalCluster& cluster;
};

double computeMarketBidCost(double fuelCost,
double fuelEfficiency,
double co2EmissionFactor,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* 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 <array>
#include <vector>

namespace Antares::Data
{
class CostProvider
{
public:
virtual ~CostProvider() = default;
virtual double getOperatingCost(uint serieIndex, uint hourInTheYear) const = 0;
virtual double getMarginalCost(uint serieIndex, uint hourInTheYear) const = 0;
virtual double getMarketBidCost(uint hourInTheYear, uint year) const = 0;
};

class ThermalCluster;

class ConstantCostProvider: public CostProvider
{
public:
explicit ConstantCostProvider(const ThermalCluster& cluster);
virtual ~ConstantCostProvider() = default;
double getOperatingCost(uint serieIndex, uint hourInTheYear) const override;
double getMarginalCost(uint serieIndex, uint hourInTheYear) const override;
double getMarketBidCost(uint hourInTheYear, uint year) const override;

private:
const ThermalCluster& cluster;
};

class ScenarizedCostProvider: public CostProvider
{
public:
explicit ScenarizedCostProvider(const ThermalCluster& cluster);
virtual ~ScenarizedCostProvider() = default;
double getOperatingCost(uint serieIndex, uint hourInTheYear) const override;
double getMarginalCost(uint serieIndex, uint hourInTheYear) const override;
double getMarketBidCost(uint hourInTheYear, uint year) const override;

private:
/*!
** \brief Production Cost, Market Bid Cost and Marginal Cost Matrixes - Per Hour and per Time
*Series
*/
struct CostsTimeSeries
{
std::array<double, HOURS_PER_YEAR> productionCostTs;
std::array<double, HOURS_PER_YEAR> marketBidCostTS;
std::array<double, HOURS_PER_YEAR> marginalCostTS;
};

void resizeCostTS();
void ComputeMarketBidTS();
void MarginalCostEqualsMarketBid();
void ComputeProductionCostTS();

std::vector<CostsTimeSeries> costsTimeSeries;
const ThermalCluster& cluster;
};
} // namespace Antares::Data
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@
#ifndef __ANTARES_LIBS_STUDY_PARTS_THERMAL_DEFINES_H__
#define __ANTARES_LIBS_STUDY_PARTS_THERMAL_DEFINES_H__

namespace Antares
{
namespace Data
namespace Antares::Data
{
// Forward declaration
class ThermalCluster;
class ThermalClusterList;
class PreproAvailability;

} // namespace Data
} // namespace Antares
} // namespace Antares::Data

#endif // __ANTARES_LIBS_STUDY_PARTS_THERMAL_DEFINES_H__

0 comments on commit 9c35c9d

Please sign in to comment.