jagua_rs/probs/spp/io/ext_repr.rs
1use serde::{Deserialize, Serialize};
2
3use crate::io::ext_repr::ExtLayout;
4
5/// Strip Packing Problem instance
6#[derive(Serialize, Deserialize, Clone)]
7pub struct ExtSPInstance {
8 /// The name of the instance
9 pub name: String,
10 /// Set of items to be produced
11 pub items: Vec<ExtItem>,
12 /// Fixed height of the strip
13 pub strip_height: f32,
14}
15
16/// Item with a demand
17#[derive(Serialize, Deserialize, Clone)]
18pub struct ExtItem {
19 #[serde(flatten)]
20 /// External representation of the item in the base library
21 pub base: crate::io::ext_repr::ExtItem,
22 /// Amount of times this item has to be produced
23 pub demand: u64,
24}
25
26/// Strip Packing Problem solution
27#[derive(Serialize, Deserialize, Clone)]
28pub struct ExtSPSolution {
29 /// The strip width of the solution
30 pub strip_width: f32,
31 /// Layouts which compose the solution
32 pub layout: ExtLayout,
33 /// Sum of the area of the produced items divided by the sum of the area of the containers
34 pub density: f32,
35 /// The time it took to generate the solution in seconds
36 pub run_time_sec: u64,
37}