Can we use two planning variables with (nullable = true)
for each of them?
If so, how can we deal with them in the Drools rule file?
I know that when we use one planning variable we define it with (nullable = true) and then in the rule we use $planningVariable != null as in the " pas " example, I tried this and it worked well, but what about using two planning variables?
Can we apply this on the curriculumCourse ? and if so, the over constrained data should appear in the output as unassigned for the two planning variables or appear in only one of them?
Yes, of course you can. But as usual, you 'll have to make sure your score constraints (= score rules) penalize/reward what you want to achieve.
For example on CurriculumCourse, I presume you 'd have a negative medium constraint that penalizes a Lecture
if either room
or period
is null
. If both are null
, don't penalize it more, or you'll end up with a lot semi assigned entities. But despite that, you'll still probably end up with a few semi assigned entities, so to fix that:
null
) as a semi-assignment is useless. Additional solving efficiently can be gained from:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.