Skip to content

Commit

Permalink
add scenario length & number to repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Milos-RTEi committed Nov 3, 2023
1 parent af0c5e4 commit b22f448
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ void Data::MaintenanceGroupRepository::clear()
{
maintenanceGroups_.clear();
activeMaintenanceGroups_.reset();
scenariosLength_ = 0;
scenariosNumber_ =0;
}

namespace Antares::Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,31 @@ class MaintenanceGroupRepository final : public Yuni::NonCopyable<MaintenanceGro

[[nodiscard]] std::vector<std::shared_ptr<MaintenanceGroup>> activeMaintenanceGroups() const;

/*!
** \brief The scenarios number and length
**
** \return Get the scenarios number and length
*/
uint scenariosNumber() const;
uint scenariosLength() const;

/*!
** \brief Set the scenarios number and length
*/
void scenariosNumber(uint num);
void scenariosLength(uint l);

private:

// number and length of the Maintenance Group-s scenarios
uint scenariosNumber_ = 0;
uint scenariosLength_ = 0;

// private methods
bool internalSaveToFolder(Data::MaintenanceGroupSaver::EnvForSaving& env) const;

//! All Maintenance Group-s
Data::MaintenanceGroupRepository::Vector maintenanceGroups_;

mutable std::optional<std::vector<std::shared_ptr<MaintenanceGroup>>> activeMaintenanceGroups_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ inline bool MaintenanceGroupRepository::empty() const
return maintenanceGroups_.empty();
}

inline uint MaintenanceGroupRepository::scenariosNumber() const
{
return scenariosNumber_;
}

inline void MaintenanceGroupRepository::scenariosNumber(uint num)
{
scenariosNumber_ = num;
}

inline uint MaintenanceGroupRepository::scenariosLength() const
{
return scenariosLength_;
}

inline void MaintenanceGroupRepository::scenariosLength(uint l)
{
scenariosLength_ = l;
}

template<class PredicateT>
inline void MaintenanceGroupRepository::each(const PredicateT& predicate)
{
Expand Down

0 comments on commit b22f448

Please sign in to comment.