
es.tid.pce.client.management.StopManagement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of network-emulator Show documentation
Show all versions of network-emulator Show documentation
Emulator of GMPLS-controlled transport Network
The newest version!
package es.tid.pce.client.management;
import java.util.TimerTask;
import es.tid.pce.client.emulator.AutomaticTesterStatistics;
import es.tid.pce.client.emulator.Emulator;
public class StopManagement extends TimerTask {
private long blocksNumber;
private AutomaticTesterStatistics ats;
private int numberIterations;
private Emulator emulator;
public StopManagement(Emulator emulator,int numberIterations, long blocksNumber,AutomaticTesterStatistics ats){
this.blocksNumber=blocksNumber;
this.numberIterations=numberIterations;
this.ats=ats;
this.emulator=emulator;
}
public void run(){
if (/*(stopConditionBlockProbabilityConvergence())||*/(maxNumberIterations()))/*(stopCondition(Long.parseLong(ats.getBlockProbability().result())))||*/{
emulator.stop();
}
}
// public boolean stopCondition(Long blocksNumber){
// Long longs = Long.valueOf(this.blocksNumber);
// if (blocksNumber.compareTo(longs) ){
// return true;
// }
// return false;
// }
public boolean stopConditionBlockProbabilityConvergence(){
if (ats.getBlockProbability().getConverge() == 1){
return true;
}
return false;
}
public boolean stopConditionMeanReqTimeConvergence(){
if (ats.getMeanReqTime().getConverge() == 1){
return true;
}
return false;
}
public boolean maxNumberIterations(){
if (this.numberIterations < ats.getNumRequests()){
return true;
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy