pub struct ActivityLimits {
annual_limit: Option<RangeInclusive<Dimensionless>>,
seasonal_limits: IndexMap<Season, RangeInclusive<Dimensionless>>,
time_slice_limits: IndexMap<TimeSliceID, RangeInclusive<Dimensionless>>,
}Expand description
Defines the activity limits for a process in a given region and year
Activity limits represent the minimum and maximum fraction of the potential annual activity that
can be undertaken in each time slice, season, or the year as a whole. The limits stored and
returned by this struct are dimensionless; to convert to actual activity limits for an asset,
multiply by the capacity to activity factor of the process and the installed capacity of the
asset. In other words, the limits stored and returned by this struct are the absolute limits on
activity per 1/capacity_to_activity units of capacity.
All time slices must have an entry in self.time_slice_limits. If no specific availability limit
is provided for a time slice, this will just represent the length of the time slice as a
fraction of the year. Seasonal and annual limits may be stored if provided by the user, and only
if they provide an extra level of constraint on top of the time slice limits.
Limits can be retrieved in three ways:
- Retrieve the limit for a specific time slice using
get_limit_for_time_slice(). - Retrieve a limit for a specific time slice selection (time slice, season, or annual)
using
get_limit(). - Retrieve all limits as an iterator using
iter_limits(). Note: individual limits within this iterator cannot be relied upon, but the totality of these limits can be used to construct a set of constraints that ensures that all limits are respected.
Fields§
§annual_limit: Option<RangeInclusive<Dimensionless>>Optional annual limit
seasonal_limits: IndexMap<Season, RangeInclusive<Dimensionless>>Optional limits for each season
time_slice_limits: IndexMap<TimeSliceID, RangeInclusive<Dimensionless>>Limits for each time slice (mandatory for all time slices)
Implementations§
Source§impl ActivityLimits
impl ActivityLimits
Sourcepub fn new_with_full_availability(time_slice_info: &TimeSliceInfo) -> Self
pub fn new_with_full_availability(time_slice_info: &TimeSliceInfo) -> Self
Create a new ActivityLimits with full availability for all time slices
Sourcepub fn new_from_limits(
limits: &HashMap<TimeSliceSelection, RangeInclusive<Dimensionless>>,
time_slice_info: &TimeSliceInfo,
) -> Result<Self>
pub fn new_from_limits( limits: &HashMap<TimeSliceSelection, RangeInclusive<Dimensionless>>, time_slice_info: &TimeSliceInfo, ) -> Result<Self>
Create a new ActivityLimits from a map of limits for time slice selections
The limits provided here may be for individual time slices, seasons, or the entire year.
Provided limits must reflect the fraction of potential annual activity available in the
given time slice selection. In other words, these are the absolute limits on activity per
1/capacity_to_activity units of capacity.
It is not mandatory to provide any limits; if no limits are provided, full availability will be assumed for all time slices (limited only by time slice lengths). However, if limits are provided for any individual time slices, they must be provided for ALL time slices. Similarly, if limits are provided for any seasons, they must be provided for ALL seasons.
No calculations are done here to account for time slice lengths; this must be handled by the user when providing the limits. For example, a limit of 0..=0.1 for a time slice indicates that 10% of the potential annual activity can be undertaken in that time slice. If the time slice is 10% of the year, then this provides no additional constraint.
Checks are done to ensure that provided limits are compatible with each other. For example, a limit of “..0.01” for “winter” would be incompatible with a limit of “0.2..” for “winter.day” (i.e. if activity must be >0.2 in “winter.night”, then if cannot possibly be ≤0.01 in winter as a whole).
Sourcepub fn add_time_slice_limit(
&mut self,
ts_id: TimeSliceID,
limit: RangeInclusive<Dimensionless>,
)
pub fn add_time_slice_limit( &mut self, ts_id: TimeSliceID, limit: RangeInclusive<Dimensionless>, )
Add a limit for a specific time slice
Sourcefn add_seasonal_limit(
&mut self,
season: Season,
limit: RangeInclusive<Dimensionless>,
) -> Result<()>
fn add_seasonal_limit( &mut self, season: Season, limit: RangeInclusive<Dimensionless>, ) -> Result<()>
Add a limit for a specific season
Sourcefn add_annual_limit(
&mut self,
limit: RangeInclusive<Dimensionless>,
) -> Result<()>
fn add_annual_limit( &mut self, limit: RangeInclusive<Dimensionless>, ) -> Result<()>
Add an annual limit
Sourcepub fn get_limit(
&self,
time_slice_selection: &TimeSliceSelection,
) -> RangeInclusive<Dimensionless>
pub fn get_limit( &self, time_slice_selection: &TimeSliceSelection, ) -> RangeInclusive<Dimensionless>
Get the limit for a given time slice selection
Sourcepub fn get_limit_for_time_slice(
&self,
time_slice: &TimeSliceID,
) -> RangeInclusive<Dimensionless>
pub fn get_limit_for_time_slice( &self, time_slice: &TimeSliceID, ) -> RangeInclusive<Dimensionless>
Get the limit for a given time slice
Sourcefn get_limit_for_season(&self, season: &Season) -> RangeInclusive<Dimensionless>
fn get_limit_for_season(&self, season: &Season) -> RangeInclusive<Dimensionless>
Get the limit for a given season
Sourcefn get_limit_for_year(&self) -> RangeInclusive<Dimensionless>
fn get_limit_for_year(&self) -> RangeInclusive<Dimensionless>
Get the limit for the entire year
Sourcepub fn iter_limits(
&self,
) -> impl Iterator<Item = (TimeSliceSelection, &RangeInclusive<Dimensionless>)>
pub fn iter_limits( &self, ) -> impl Iterator<Item = (TimeSliceSelection, &RangeInclusive<Dimensionless>)>
Iterate over all limits
This first iterates over all individual timeslice limits, followed by seasonal limits (if any), and finally the annual limit (if any).
Trait Implementations§
Source§impl Clone for ActivityLimits
impl Clone for ActivityLimits
Source§fn clone(&self) -> ActivityLimits
fn clone(&self) -> ActivityLimits
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ActivityLimits
impl Debug for ActivityLimits
Source§impl PartialEq for ActivityLimits
impl PartialEq for ActivityLimits
impl StructuralPartialEq for ActivityLimits
Auto Trait Implementations§
impl Freeze for ActivityLimits
impl RefUnwindSafe for ActivityLimits
impl !Send for ActivityLimits
impl !Sync for ActivityLimits
impl Unpin for ActivityLimits
impl UnwindSafe for ActivityLimits
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more