Java Reference
In-Depth Information
and the temporal parameters as defined in Figure 3.5. Two more member
variables are needed to store the values of the activation and termination
times corresponding to the best performance of the scheduling algorithm.
The constructor initializes the temporal parameters and computes the
activity's duration. During the execution of the scheduling algorithm, only
the activation time and the termination time will be updated. The reset()
method initializes the activation time and termination time before any new
run of the scheduling algorithm.
package scheduler;
public class Activity {
private int id # 0;
private String name;
private double releaseTime;
private double activationTime;
private double terminationTime;
private double dueTime;
private double duration;
private double tempActivationTime # 0.0;
private double tempTerminationTime # 0.0;
public Activity(String name, double r, double a,
double t, double d) {
this .name # name;
this .releaseTime # r;
this .activationTime # a;
this .terminationTime # t;
this .dueTime # d;
this .duration # t - a;
public int getID() { return id; }
public String getName() { return name; }
public double getActivation() { return activationTime; }
public double getRelease() { return releaseTime; }
public double getTermination() { return terminationTime; }
public double getDueTime() { return dueTime; }
public double getDuration() { return duration; }
public void setID( int id) { this .id # id; }
// The next two methods set the values of release time and
// due date. If necessary, they change the values of
// termination time and activation time consistently
public void setReleaseTime( double time) {
if (time < 0.0)
return ;
if (time < activationTime || (time ! duration) < dueTime)
releaseTime # time;
if (releaseTime > activationTime) {
Search WWH ::

Custom Search