pub struct AssetRef(Rc<Asset>);
Expand description
Tuple Fields§
§0: Rc<Asset>
Implementations§
Methods from Deref<Target = Asset>§
Sourcepub fn state(&self) -> &AssetState
pub fn state(&self) -> &AssetState
Get the state of this asset
Sourcepub fn process_parameter(&self) -> &ProcessParameter
pub fn process_parameter(&self) -> &ProcessParameter
The process parameter for this asset
Sourcepub fn max_decommission_year(&self) -> u32
pub fn max_decommission_year(&self) -> u32
The last year in which this asset should be decommissioned
Sourcepub fn get_activity_limits(
&self,
time_slice: &TimeSliceID,
) -> RangeInclusive<Activity>
pub fn get_activity_limits( &self, time_slice: &TimeSliceID, ) -> RangeInclusive<Activity>
Get the activity limits for this asset in a particular time slice
Sourcepub fn get_activity_per_capacity_limits(
&self,
time_slice: &TimeSliceID,
) -> RangeInclusive<ActivityPerCapacity>
pub fn get_activity_per_capacity_limits( &self, time_slice: &TimeSliceID, ) -> RangeInclusive<ActivityPerCapacity>
Get the activity limits per unit of capacity for this asset in a particular time slice
Sourcepub fn get_operating_cost(
&self,
year: u32,
time_slice: &TimeSliceID,
) -> MoneyPerActivity
pub fn get_operating_cost( &self, year: u32, time_slice: &TimeSliceID, ) -> MoneyPerActivity
Get the operating cost for this asset in a given year and time slice
Sourcepub fn get_input_cost_from_prices(
&self,
input_prices: &HashMap<(CommodityID, RegionID, TimeSliceID), MoneyPerFlow>,
time_slice: &TimeSliceID,
) -> MoneyPerActivity
pub fn get_input_cost_from_prices( &self, input_prices: &HashMap<(CommodityID, RegionID, TimeSliceID), MoneyPerFlow>, time_slice: &TimeSliceID, ) -> MoneyPerActivity
Get the cost of input flows using the commodity prices in input_prices
Sourcepub fn max_activity(&self) -> Activity
pub fn max_activity(&self) -> Activity
Maximum activity for this asset
Sourcepub fn get_flow(&self, commodity_id: &CommodityID) -> Option<&ProcessFlow>
pub fn get_flow(&self, commodity_id: &CommodityID) -> Option<&ProcessFlow>
Get a specific process flow
Sourcefn get_flows_map(&self) -> &IndexMap<CommodityID, ProcessFlow>
fn get_flows_map(&self) -> &IndexMap<CommodityID, ProcessFlow>
Get the process flows map for this asset
Sourcepub fn iter_flows(&self) -> impl Iterator<Item = &ProcessFlow>
pub fn iter_flows(&self) -> impl Iterator<Item = &ProcessFlow>
Iterate over the asset’s flows
Sourcepub fn primary_output(&self) -> Option<&ProcessFlow>
pub fn primary_output(&self) -> Option<&ProcessFlow>
Get the primary output flow (if any) for this asset
Sourcepub fn is_commissioned(&self) -> bool
pub fn is_commissioned(&self) -> bool
Whether this asset has been commissioned
Sourcepub fn commission_year(&self) -> u32
pub fn commission_year(&self) -> u32
Get the commission year for this asset
Sourcepub fn decommission_year(&self) -> Option<u32>
pub fn decommission_year(&self) -> Option<u32>
Get the decommission year for this asset
Sourcepub fn process_id(&self) -> &ProcessID
pub fn process_id(&self) -> &ProcessID
Get the process ID for this asset
Sourcepub fn as_candidate(&self, capacity: Option<Capacity>) -> Asset
pub fn as_candidate(&self, capacity: Option<Capacity>) -> Asset
Creates a Candidate asset matching a given Commissioned asset
Optionally, the capacity can be set to a different value.
Trait Implementations§
Source§impl Hash for AssetRef
impl Hash for AssetRef
Source§fn hash<H: Hasher>(&self, state: &mut H)
fn hash<H: Hasher>(&self, state: &mut H)
Hash an asset according to its state:
- Commissioned assets are hashed based on their ID alone
- Selected assets are hashed based on process_id, region_id, commission_year and agent_id
- Candidate assets are hashed based on process_id, region_id and commission_year
- Future and Decommissioned assets cannot currently be hashed
Source§impl Ord for AssetRef
impl Ord for AssetRef
Source§impl PartialOrd for AssetRef
impl PartialOrd for AssetRef
impl Eq for AssetRef
Auto Trait Implementations§
impl Freeze for AssetRef
impl RefUnwindSafe for AssetRef
impl !Send for AssetRef
impl !Sync for AssetRef
impl Unpin for AssetRef
impl UnwindSafe for AssetRef
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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