public class WorkerNode
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
WorkerNode(int num) |
Modifier and Type | Method and Description |
---|---|
boolean |
activate()
Set this worker as active.
|
boolean |
deactivate()
Set this worker as inactive.
|
void |
done()
Set this worker as finished in current day.
|
void |
finish()
Set this worker as finished.
|
double |
getExecutionTime()
Get the execution time of the current worker.
|
double |
getJudgementTime()
Get the time that is as the criteria of load balancing operations
|
double |
getPredictedTime()
Get the predicted time of the current worker.
|
int |
getWorkerNumber()
Get the worker number.
|
boolean |
isActive()
Check whether this worker is active.
|
boolean |
isDone()
Check whether the worker has finished the simulation of current day.
|
boolean |
isFinished()
Check whether the worker has finished the whole simulation.
|
void |
setExecutionTime(long time)
Set the execution time for the current worker.
|
void |
start()
Start a new day for the current worker.
|
void |
stop()
Finish the current day for the current worker.
|
void |
stop(double predictedTime)
Finish the current day for the current worker and set the predicted time
as criteria
|
void |
stop(Predictor predictor,
double[] array)
Finish the current day for the current worker and use the predictor to
predict the execution time of the next simulation day.
|
public int getWorkerNumber()
public boolean isFinished()
public boolean isDone()
public void finish()
public void done()
public boolean activate()
public boolean deactivate()
public void start()
public void stop()
public void stop(double predictedTime)
predictedTime
- public void setExecutionTime(long time)
time
- public boolean isActive()
public double getJudgementTime()
public double getExecutionTime()
public double getPredictedTime()
public void stop(Predictor predictor, double[] array)
predictor
- array
-