Replies: 1 comment 2 replies
-
Hi @kentbill. You mention 2 planning variables, but you only implicitly mention 1 of them ("room?"). For the rest of my answer, i'll assume the other one is "Timeslot" just like our School Timetabling Quickstart. (https://github.com/TimefoldAI/timefold-quickstarts/blob/stable/java/school-timetabling/src/main/java/org/acme/schooltimetabling/domain/Lesson.java). Problem Scale ImpactHere is the approximate problem scale (reported by the solver) by default, and after I have limited the value range provider (let's say, half of the lessons are remote):
So yes, the search space is a lot smaller depending on how many lessons are remote., even 10 percent remote lessons reduces the search space by an other of magnitude. // Simplified code example of the ValueRangeProvider in the lesson class, where half of the lessons are virtual:
private final static List<Room> VIRTUAL_ROOM_PLACEHOLDER = List.of(new Room("VIRTUAL","VIRTUAL"));
@ValueRangeProvider
public List<Room> getPossibleRoomList() {
if (Long.parseLong(id) %2 == 0) { // or any other check for virtual, just did this to have 50% remote lessons
return VIRTUAL_ROOM_PLACEHOLDER;
} else {
return getRooms();
}
}
// Alternatively, you might use Polymorphism, inheritance and separate explicitly referenced ValueRangeProviders for VirtualLesson and Lesson objects. DownsidesAs mentioned in our documentation on this subject: https://docs.timefold.ai/timefold-solver/latest/using-timefold-solver/modeling-planning-problems#valueRangeProviderOnPlanningEntity
|
Beta Was this translation helpful? Give feedback.
-
Hello everyone!
I had a sudden thought and discovered a doubt like this
There are 2 planning variables in a planning entity, and the value in one of them is meaningless in certain datasets.
For instance, in the TimeTable example, some courses only require remote teaching, but most other courses still require on-site. For those remote courses, I just need to give them a "virtual classroom" - home.
I can certainly restrict the location of these remote courses to home with a hard constraint, but if the value range provider is limited to only one value, can it reduce the search space? or cause other problems?
Beta Was this translation helpful? Give feedback.
All reactions