simulate problem solving

This commit is contained in:
Julien Calixte
2023-07-24 00:06:34 +02:00
parent b7bfe5c368
commit 95c4a30f6a
2 changed files with 10 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ const pushAndProblemSolving20Percent = () => {
<button @click="featureStore.simulate('pull')">
simulate pull system
</button>
<button @click="featureStore.simulate('pull')">
<button @click="featureStore.simulate('problem-solving')">
simulate pull and problem solving
</button>
<button @click="featureStore.clearDashboard()">clear dashboard</button>

View File

@@ -78,7 +78,15 @@ export const useFeatureStore = defineStore('feature', {
simulate(strategy: Strategy) {
this.initBoard()
while (!this.isProjectFinished) {
this.nextDay(strategy)
if (strategy === 'problem-solving') {
if (this.meta.totalDays % 5 === 0) {
this.nextDay('problem-solving')
} else {
this.nextDay('pull')
}
} else {
this.nextDay(strategy)
}
}
const [worstFeature] = this.features.sort((a, b) =>
a.qualityIssue > b.qualityIssue ? -1 : 1