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')"> <button @click="featureStore.simulate('pull')">
simulate pull system simulate pull system
</button> </button>
<button @click="featureStore.simulate('pull')"> <button @click="featureStore.simulate('problem-solving')">
simulate pull and problem solving simulate pull and problem solving
</button> </button>
<button @click="featureStore.clearDashboard()">clear dashboard</button> <button @click="featureStore.clearDashboard()">clear dashboard</button>

View File

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