📄 modelchecker.java
字号:
*/
public boolean isThereParametricAnalysisNoMoreAvaibleWarning() {
return warnings[PARAMETRIC_ANALYSIS_NO_MORE_AVAIBLE_WARNING];
}
/**
* Checks if the service times for different classes are different inside the same station
* @return true if the problem occours
*/
/*public boolean isThereDifferentServiceTimeWarning() {
return warnings[DIFFERENT_SERVICE_TIME_WARNING];
}
*/
/**
* Checks if there are servers with per class different queueing
* strategy
* @return true if servers with per class different queueing strategy
* are found
*/
public boolean isThereBCMPDifferentQueueingStrategyWarning() {
return warnings[BCMP_DIFFERENT_QUEUEING_STRATEGIES_WARNING];
}
/**
* Checks if there are FCFS servers with a mixed service type
* @return true if FCFS servers with with a mixed service type
* are found
*/
public boolean isThereBCMPDifferentServiceTypeWarning() {
return warnings[BCMP_FCFS_DIFFERENT_SERVICE_TYPES_WARNING];
}
/**
* Checks if there are FCFS servers with omogeneous but non
* exponential service type
*
* @return true if FCFS servers with omogeneous but non
* exponential service type are found
*/
public boolean isThereBCMPFcfsNonExponentialWarning() {
return warnings[BCMP_FCFS_EXPONENTIAL_WARNING];
}
/**
* Checks if there are FCFS servers with omogeneous exponential
* service type, but with different per class service times mean
* values. If the service type is Load Dependent it checks that
* for each class the load dependent strategies are the same, i.e. :
* <br>1) have the same number of ranges</br>
* <br>2) have the same distribution in each range (Exponential)</br>
* <br>3) have the same mean value in each range</br>
* <br>4) have the same 'from' and 'to' values in each range</br>
*
* @return true if FCFS servers with omogeneous exponential
* service type with different per class service times mean
* values are found
*/
public boolean isThereBCMPFcfsDifferentServiceTimesWarning() {
return warnings[BCMP_FCFS_DIFFERENT_SERVICE_TIMES_WARNING];
}
/**
* Checks if there are delays with a service time distribution whose
* Laplace transform is not rational
*
* @return true if delays with a service time distribution whith
* a non rational Laplace transform are found
*/
public boolean isThereBCMPDelayWarning() {
return warnings[BCMP_DELAY_WARNING];
}
/**
* Checks if there are LCFS-PR stations with service time
* distribution whose Laplace transform is not rational
*
* @return true if LCFS-PR stations with service time
* distribution whose Laplace transform is not rational
*/
public boolean isThereBCMPLcfsPrWarning() {
return warnings[BCMP_LCFS_PR_WARNING];
}
public boolean isThereForkWithoutJoinWarnings() {
return warnings[FORK_WITHOUT_JOIN_WARNING];
}
/**
* Checks if there are stations with Processor Sharing service
* strategy with a service time distribution whose Laplace transform
* is not rational
*
* @return true if stations with Processor Sharing service
* strategy with a service time distribution whose Laplace
* transform is not rational are found
*/
public boolean isThereBCMPProcessorSharingWarning() {
return warnings[BCMP_PROCESSOR_SHARING_WARNING];
}
/**
* Use it to check if a non random routing is used
* @return true if a non random routing is used
*/
public boolean isThereBCMPNonStateIndependentRoutingWarning() {
return warnings[BCMP_NON_STATE_INDEPENDENT_ROUTING_WARNING];
}
/**
* Returns a Vector containing the keys of the classes without a reference station. If every
* has a reference station returns null.
* @return a Vector containing the keys of the classes without a reference station.
*/
public Vector getKeysOfClassesWithoutRefStation() {
if (errors[REFERENCE_STATION_ERROR]) return classesWithoutRefStation;
else return null;
}
/**
* Returns a Vector containing the keys of OPEN classes without a reference station. If each
* open class has a reference station returns null.
* @return a Vector containing the keys of the classes without a reference station.
*/
/*public Vector getKeysOfOpenClassesWithoutRefStation() {
if (errors[OPEN_CLASS_REFERENCE_STATION_ERROR]) return openClassesWithoutRefStation;
else return null;
}*/
/**
* Returns a Vector containing the keys of the sources witch have no classes associated to. If every
* source has a reference station or no source are defined returns null.
* @return a Vector containing the keys of the sources with no classes associated to.
*/
public Vector getKeysOfSourceWithoutClasses () {
if (errors[SOURCE_WITH_NO_OPEN_CLASSES_ERROR]) return sourceWithoutClasses;
else return null;
}
/**
* Returns a Vector containing the keys of the stations whith link problems, such as:
* <br>- a Source not forward linked.
* <br>- a Server not forward linked.
* <br>- a Delay not forward linked.
* <br>- a Sink not backward linked.
* <br><br>If there isn't any problem it returns null.
* @return a Vector containing the keys of the stations with link problems.
*/
public Vector getKeysOfStationsWithLinkProblems() {
if (errors[STATION_LINK_ERROR]) return stationsWithLinkErrors;
else return null;
}
/**
* Returns a vector with all empty blocking regions
* @return a vector with all empty blocking regions keys.
*/
public Vector getKeysOfEmptyBlockingRegions() {
if (errors[EMPTY_BLOCKING_REGION]) return emptyBlockingRegions;
else return null;
}
/**
* Returns a HashMap where the key is the key of a close class. For each close class that may
* be routed into a station whose forward stations are all sink it contains a Vector with the
* keys of the stations where the problems occours. If there isn't any problem or no close
* classes are defined it returns null.
* @return a HashMap where the key is the key of a close class.
*/
public HashMap getKeysOfAllForwardStationsAreSinkErrors() {
if (errors[ALL_FORWARD_STATION_ARE_SINK_ERROR]) return allForwardStationsAreSinkErrors;
else return null;
}
/**
* Returns a HashMap where the key is the key of a close class. For each close class with a routing
* problem it contains a Vector with the keys of the stations where the routing problems occours. If there isn't any problem
* or no close classes are defined it returns null.
* @return a HashMap where the key is the key of a close class.
*/
public HashMap getKeysOfRoutingProblems() {
if (errors[ROUTING_ERROR]) return routingErrors;
else return null;
}
/**
* Get the Vector with station (no Sinks or Sources) not backward connected. Used
* for warnings.
* @return the Vector with station (no Sinks or Sources) not backward connected.
*/
public Vector getKeysOfStationWithoutBackwardLinks() {
if (warnings[NO_BACKWARD_LINK_WARNING]) return stationWithoutBackwardLinks;
else return null;
}
/**
* Use it to get a Vector containing the keys of servers with per
* class different queue startegies
* @return a Vector containing the keys of servers with per class
* different queue startegies
*/
public Vector getBCMPserversWithDifferentQueueStrategy() {
return BCMPserversWithDifferentQueueStrategy;
}
/**
* Use it to get a Vector containing the keys of servers with FCFS
* queueing strategy but mixed types of service
* @return a Vector containing the keys of servers with FCFS
* queueing strategy but mixed types of service
*/
public Vector getBCMPserversWithDifferentServiceTypes() {
return BCMPserversWithDifferentServiceTypes;
}
/**
* Use it to get a Vector containing the keys of servers with FCFS
* queueing strategy but a non exponential distribution
* @return a Vector containing the keys of servers with FCFS
* queueing strategy but a non exponential distribution
*/
public Vector getBCMPserversFCFSWithoutExponential() {
return BCMPserversFCFSWithoutExponential;
}
/**
* Use it to get a Vector containing the keys of servers with FCFS
* queueing strategy, exponential distribution but different per
* class service times
* @return a Vector containing the keys of servers with FCFS
* queueing strategy, exponential distribution but different per
* class service times
*/
public Vector getBCMPFcfsServersWithDifferentServiceTimes() {
return BCMPFcfsServersWithDifferentServiceTimes;
}
/**
* Use it to get a Vector containing the keys of delays with
* at least a service time distribution with a non rational Laplace
* transform
* @return a Vector containing the keys of delays with
* at least a service time distribution with a non rational Laplace
* transform
*/
public Vector getBCMPdelaysWithNonRationalServiceDistribution() {
return BCMPdelaysWithNonRationalServiceDistribution;
}
/**
* Check that there is at least one class in the model. If a problem is found it raises
* to "true" the corresponding position inside the problems array.
*/
private void checkForNoClassError() {
// get the vector of the keys of the classes
Vector classKeys = class_def.getClassKeys();
//if the vector is empty there are no classes defined in the model
if (classKeys.size() == 0) errors[NO_CLASSES_ERROR] = true;
}
/**
* Check that there is at least one station in the model. If a problem is found it raises
* to "true" the corresponding position inside the problems array.
*/
private void checkForNoStationError() {
boolean noStation = true;
// get the vector of the keys of the elements (stations, sinks, delays, servers)
Vector elements = station_def.getStationKeys();
//check each element...
for (int i=0; i<elements.size();i++) {
Object thisElement = elements.get(i);
String type = station_def.getStationType(thisElement);
if ((!type.equals(STATION_TYPE_SOURCE)) && (!type.equals(STATION_TYPE_SINK))) noStation = false;
}
if (noStation) errors[NO_STATION_ERROR] = true;
}
/**
* Checks that every class has a reference station. If a problem is found it raises
* to "true" the corresponding position inside the problems array.
*/
private void checkForRefStationError() {
// get the vector of the keys of the classes
Vector classKeys = class_def.getClassKeys();
for (int i=0; i<classKeys.size();i++) {
//get the key at i
Object thisKey = classKeys.get(i);
//get the Reference Station of the class
Object thisRefStation = class_def.getClassRefStation(thisKey);
//if the class has no reference station there is a class problem
if (thisRefStation == null) {
errors[REFERENCE_STATION_ERROR] = true;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -