kpiTable = {
let kpis = [];
mvrpID.forEach((sol) => {
kpis.push(sol.kpis);
});
yield Inputs.table(kpis, {
columns: [
"vehiclesInProblem",
"nbrRoutes",
"unassigned",
"totalTime",
"totalDistance",
"avgStops"
],
header: {
vehiclesInProblem: "Vehicle Count",
nbrRoutes: "Routes",
unassigned: "Unassigned",
totalTime: "Total Time",
totalDistance: "Total Distance",
avgStops: "Avg. Stops per Veh"
},
width: {
vehiclesInProblem: 80,
nbrRoutes: 80,
unassigned: 80,
totalTime: 120,
totalDistance: 120,
avgStops: 120
},
format: {
type: (x) => x.toUpperCase(),
arrival: (x) =>
new Date(x * 1000).toLocaleTimeString([], {
hour: "2-digit",
minute: "2-digit",
hour12: false
}),
load: (x) => `${x[0]} back ${x[1]} front`,
duration: (x) => (x / 60).toFixed(1) + " mn"
},
maxWidth: 1100,
multiple: false,
required: false
});
}