pub struct DispatchRun<'model, 'run> {
model: &'model Model,
existing_assets: &'run [AssetRef],
candidate_assets: &'run [AssetRef],
commodities: &'run [CommodityID],
input_prices: Option<&'run HashMap<(CommodityID, RegionID, TimeSliceID), MoneyPerFlow>>,
year: u32,
}
Expand description
Provides the interface for running the dispatch optimisation.
For a detailed description, please see the dispatch optimisation formulation.
Fields§
§model: &'model Model
§existing_assets: &'run [AssetRef]
§candidate_assets: &'run [AssetRef]
§commodities: &'run [CommodityID]
§input_prices: Option<&'run HashMap<(CommodityID, RegionID, TimeSliceID), MoneyPerFlow>>
§year: u32
Implementations§
Source§impl<'model, 'run> DispatchRun<'model, 'run>
impl<'model, 'run> DispatchRun<'model, 'run>
Sourcepub fn new(model: &'model Model, assets: &'run [AssetRef], year: u32) -> Self
pub fn new(model: &'model Model, assets: &'run [AssetRef], year: u32) -> Self
Create a new DispatchRun
for the specified model and assets for a given year
Sourcepub fn with_candidates(self, candidate_assets: &'run [AssetRef]) -> Self
pub fn with_candidates(self, candidate_assets: &'run [AssetRef]) -> Self
Include the specified candidate assets in the dispatch run
Sourcepub fn with_commodity_subset(self, commodities: &'run [CommodityID]) -> Self
pub fn with_commodity_subset(self, commodities: &'run [CommodityID]) -> Self
Only apply commodity balance constraints to the specified subset of commodities
Sourcepub fn with_input_prices(
self,
input_prices: &'run HashMap<(CommodityID, RegionID, TimeSliceID), MoneyPerFlow>,
) -> Self
pub fn with_input_prices( self, input_prices: &'run HashMap<(CommodityID, RegionID, TimeSliceID), MoneyPerFlow>, ) -> Self
Explicitly provide prices for certain input commodities
Sourcepub fn run(
self,
run_description: &str,
writer: &mut DataWriter,
) -> Result<Solution<'model>>
pub fn run( self, run_description: &str, writer: &mut DataWriter, ) -> Result<Solution<'model>>
Sourcefn run_no_save(&self) -> Result<Solution<'model>>
fn run_no_save(&self) -> Result<Solution<'model>>
Run dispatch without saving the results.
This is an internal function as callers always want to save results.
Auto Trait Implementations§
impl<'model, 'run> Freeze for DispatchRun<'model, 'run>
impl<'model, 'run> RefUnwindSafe for DispatchRun<'model, 'run>
impl<'model, 'run> !Send for DispatchRun<'model, 'run>
impl<'model, 'run> !Sync for DispatchRun<'model, 'run>
impl<'model, 'run> Unpin for DispatchRun<'model, 'run>
impl<'model, 'run> UnwindSafe for DispatchRun<'model, 'run>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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