use muto::{CostMatrix, Job, Muto, Vehicle};
fn main() {
let mut muto = Muto::new();
muto.set_cost_matrix(CostMatrix::new());
let vehicle_a = Vehicle::new(
1,
0,
0,
(0, 50),
);
muto.add_vehicle(vehicle_a);
let job_a = Job::new(1, 0, (0, 10), 0);
muto.add_job(job_a);
let job_b = Job::new(2, 50, (10, 20), 0);
muto.add_job(job_b);
let job_c = Job::new(3, 10, (20, 30), 0);
muto.add_job(job_c);
let job_d = Job::new(4, 1, (30, 40), 0);
muto.add_job(job_d);
let job_e = Job::new(5, 1, (40, 50), 0);
muto.add_job(job_e);
let job_f = Job::new(6, 30, (55, 80), 0);
muto.add_job(job_f);
let solutions = muto.solve();
let vehicle_b = Vehicle::new(
2,
0,
0,
(0, 100),
);
muto.add_vehicle(vehicle_b);
let solutions = muto.solve();
println!("Found solutions: ");
for solution in solutions {
println!("solution: cost={}", solution.cost);
for route in solution.routes.iter() {
println!("route: vehicle_id={}, tasks={}", route.vehicle_id, route.tasks.len());
for task in route.tasks.iter() {
print!("{:?}\n", task);
}
}
}
}