pub struct DispatchRun<'model, 'run> {
model: &'model Model,
existing_assets: &'run [AssetRef],
flexible_capacity_assets: &'run [AssetRef],
candidate_assets: &'run [AssetRef],
markets_to_balance: &'run [(CommodityID, RegionID)],
input_prices: Option<&'run CommodityPrices>,
year: u32,
capacity_margin: f64,
}Expand description
Provides the interface for running the dispatch optimisation.
The run will attempt to meet unmet demand: if the solver reports infeasibility the implementation will rerun including unmet-demand variables to identify offending markets and provide a clearer error message.
For a detailed description, please see the dispatch optimisation formulation.
Fields§
§model: &'model Model§existing_assets: &'run [AssetRef]§flexible_capacity_assets: &'run [AssetRef]§candidate_assets: &'run [AssetRef]§markets_to_balance: &'run [(CommodityID, RegionID)]§input_prices: Option<&'run CommodityPrices>§year: u32§capacity_margin: f64Implementations§
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_flexible_capacity_assets(
self,
flexible_capacity_assets: &'run [AssetRef],
capacity_margin: f64,
) -> Self
pub fn with_flexible_capacity_assets( self, flexible_capacity_assets: &'run [AssetRef], capacity_margin: f64, ) -> Self
Include the specified flexible capacity assets in the dispatch run
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_market_balance_subset(
self,
markets_to_balance: &'run [(CommodityID, RegionID)],
) -> Self
pub fn with_market_balance_subset( self, markets_to_balance: &'run [(CommodityID, RegionID)], ) -> Self
Only apply commodity balance constraints to the specified subset of markets
Sourcepub fn with_input_prices(self, input_prices: &'run CommodityPrices) -> Self
pub fn with_input_prices(self, input_prices: &'run CommodityPrices) -> 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_without_unmet_demand_variables(
&self,
markets_to_balance: &[(CommodityID, RegionID)],
input_prices: Option<&CommodityPrices>,
) -> Result<Solution<'model>, ModelError>
fn run_without_unmet_demand_variables( &self, markets_to_balance: &[(CommodityID, RegionID)], input_prices: Option<&CommodityPrices>, ) -> Result<Solution<'model>, ModelError>
Run dispatch without unmet demand variables
Sourcefn run_internal(
&self,
markets_to_balance: &[(CommodityID, RegionID)],
allow_unmet_demand: bool,
input_prices: Option<&CommodityPrices>,
) -> Result<Solution<'model>, ModelError>
fn run_internal( &self, markets_to_balance: &[(CommodityID, RegionID)], allow_unmet_demand: bool, input_prices: Option<&CommodityPrices>, ) -> Result<Solution<'model>, ModelError>
Run dispatch to balance the specified markets, optionally including unmet demand variables
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
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