pub struct DataWriter {
assets_writer: Writer<File>,
flows_writer: Writer<File>,
prices_writer: Writer<File>,
debug_writer: Option<DebugDataWriter>,
}
Expand description
An object for writing commodity prices to file
Fields§
§assets_writer: Writer<File>
§flows_writer: Writer<File>
§prices_writer: Writer<File>
§debug_writer: Option<DebugDataWriter>
Implementations§
Source§impl DataWriter
impl DataWriter
Sourcepub fn create(
output_path: &Path,
model_path: &Path,
save_debug_info: bool,
) -> Result<Self>
pub fn create( output_path: &Path, model_path: &Path, save_debug_info: bool, ) -> Result<Self>
Open CSV files to write output data to
§Arguments
output_path
- Folder where files will be savedmodel_path
- Path to input modelsave_debug_info
- Whether to include extra CSV files for debugging model
Sourcepub fn write(
&mut self,
milestone_year: u32,
solution: &Solution<'_>,
assets: &AssetPool,
flow_map: &FlowMap,
prices: &CommodityPrices,
) -> Result<()>
pub fn write( &mut self, milestone_year: u32, solution: &Solution<'_>, assets: &AssetPool, flow_map: &FlowMap, prices: &CommodityPrices, ) -> Result<()>
Write information to various output CSV files
Sourcefn write_assets<'a, I>(&mut self, milestone_year: u32, assets: I) -> Result<()>
fn write_assets<'a, I>(&mut self, milestone_year: u32, assets: I) -> Result<()>
Write assets to a CSV file
Sourcefn write_flows(&mut self, milestone_year: u32, flow_map: &FlowMap) -> Result<()>
fn write_flows(&mut self, milestone_year: u32, flow_map: &FlowMap) -> Result<()>
Write commodity flows to a CSV file
Sourcefn write_prices(
&mut self,
milestone_year: u32,
prices: &CommodityPrices,
) -> Result<()>
fn write_prices( &mut self, milestone_year: u32, prices: &CommodityPrices, ) -> Result<()>
Write commodity prices to a CSV file
Auto Trait Implementations§
impl Freeze for DataWriter
impl RefUnwindSafe for DataWriter
impl Send for DataWriter
impl Sync for DataWriter
impl Unpin for DataWriter
impl UnwindSafe for DataWriter
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