You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class TaskChangeListener implements VariableListener<TimeTable, Task> {
@Override
public void afterVariableChanged(ScoreDirector<TimeTable> scoreDirector, Task task) {
System.out.println("afterVariableChanged");
updateStart(scoreDirector, task);
}
private void updateStart(ScoreDirector<TimeTable> scoreDirector, Task task){
if (task.getEmp()== null) {
if (task.getStartTime()!= null) {
scoreDirector.beforeVariableChanged(task, "startTime");
task.setStartTime(null);
scoreDirector.afterVariableChanged(task, "startTime");
}
return;
}
Task previousTask = task.getPreviousTask();
System.out.println("current: " +(task == null? null : task.getEployee().toString()));
System.out.println("previous: " + (previousTask == null? null : previousTask.getEmp().toString()));
for (Task shadowTask ....) set start and end time. Temporary comment out and run the app and got the consolve result above
}
}
Why is Employee B,C,and D behave that way? All tasks assigned to employee A.
Both Employee and Task is a Planning Enity class, Inside EMployee class there is a List of Task, annotate with @PlanningListVariable
Inside Task class, employee anotate with @InverseRelationShadowVariable(sourceVariableName = "tasks"), startTime is a shadow variable and endTIme is PiggybackShadowVariable
I saw in the examples no Constraints for "Each employee should start at the same time" needed. I think I did something wrong in this Listener class.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Here is my TaskChangeListenner
Why is Employee B,C,and D behave that way? All tasks assigned to employee A.
Both Employee and Task is a Planning Enity class, Inside EMployee class there is a List of Task, annotate with @PlanningListVariable
Inside Task class, employee anotate with @InverseRelationShadowVariable(sourceVariableName = "tasks"), startTime is a shadow variable and endTIme is PiggybackShadowVariable
I saw in the examples no Constraints for "Each employee should start at the same time" needed. I think I did something wrong in this Listener class.
Beta Was this translation helpful? Give feedback.
All reactions