Skip to main content

jagua_rs/probs/spp/io/
export.rs

1use crate::Instant;
2use crate::io::export::export_layout_snapshot;
3use crate::probs::spp::entities::SPSolution;
4use crate::probs::spp::io::ext_repr::ExtSPSolution;
5
6/// Exports a solution out of the library
7#[must_use]
8pub fn export(solution: &SPSolution, epoch: Instant) -> ExtSPSolution {
9    ExtSPSolution {
10        strip_width: solution.strip.width,
11        layout: export_layout_snapshot(&solution.layout_snapshot, 0),
12        density: solution.density(),
13        run_time_sec: solution.time_stamp.duration_since(epoch).as_secs(),
14    }
15}