[KieLive#22] OptaPlanner Shadow Variables for the Vehicle Routing Problem and Task Assignment
Why Stack Overflow recommends it
Stack Overflow users link it when answering or asking about modeling OptaPlanner problems with shadow variables, such as inverse relation variables, delayed task start times and routing with time windows.
Recommended by 2 people across 2 different months, 2021 to 2024.
What it is
A KIE Live stream on OptaPlanner shadow variables, presented by OptaPlanner founder Geoffrey De Smet. It explains how values derived from planning variables, such as vehicle arrival times, simplify models for vehicle routing and task assignment and make otherwise hard constraints tractable.
What people said
Recommends Geoffrey De Smet · 2021-04 · Stack Overflow · on “Linked tasks in task route assigning (Optaplanner)”
A) Usually, we don't assign lunch tasks. Instead, we get a shadow variable to delay the start time of the first task after noon by 1 hour. I think I cover it in the shadow vars video [this video] . B) If lunch and lunch_pick are always assigned sequentially to the same user, why not just make them one task?
Recommends Family Screeton · 2022-09 · Stack Overflow · on “Optaplanner: problems with InverseRelationShadowVariable”
have a many-1 relationship pupil-formGroup: pupils are assigned to a formGroup and a formGroup can contain many pupils. I have attempted to implement an InverseRelationShadowVariable having watched your video/tutorial [this video] (which does not quite correspond with the latest optaplanner documentation I realise) FormGroup extracts @Entity @PlanningEntity public class FormGroup { @InverseRelationShadowVariable(sourceVariableName = "formGroup") @OneToMany(mappedBy = "formGroup", fetch = FetchType.EAGER) private List<Pupil> pupilList = new ArrayList<Pupil>(); public List<Pupil> getPupilList() { return pupilList; } public Integer getPupilCount() { return pupilList.size(); } Pupil extracts @Entity
Cites Geoffrey De Smet · 2021-01 · Stack Overflow · on “many machines to complete task at the same time”
In this video on shadow variables [this video] we briefly touched upon this topic. [LINK] However, your case is a bit different, as it depends on the execution mode (= processing procedure) of the task wether it needs multiple assignees, so it harder to split such tasks into multiple single-assignee tasks. It would need a thorough analysis to design a good model for this, but I am confident it would be possible.
Cites jova5 · 2024-04 · Stack Overflow · on “Channing problem when modeling timefold/optaplanner for vehicle routing and task assigning in one solution?”
I am currently engaged in the development of an application where task allocation to resources over a defined period is crucial. The objective is to optimize travel time between tasks while ensuring they are executed in order of priority. To accomplish this, I am utilizing OptaPlanner (OP) and adhering to specific constraints and task dependencies. I have structured my planning entities and solution using @PlanningListVariable [LINK] , Inverse relation shadow variable [LINK] , and Previous and next element shadow variable [LINK] , as illustrated below: @PlanningEntity public class Resource { @PlanningId private Long id; ... @PlanningListVariable private List<Task> tasks = new ArrayList<>();