📄 jsimproblemswindow.java
字号:
this.toMVAConversion = toMVAConversion;
if (toMVAConversion) this.setTitle("Problems while trying to convert to JMVA");
else this.setTitle("Simulation Diagnostic");
}*/
public void updateProblemsShown(boolean updating) {
//canBeRun = false;
//operationCanceled = true;
setTitleOfWindow();
problems.removeAllElements();
problemsList.removeAll();
if (updating) mc.checkModel();
initializeList();
problemsList.setListData(problems);
problemsList.setFocusable(false);
if (!toMVAConversion) {
if (mc.isErrorFreeNormal()) continueButton.setEnabled(true);
}
else if (mc.isErrorFreeToJMVA()) continueButton.setEnabled(true);
//if (mc.isEverythingOk()) hide();
}
/**
* create the ProblemElements and insert them into the problems vector
*/
private void initializeList() {
if (toMVAConversion) {
if (mc.isThereNoClassesError()) {
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.NO_CLASSES_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>No classes defined</html>",null,null));
}
if (mc.isThereNoStationError()) {
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.NO_STATION_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>No station defined</html>",null,null));
}
/*if (mc.isThereNoExpFoundWarning()) {
problems.add(new ProblemElement(ModelChecker.WARNING_PROBLEM,ModelChecker.NO_EXP_FOUND_WARNING,"<html><font color=\"white\">--</font><i>Warning</i><font color=\"white\">--------</font>A non-exponential time distribution was found",null,null));
}
/*if (mc.isThereDelaysFoundError()) {
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.DELAYS_FOUND_ERROR," Error Delays not supported in JModel to JMVA conversion",null,null));
}*/
/*if (mc.isThereDifferentServiceTimeWarning()) {
problems.add(new ProblemElement(ModelChecker.WARNING_PROBLEM,ModelChecker.DIFFERENT_SERVICE_TIME_WARNING,"<html><font color=\"white\">--</font><i>Warning</i><font color=\"white\">--------</font>A station with different mean service time per class was found",null,null));
}
if (mc.isThereNonFCFSWarning()) {
problems.add(new ProblemElement(ModelChecker.WARNING_PROBLEM,ModelChecker.NON_FCFS_WARNING,"<html><font color=\"white\">--</font><i>Warning</i><font color=\"white\">--------</font>A non FCFS queue strategy was found",null,null));
}*/
if (mc.isThereClassesWithoutRefStationError()) {
Vector temp = mc.getKeysOfClassesWithoutRefStation();
for (int i=0;i<temp.size();i++) {
Object classKey = temp.get(i);
String className = mc.getClassModel().getClassName(classKey);
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.REFERENCE_STATION_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>No reference station defined for " + className ,null,classKey));
}
}
if (mc.isThereBCMPDifferentQueueingStrategyWarning()) {
Vector temp = mc.getBCMPserversWithDifferentQueueStrategy();
for (int i=0;i<temp.size();i++) {
String thisStation = mc.getStationModel().getStationName(temp.get(i));
problems.add(new ProblemElement(ModelChecker.WARNING_PROBLEM,ModelChecker.BCMP_DIFFERENT_QUEUEING_STRATEGIES_WARNING,"<html><font color=\"white\">--</font><i>Warning</i><font color=\"white\">--------</font>Different per class queueing strategy found at " + thisStation,temp.get(i),null));
}
}
if (mc.isThereBCMPDifferentServiceTypeWarning()) {
Vector temp = mc.getBCMPserversWithDifferentServiceTypes();
for (int i=0;i<temp.size();i++) {
String thisStation = mc.getStationModel().getStationName(temp.get(i));
problems.add(new ProblemElement(ModelChecker.WARNING_PROBLEM,ModelChecker.BCMP_FCFS_DIFFERENT_SERVICE_TYPES_WARNING,"<html><font color=\"white\">--</font><i>Warning</i><font color=\"white\">--------</font>Non uniform service strategy inside FCFS station " + thisStation,temp.get(i),null));
}
}
if (mc.isThereBCMPFcfsNonExponentialWarning()) {
Vector temp = mc.getBCMPserversFCFSWithoutExponential();
for (int i=0;i<temp.size();i++) {
String thisStation = mc.getStationModel().getStationName(temp.get(i));
problems.add(new ProblemElement(ModelChecker.WARNING_PROBLEM,ModelChecker.BCMP_FCFS_EXPONENTIAL_WARNING,"<html><font color=\"white\">--</font><i>Warning</i><font color=\"white\">--------</font>Non exponential service time inside FCFS station " + thisStation,temp.get(i),null));
}
}
if (mc.isThereBCMPFcfsDifferentServiceTimesWarning()) {
Vector temp = mc.getBCMPFcfsServersWithDifferentServiceTimes();
for (int i=0;i<temp.size();i++) {
String thisStation = mc.getStationModel().getStationName(temp.get(i));
problems.add(new ProblemElement(ModelChecker.WARNING_PROBLEM,ModelChecker.BCMP_FCFS_DIFFERENT_SERVICE_TIMES_WARNING,"<html><font color=\"white\">--</font><i>Warning</i><font color=\"white\">--------</font>Different service times inside FCFS station " + thisStation,temp.get(i),null));
}
}
if (mc.isThereBCMPDelayWarning()) {
Vector temp = mc.getBCMPdelaysWithNonRationalServiceDistribution();
for (int i=0;i<temp.size();i++) {
String thisStation = mc.getStationModel().getStationName(temp.get(i));
problems.add(new ProblemElement(ModelChecker.WARNING_PROBLEM,ModelChecker.BCMP_FCFS_EXPONENTIAL_WARNING,"<html><font color=\"white\">--</font><i>Warning</i><font color=\"white\">--------</font>" + thisStation + " with non valid service time distribution",temp.get(i),null));
}
}
if (mc.isThereBCMPNonStateIndependentRoutingWarning()) {
problems.add(new ProblemElement(ModelChecker.WARNING_PROBLEM,ModelChecker.BCMP_NON_STATE_INDEPENDENT_ROUTING_WARNING,"<html><font color=\"white\">--</font><i>Warning</i><font color=\"white\">--------</font>A non state independent routing strategy was found",null,null));
}
//TODO: Lcfs-Pr case handling
//TODO: Processor Sharing handling
}
else {
if (mc.isThereNoClassesError()) {
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.NO_CLASSES_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>No classes defined",null,null));
}
if (mc.isThereNoStationError()) {
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.NO_STATION_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>No station defined",null,null));
}
if (mc.isThereStationLinkError()) {
Vector temp = mc.getKeysOfStationsWithLinkProblems();
for (int i=0;i<temp.size();i++) {
Object stationKey = temp.get(i);
String stationName = mc.getStationModel().getStationName(stationKey);
String description;
if (mc.getStationModel().getStationType(stationKey).equals(CommonConstants.STATION_TYPE_SINK)) {
description = ("<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>" + stationName + " is not backward linked");
}
else description = ("<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>" + stationName + " is not forward linked");
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.STATION_LINK_ERROR,description,stationKey,null));
}
}
if (mc.isThereAllForwardStationsAreSinkErrors()) {
HashMap temp = mc.getKeysOfAllForwardStationsAreSinkErrors();
Vector classKeys = mc.getClassModel().getClassKeys();
for (int i=0;i<classKeys.size();i++ ) {
Object classKey = classKeys.get(i);
String className = mc.getClassModel().getClassName(classKey);
Vector stationWithAllForwardStationsAreSinkErrors = (Vector)temp.get(classKey);
if (stationWithAllForwardStationsAreSinkErrors != null){
for (int j=0;j<stationWithAllForwardStationsAreSinkErrors.size();j++) {
Object stationKey = stationWithAllForwardStationsAreSinkErrors.get(j);
String stationName = mc.getStationModel().getStationName(stationKey);
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.ALL_FORWARD_STATION_ARE_SINK_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>Close class " + className + " routed to station " + stationName + " linked only to sink",stationKey,classKey));
}
}
}
}
if (mc.isThereRoutingError()) {
HashMap temp = mc.getKeysOfRoutingProblems();
Vector classKeys = mc.getClassModel().getClassKeys();
for (int i=0;i<classKeys.size();i++ ) {
Object classKey = classKeys.get(i);
String className = mc.getClassModel().getClassName(classKey);
Vector stationWithRoutingProblems = (Vector)temp.get(classKey);
if (stationWithRoutingProblems != null){
for (int j=0;j<stationWithRoutingProblems.size();j++) {
Object stationKey = stationWithRoutingProblems.get(j);
String stationName = mc.getStationModel().getStationName(stationKey);
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.ROUTING_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>Close class " + className + " at station " + stationName +" is routed to sink with p=1",stationKey,classKey));
}
}
}
}
if (mc.isThereSimulationError()) {
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.SIMULATION_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>No performance indices defined",null,null));
}
if (mc.isThereInconsistentMeasureError()) {
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.INCONSISTENT_MEASURE_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>Undefined station in performance index",null,null));
}
if (mc.isThereMeasureError()) {
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.DUPLICATE_MEASURE_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>A performance index is defined more than once",null,null));
}
if (mc.isThereClassesWithoutRefStationError()) {
Vector temp = mc.getKeysOfClassesWithoutRefStation();
for (int i=0;i<temp.size();i++) {
Object classKey = temp.get(i);
String className = mc.getClassModel().getClassName(classKey);
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.REFERENCE_STATION_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>No reference station defined for " + className ,null,classKey));
}
}
if (mc.isThereNoSinkWithOpenClassesError()) {
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.NO_SINK_WITH_OPEN_CLASSES_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>Open classes were found but no sink have been defined",null,null));
}
if (mc.isThereSinkButNoOpenClassError()) {
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.SINK_BUT_NO_OPEN_CLASSES_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>Sink without open classes",null,null));
}
if (mc.isThereOpenClassButNoSourceError()) {
problems.add(new ProblemElement(ModelChecker.ERROR_PROBLEM,ModelChecker.OPEN_CLASS_BUT_NO_SOURCE_ERROR,"<html><font color=\"white\">----</font><b>Error</b><font color=\"white\">---------</font>An open class was found but no source has been defined",null,null));
}
if (mc.isThereSourceWithNoClassesError()) {
Vector temp = mc.getKeysOfSourceWithoutClasses();
for (int i=0;i<temp.size();i++) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -