Skip to content

Commit

Permalink
chore: score corruption code
Browse files Browse the repository at this point in the history
  • Loading branch information
ge0ffrey committed Nov 5, 2024
1 parent 415b25b commit 00c4c9e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions events/2024-11-05-BYOM_score_calculation.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,28 @@ <h3>Unit test</h3>
<section data-background-color="#3e00ff">
<h2>Score corruption</h2>
</section>
<section>
<h3>Score corruption</h3>
<pre xml:space="preserve"><code class="java">Constraint dependencyTask(...) {
return constraintFactory.forEach(Task.class)
.filter(task ->
task.start < task.dependencyTask.end)
.penalize(ONE_HARD)
.asConstraint("Starts before dependency task");
}</code></pre>
</section>
<section>
<h3>No score corruption</h3>
<pre xml:space="preserve"><code class="java">Constraint dependencyTask(...) {
return constraintFactory.forEach(Task.class)
.join(Task.class, equal(task -> task,
task -> task.dependencyTask)
.filter(task1, task2 ->
task1.start < task2.end)
.penalize(ONE_HARD)
.asConstraint("Starts before dependency task");
}</code></pre>
</section>


</section>
Expand Down

0 comments on commit 00c4c9e

Please sign in to comment.