(careAboutFrames)
| 226 | } |
| 227 | |
| 228 | isSuccessful (careAboutFrames) { |
| 229 | if (careAboutFrames == null) { careAboutFrames = true } |
| 230 | if (this.solution == null) { return false } |
| 231 | if ((this.frames !== this.solution.frameCount) && !!careAboutFrames) { return false } |
| 232 | if (this.simulationFrameRate < 30) { return false } |
| 233 | if (this.goals && this.solution.goals) { |
| 234 | for (const k in this.goals) { |
| 235 | if (!this.solution.goals[k]) { continue } |
| 236 | if (this.solution.goals[k] !== this.goals[k].status) { return false } |
| 237 | } |
| 238 | } else if (this.goals) { |
| 239 | const allPassed = _.all(this.goals, goal => goal.status === 'success') |
| 240 | const someFailed = _.any(this.goals, goal => goal.status !== 'success') |
| 241 | if (this.solution.succeeds) { return allPassed } |
| 242 | if (!this.solution.succeeds) { return someFailed } |
| 243 | } |
| 244 | return true |
| 245 | } |
| 246 | |
| 247 | onUserCodeProblem (e) { |
| 248 | console.warn('Found user code problem:', e) |
no outgoing calls
no test coverage detected