📄 modelchecker.java
字号:
//checkForOpenClassReferenceStationError();
//checkForNoExpFoundWarning();
//checkForDifferentServiceTimesWarnings();
//checkForNonFCFSWarning();
checkForBCMPDifferentQueueingStrategyWarning();
checkForBCMPFcfsDifferentServiceTypesWarning();
checkForBCMPFcfsNonExponentialWarning();
checkForBCMPFcfsDifferentServiceTimesWarning();
checkForBCMPProcessorSharingWarning();
checkForBCMPDelayWarning();
checkForBCMPLcfsPrWarning();
checkForBCMPNonStateIndependentRoutingWarning();
}
else {
station_def.manageProbabilities();
checkForNoClassError();
checkForNoStationError();
checkForRefStationError();
checkForOpenClassButNoSourceError();
checkForSourcesWithNoClassesError();
checkForNoSinkWithOpenClassError();
checkForSinkButNoOpenClassError();
checkForStationLinkError();
checkForRoutingError();
checkForAllForwardStationsAreSinkError();
checkForSimulationError();
checkForMeasureError();
checkForInconsistentMeasureError();
//checkForMoreThanOneSinkWarning();
checkForNoBacwardLinkWarning();
checkForParametricAnalysisModelModifiedWarning();
checkForParametricAnalysisNoMoreAvaibleWarning();
checkForJoinWithoutForkErrors();
checkForForkWithoutJoinWarnings();
checkForEmptyBlockingRegions();
checkForPreloadingInBlockingRegions();
}
}
public StationDefinition getStationModel() {
return station_def;
}
public ClassDefinition getClassModel() {
return class_def;
}
public BlockingRegionDefinition getBlockingModel() {
return blocking_def;
}
public boolean isToJMVA() {
return isToJMVAChecker;
}
public boolean isEverythingOkNormal() {
boolean ok = false;
//for (int i=0; i<NUMBER_OF_NORMAL_ERROR_TYPES; i++) if (errors[i] == true) ok = false;
//for (int i=0; i<NUMBER_OF_NORMAL_WARNING_TYPES; i++) if (warnings[i] == true) ok = false;
if (isErrorFreeNormal() && isWarningFreeNormal()) ok = true;
return ok;
}
public boolean isEverythingOkToJMVA() {
boolean ok = false;
if (isErrorFreeToJMVA() && isWarningFreeToJMVA()) ok = true;
return ok;
}
public boolean isErrorFreeNormal() {
for (int i=0; i<NUMBER_OF_NORMAL_ERROR_TYPES; i++)
if (errors[i])
return false;
return true;
}
public boolean isErrorFreeToJMVA() {
boolean ok = true;
if ((errors[NO_CLASSES_ERROR])||(errors[NO_STATION_ERROR])||(errors[OPEN_CLASS_BUT_NO_SOURCE_ERROR])||(errors[REFERENCE_STATION_ERROR])) ok = false;
return ok;
}
public boolean isWarningFreeToJMVA() {
boolean ok = true;
if ((warnings[BCMP_DIFFERENT_QUEUEING_STRATEGIES_WARNING])||(warnings[BCMP_FCFS_DIFFERENT_SERVICE_TYPES_WARNING])||(warnings[BCMP_FCFS_EXPONENTIAL_WARNING])||(warnings[BCMP_FCFS_DIFFERENT_SERVICE_TIMES_WARNING])||(warnings[BCMP_PROCESSOR_SHARING_WARNING])||(warnings[BCMP_DELAY_WARNING])||(warnings[BCMP_LCFS_PR_WARNING])||(warnings[BCMP_NON_STATE_INDEPENDENT_ROUTING_WARNING])) ok = false;
return ok;
}
public boolean isWarningFreeNormal() {
boolean ok = true;
for (int i=0; i<NUMBER_OF_NORMAL_WARNING_TYPES; i++) if (warnings[i]) ok = false;
return ok;
}
/**
* Returns true if no classes have been defined.
* @return false, if there is at least one class
* <br>true, if no classes have been defined
*/
public boolean isThereNoClassesError () {
return errors[NO_CLASSES_ERROR];
}
/**
* Returns true if no stations have been defined.
* @return false, if there is at least one station
*/
public boolean isThereNoStationError () {
return errors[NO_STATION_ERROR];
}
/**
* Returns true if a reference station for each class have been defined.
* @return false, if each class has a reference station
*/
public boolean isThereClassesWithoutRefStationError() {
return errors[REFERENCE_STATION_ERROR];
}
/**
* Returns true if each source has an open class associated to.
* @return false, if source has an open class associated to.
*/
public boolean isThereSourceWithNoClassesError() {
return errors[SOURCE_WITH_NO_OPEN_CLASSES_ERROR];
}
/**
* Returns true if there is at least one open class but no sinks have been defined
* @return true if the problem occours.
*/
public boolean isThereNoSinkWithOpenClassesError() {
return errors[NO_SINK_WITH_OPEN_CLASSES_ERROR];
}
/**
* Returns true if there is at least a sink but no open classes have been defined
* @return true if the problem occours
*/
public boolean isThereSinkButNoOpenClassError() {
return errors[SINK_BUT_NO_OPEN_CLASSES_ERROR];
}
/**
* Returns true if there is at least one open class but no source has been defined
* @return true if the problem occours
*/
public boolean isThereOpenClassButNoSourceError() {
return errors[OPEN_CLASS_BUT_NO_SOURCE_ERROR];
}
/**
* Returns true if there is at least one station link error
* @return true if the problem occours.
*/
public boolean isThereStationLinkError() {
return errors[STATION_LINK_ERROR];
}
/**
* Returns true if there is at least one closed class routed into a station whose
* forward stations are all sink
* @return true if at least one routing problem was found
*/
public boolean isThereAllForwardStationsAreSinkErrors() {
return errors[ALL_FORWARD_STATION_ARE_SINK_ERROR];
}
/**
* Returns true if there is at least one routing error (a closed class routed into a sink)
* @return true if at least one routing problem was found
*/
public boolean isThereRoutingError() {
return errors[ROUTING_ERROR];
}
/**
* Returns true if no measures have been defined
* @return true if the problem occours
*/
public boolean isThereSimulationError() {
return errors[SIMULATION_ERROR];
}
/**
* Returns true if the same measure is defined more than one time
* @return true if the same measure is defined more than one time
*/
public boolean isThereMeasureError() {
return errors[DUPLICATE_MEASURE_ERROR];
}
/**
* Returns true if there is at least one measure with at least one
* 'null' field
* @return true if the same measure is defined more than one time
*/
public boolean isThereInconsistentMeasureError() {
return errors[INCONSISTENT_MEASURE_ERROR];
}
public boolean isTherejoinWithoutForkError() {
return errors[JOIN_WITHOUT_FORK_ERROR];
}
/**
* Returns if a blocking region without stations error occurred
* @return if a blocking region without stations error occurred
* <br>Author: Bertoli Marco
*/
public boolean isThereEmptyBlockingRegionError() {
return errors[EMPTY_BLOCKING_REGION];
}
/**
* Returns if a station in a blocking region is preloaded
* @return if a station in a blocking region is preloaded
* <br>Author: Bertoli Marco
*/
public boolean isTherePreloadingInBlockingRegionError() {
return errors[PRELOADING_WITH_BLOCKING];
}
/**
* Checks the presence in the model of a non exponential time distribution. This is an
* error only if user is trying to convert the model to JMVA
* @return true if at least one non-exponential time distribution is found
*/
/*public boolean isThereNoExpFoundWarning() {
return warnings[NO_EXP_FOUND_WARNING];
}
/**
* To be used only for the JSim/JModel to JMVA conversion
* @return true if there is at least one open class without a reference station
*/
/*public boolean isThereOpenClassReferenceStationError() {
return errors[OPEN_CLASS_REFERENCE_STATION_ERROR];
}*/
/**
* use it to check if there is at least one non FCFS queue policy in the model
* @return true if at least one non FCFS queue policy is found in the model
*/
/*public boolean isThereNonFCFSWarning() {
return warnings[NON_FCFS_WARNING];
}
/**
* Checks if there are delays in the model
* @return true if at least a delay is found
*/
/*public boolean isThereDelaysFoundError() {
return errors[DELAYS_FOUND_ERROR];
}*/
/**
* Returns true if more than one Sink have been defined. In order to maintain
* the accuracy of the measured throughput.
* @return true if more than one Sink have been defined
*/
public boolean isThereMoreThanOneSinkWarning() {
return warnings[MORE_THAN_ONE_SINK_WARNING];
}
/**
* Checks if there is a station (not a sink or a source) no backward linked
* @return true if there is at least a station (not a sink or a source) no backward linked
*/
public boolean isThereNoBackwardLinkWarning() {
return warnings[NO_BACKWARD_LINK_WARNING];
}
/**
* Returns true if the PARAMETRIC_ANALYSIS_MODEL_MODIFIED_WARNING occours
* @return true if the parametric analysis model had become inconsistent
* consequently it was modified
*/
public boolean isThereParametricAnalysisModelModifiedWarning() {
return warnings[PARAMETRIC_ANALYSIS_MODEL_MODIFIED_WARNING];
}
/**
* Returns true if PARAMETRIC_ANALYSIS_NO_MORE_AVAIBLE_WARNING occours
* @return true if no PA are avaible but a PA model was previously defined
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -