Skip to content

Commit

Permalink
Try so specialize vcard in spatial aggregate
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Feb 10, 2025
1 parent f06d849 commit 3440a96
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,78 @@ struct MultipleCaptionProxy<Category::dynamicColumns, VCardT>
}
};

template<template<class> class V>
struct VCardProxyDynamic
{
//! The real VCard for the variable
typedef typename V<Container::EndOfList>::VCardType VCardOrigin;

//! Caption
static std::string Caption()
{
return VCardOrigin::Caption();
}

//! Unit
static std::string Unit()
{
return VCardOrigin::Unit();
}

//! The short description of the variable
static std::string Description()
{
return VCardOrigin::Description();
}

//! The expecte results
typedef typename VCardOrigin::ResultsType ResultsType;
//! The VCard to look for for calculating spatial aggregates
typedef typename VCardOrigin::VCardForSpatialAggregate VCardForSpatialAggregate;

typedef typename VCardOrigin::IntermediateValuesType IntermediateValuesType;
typedef typename VCardOrigin::IntermediateValuesBaseType IntermediateValuesBaseType;
typedef
typename VCardOrigin::IntermediateValuesTypeForSpatialAg IntermediateValuesTypeForSpatialAg;

//! Data Level
static constexpr uint8_t categoryDataLevel = Category::DataLevel::setOfAreas;
//! File level (provided by the type of the results)
static constexpr uint8_t categoryFileLevel = VCardOrigin::categoryFileLevel;
//! Precision (views)
static constexpr uint8_t precision = VCardOrigin::precision;
//! Indentation (GUI)
static constexpr uint8_t nodeDepthForGUI = +0;
//! Decimal precision
static constexpr uint8_t decimal = VCardOrigin::decimal;
//! Number of columns used by the variable (One ResultsType per column)
static constexpr int columnCount = VCardOrigin::dynamicColumns;
//! The Spatial aggregation
static constexpr uint8_t spatialAggregate = Category::noSpatialAggregate;
static constexpr uint8_t spatialAggregateMode = Category::spatialAggregateEachYear;
static constexpr uint8_t spatialAggregatePostProcessing = 0;

//! Intermediate values
static constexpr uint8_t hasIntermediateValues = 1;
//! Can this variable be non applicable (0 : no, 1 : yes)
static constexpr uint8_t isPossiblyNonApplicable = VCardOrigin::isPossiblyNonApplicable;

struct Multiple
{
static std::string Caption(const uint indx)
{
return MultipleCaptionProxy<columnCount, VCardOrigin>::Caption(indx);
}

static std::string Unit(const unsigned int indx)
{
return MultipleCaptionProxy<columnCount, VCardOrigin>::Unit(indx);
}
};

}; // class VCard


template<template<class> class V>
struct VCardProxy
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ typedef // Prices
Common::SpatialAggregate<
TimeSeriesValuesSolar,
// Other
Common::SpatialAggregate<
DispatchableGeneration,
Common::SpatialAggregate<
HydroStorage,
Common::SpatialAggregate<
Expand Down Expand Up @@ -240,7 +242,7 @@ typedef // Prices
// -
// refs:
// #55
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
VariablesPerSetOfAreas;

typedef BindingConstMarginCost< // Marginal cost for a binding constraint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ struct VCardDispatchableGeneration
typedef IntermediateValues IntermediateValuesDeepType;
typedef std::vector<IntermediateValues> IntermediateValuesBaseType;
typedef std::vector<IntermediateValuesBaseType> IntermediateValuesType;
typedef IntermediateValuesBaseType* IntermediateValuesTypeForSpatialAg;

}; // class VCard

Expand Down Expand Up @@ -124,6 +125,13 @@ class DispatchableGeneration
};
};

template<class U>
static void InitializeAndReset(U& out, Data::Study& study)
{
out.initializeFromStudy(study);
out.reset();
}

void initializeFromArea(Data::Study* study, Data::Area* area)
{
pNbYearsParallel = study->maxNbYearsInParallel;
Expand Down

0 comments on commit 3440a96

Please sign in to comment.