Java Reference
In-Depth Information
void
setProblem(String name) {
problem
#
(Problem) problemList.get(name);
if
(problem !
#
null
) {
scheduler.setProblem(problem);
scheduleSheet.repaint();
}
}
void
reset() {
if
(problem !
#
null
) {
problem.reset();
scheduler.reset();
scheduleSheet.repaint();
scheduleCommand.reset();
scheduleCommand.repaint();
}
}
double
schedule(
double
gain) {
scheduler.schedule(gain);
scheduleSheet.repaint();
schedulePerformance.repaint();
return scheduler.bestValue();
}
Three main functionalities should be addressed:
The
Scheduler
must keep track of the performance values during the iter-
ations of the scheduling algorithm. This allows the representation of the
performance trend in the bottom part of the graphical interface.
■
The user should be allowed to reset the scheduler and to execute the
scheduling algorithm again. This means that every
Activity
object must
keep a copy of the original values of the temporal parameters in order to
restore them when the user resets the scheduler.
■
The user should be allowed to modify the temporal parameters of each
Activity
object through the graphical interface and to execute the
scheduling algorithm with the new temporal values.
■
The first and second functionalities require the following changes to class
Activity
and class
Scheduler
.
public class
Activity {
. . .
public
Activity getClone() {
Activity clone
#
new
Activity(name, releaseTime,
activationTime, terminationTime, dueTime);
clone.id
#
id;
return
clone;
}