diff --git a/src/AppHeijunka.vue b/src/AppHeijunka.vue
index 68635fa..abc3429 100644
--- a/src/AppHeijunka.vue
+++ b/src/AppHeijunka.vue
@@ -85,7 +85,21 @@ const createdAt = new Date('2026-01-01').toLocaleDateString(undefined, {
You know, from your years of experience, that in 3 days, you sell
- approximately 5 shirts, 3 jeans, 2 pairs of shoes and 2 hats.
+ approximately
+
+ -
+ 5 shirts
+
+ -
+ 3 jeans
+
+ -
+ 2 pairs of shoes
+
+ -
+ 2 hats
+
+
+
+
+
Factory
diff --git a/src/modules/heijkunka/heijunka-store.ts b/src/modules/heijkunka/heijunka-store.ts
index 553469f..7d3c1d6 100644
--- a/src/modules/heijkunka/heijunka-store.ts
+++ b/src/modules/heijkunka/heijunka-store.ts
@@ -37,8 +37,8 @@ const getInventoryByProduct = (
): number => {
const inventory = planning.filter(
(p, index) =>
- index >= (currentDay - 1) * NUMBER_OF_HOURS_PER_DAY &&
- index < currentDay * NUMBER_OF_HOURS_PER_DAY &&
+ index >= ((currentDay % NUMBER_OF_DAYS) - 1) * NUMBER_OF_HOURS_PER_DAY &&
+ index < (currentDay % NUMBER_OF_DAYS) * NUMBER_OF_HOURS_PER_DAY &&
p === product
).length
@@ -146,13 +146,18 @@ export const useHeijunkaStore = defineStore('heijunka', {
this.planning = []
this.orders = []
this.inventory = { ...initialInventory }
+ },
+ simulateMonth() {
+ for (let index = 0; index < 30; index++) {
+ this.newHour()
+ }
}
},
getters: {
currentDay: (state) =>
Math.ceil(state.meta.currentHour / NUMBER_OF_HOURS_PER_DAY),
- gameEnded: (state) =>
- state.meta.currentHour >= NUMBER_OF_DAYS * NUMBER_OF_HOURS_PER_DAY,
+ gameEnded: () => false,
+ // state.meta.currentHour >= NUMBER_OF_DAYS * NUMBER_OF_HOURS_PER_DAY,
meanLeadTime: (state) => getMean(state.orders.map((o) => o.leadTime))
}
})