Last active
October 3, 2018 13:11
-
-
Save ge0ffrey/b63acfbc5baad6d1548d4863405dc27a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option A | |
======== | |
@PlanningSolution | |
class MeetingSchedule { | |
@ConstraintWeight("Room conflict") | |
HardSoftScore roomConflictWeight = HardSoftScore.ofHard(-100); | |
@ConstraintWeight("Speaker conflict") | |
HardSoftScore speakerConflictWeight = HardSoftScore.ofHard(-1); | |
... | |
@PlanningScore | |
HardSoftScore score; | |
} | |
Option B | |
======== | |
@PlanningSolution | |
class MeetingSchedule { | |
@ConstraintWeightSourceProperty | |
GenericConstraintWeightSource foo = new GenericConstraintWeightSourceBuilder() | |
.add("Room conflict", HardSoftScore.ofHard(-100) | |
.add("Speaker conflict", HardSoftScore.ofHard(-1) | |
.build(); | |
... | |
@PlanningScore | |
Score score; | |
} | |
Option C | |
======== | |
@PlanningSolution | |
class MeetingSchedule { | |
@ConstraintWeightSourceProperty | |
MeetingConstraintWeightSource foo; | |
... | |
@PlanningScore | |
Score score; | |
} | |
@ConstraintWeightSource | |
class MeetingConstraintWeightSource { | |
@ConstraintWeight("Room conflict") | |
HardSoftScore roomConflict = HardSoftScore.ofHard(-100); | |
@ConstraintWeight("Speaker conflict") | |
HardSoftScore speakerConflict = HardSoftScore.ofHard(-1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
B and C variants with Provider:
Option B2
Option C2