feat: adding min and max lead time in pull system article

This commit is contained in:
Julien Calixte
2025-08-04 20:29:33 +02:00
parent be04b37651
commit e16bfbf6b4
4 changed files with 46 additions and 8 deletions

View File

@@ -274,8 +274,8 @@ const createdAt = new Date('2025-01-08').toLocaleDateString(undefined, {
teams to overproduce. Product teams prepare extra features, designers teams to overproduce. Product teams prepare extra features, designers
create unnecessary screens, and developers rush through coding. This create unnecessary screens, and developers rush through coding. This
"just in case" mindset results in wasted effort and latent defects that "just in case" mindset results in wasted effort and latent defects that
require rework, slowing productivity. Worse, as there are always work to require rework, slowing productivity. Worse, as there is always work to
do in stock, we can just throw bad parts and move on a new piece, do, we can just throw bad parts and move on a new piece from stock,
increasing bad quality. increasing bad quality.
</p> </p>
<p> <p>
@@ -285,7 +285,7 @@ const createdAt = new Date('2025-01-08').toLocaleDateString(undefined, {
rel="noopener noreferrer" rel="noopener noreferrer"
href="https://journals.aps.org/pre/abstract/10.1103/PhysRevE.96.052303#:~:text=The%20%E2%80%9Cfaster%2Dis%2Dslower,evacuation%20time%20can%20be%20achieved" href="https://journals.aps.org/pre/abstract/10.1103/PhysRevE.96.052303#:~:text=The%20%E2%80%9Cfaster%2Dis%2Dslower,evacuation%20time%20can%20be%20achieved"
>slower is often faster</a >slower is often faster</a
>. Excessive pushing slows down the system, while a >. Excessive <PushSystemIcon /> pushing slows down the system, while a
<PullSystemIcon /> pull system enforces constraints that prioritize <PullSystemIcon /> pull system enforces constraints that prioritize
thoughtful delivery. thoughtful delivery.
</p> </p>

View File

@@ -84,14 +84,16 @@ export const newBacklog = (type: 'bird' | 'mobile-app', limit?: number) => {
export const initBoard = ( export const initBoard = (
steps: FeatureStep[], steps: FeatureStep[],
features: Feature[] features: Feature[],
fromStart = false
): Feature[] => { ): Feature[] => {
const initialFeatures = popNElement(features, 10) const initialFeatures = popNElement(features, 10)
initialFeatures.forEach((feature) => { initialFeatures.forEach((feature) => {
const step = pickRandomElement(steps) feature.status = fromStart ? 'doing' : pickRandomElement(['doing', 'done'])
feature.status = pickRandomElement(['doing', 'done']) feature.step = fromStart
feature.step = step.stepIndex ? steps.length - 1
: pickRandomElement(steps).stepIndex
feature.qualityIssue = 0 feature.qualityIssue = 0
feature.leadTime = 0 feature.leadTime = 0
}) })

View File

@@ -51,6 +51,26 @@ const strategies: Strategy[] = ['push', 'pull']
{{ simulationStore.meanLeadTime(strategy) }} {{ simulationStore.meanLeadTime(strategy) }}
</td> </td>
</tr> </tr>
<tr>
<td>Min lead time</td>
<td class="numeric" v-for="strategy in strategies" :key="strategy">
{{
simulationStore.minLeadTime(strategy) === Infinity
? '-'
: simulationStore.minLeadTime(strategy)
}}
</td>
</tr>
<tr>
<td>Max lead time</td>
<td class="numeric" v-for="strategy in strategies" :key="strategy">
{{
simulationStore.maxLeadTime(strategy) === 0
? '-'
: simulationStore.maxLeadTime(strategy)
}}
</td>
</tr>
<!-- <tr> <!-- <tr>
<td>Cycle time</td> <td>Cycle time</td>
<td class="numeric" v-for="strategy in strategies" :key="strategy"> <td class="numeric" v-for="strategy in strategies" :key="strategy">

View File

@@ -8,6 +8,8 @@ import { defineStore } from 'pinia'
type Mean = { type Mean = {
leadTimeSum: number leadTimeSum: number
minLeadTime: number
maxLeadTime: number
cycleTimeSum: number cycleTimeSum: number
complexitySum: number complexitySum: number
qualityIssueSum: number qualityIssueSum: number
@@ -25,6 +27,8 @@ type State = {
const initMean = (): Mean => ({ const initMean = (): Mean => ({
leadTimeSum: 0, leadTimeSum: 0,
minLeadTime: Infinity,
maxLeadTime: 0,
cycleTimeSum: 0, cycleTimeSum: 0,
complexitySum: 0, complexitySum: 0,
qualityIssueSum: 0, qualityIssueSum: 0,
@@ -67,7 +71,7 @@ export const useSimulationStore = defineStore('dashboard', {
async simulate(strategy: Strategy) { async simulate(strategy: Strategy) {
const steps = featureSteps const steps = featureSteps
const backlog = await instance.newBacklog('mobile-app') const backlog = await instance.newBacklog('mobile-app')
const features = await instance.initBoard(steps, backlog) const features = await instance.initBoard(steps, backlog, true)
const newState = await instance.simulate( const newState = await instance.simulate(
{ {
@@ -99,6 +103,14 @@ export const useSimulationStore = defineStore('dashboard', {
this.dashboards.push(dashboard) this.dashboards.push(dashboard)
this.mean[strategy].leadTimeSum += dashboard.analysis.meanLeadTime this.mean[strategy].leadTimeSum += dashboard.analysis.meanLeadTime
this.mean[strategy].minLeadTime = Math.min(
this.mean[strategy].minLeadTime,
...newState.features.map((f) => f.leadTime)
)
this.mean[strategy].maxLeadTime = Math.max(
this.mean[strategy].maxLeadTime,
...newState.features.map((f) => f.leadTime)
)
this.mean[strategy].cycleTimeSum += this.mean[strategy].cycleTimeSum +=
dashboard.meta.totalDays / newState.features.length dashboard.meta.totalDays / newState.features.length
this.mean[strategy].complexitySum += dashboard.analysis.meanComplexity this.mean[strategy].complexitySum += dashboard.analysis.meanComplexity
@@ -131,6 +143,10 @@ export const useSimulationStore = defineStore('dashboard', {
state.mean[strategy].leadTimeSum, state.mean[strategy].leadTimeSum,
state.mean[strategy].simulations state.mean[strategy].simulations
), ),
minLeadTime: (state) => (strategy: Strategy) =>
state.mean[strategy].minLeadTime,
maxLeadTime: (state) => (strategy: Strategy) =>
state.mean[strategy].maxLeadTime,
meanCycleTime: (state) => (strategy: Strategy) => meanCycleTime: (state) => (strategy: Strategy) =>
getRound( getRound(
state.mean[strategy].cycleTimeSum, state.mean[strategy].cycleTimeSum,