Class ClassCoverageUtils
java.lang.Object
solvers.queueingnet.treeAlgorithms.ClassCoverageUtils
Implements functionality related to class coverage.
- Author:
- Ben Homer, 2014.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum to represent the 3 types of class coverages: fully-covered, partially-covered and non-covered, as defined in the LamLien83 paper. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintCalculates the weight of a subnetwork by implementing equation (10) from the LamLien83 paper.Contracts a population vector to the necessary size depending on partially covered classes in smallPcs.intconvertIndex(int idx, TreeSet<Integer> oldPcs, TreeSet<Integer> newPcs) Finds the index of a class in one set (oldPcs) then calculates the classes index in the new set (newPcs).static ClassCoverageUtilsCreates a local instance of a ClassCoverageUtils object to be used.expand(PopulationVector oldPopVec, TreeSet<Integer> oldPcs, PopulationVector newPopVec, TreeSet<Integer> newPcs) Expands a population vector to the necessary size depending on partially covered classes in newPcs.getClassCoverage(int cls, TreeSet<Integer> subnet) With respect to a subset of stations (SUBNET), a) a class of customers is fully covered if the stations that the class visits are a subset of SUBNET, b) a class of customers is noncovered if the intersection between the stations that the class visits and SUBNET is empty, c) a class of customers is partially covered if only some of the stations that the class visits are in SUBNET.getCoveredClasses(ClassCoverageUtils.Covered cover, TreeSet<Integer> subnet) Gets the classes which are covered by subnet, with specified level of coverage.intGets the index of the specified class in a set of classes.static ClassCoverageUtilsinst()Gets the local ClassCoverageUtils instance.nextPermutation(PopulationVector pv, PopulationVector orig) Returns the next permutation of a population vector to be used in the convolution computation, given the current vector and the original start vector.Returns the next permutation of a population vector to be used in the convolution computation, given the current vector and the original start vector.
-
Field Details
-
all
-
-
Method Details
-
create
Creates a local instance of a ClassCoverageUtils object to be used.- Parameters:
qnm- The queueing network model we are trying to solve.- Returns:
- The local ClassCoverageUtils instance.
-
inst
Gets the local ClassCoverageUtils instance.- Returns:
- The local ClassCoverageUtils instance.
-
getClassCoverage
With respect to a subset of stations (SUBNET), a) a class of customers is fully covered if the stations that the class visits are a subset of SUBNET, b) a class of customers is noncovered if the intersection between the stations that the class visits and SUBNET is empty, c) a class of customers is partially covered if only some of the stations that the class visits are in SUBNET.- Parameters:
cls- The class of customers.subnet- The subnetwork of stations.- Returns:
- An enum describing whether the class is fully, non or partially covered with respect to the subnetwork.
-
getCoveredClasses
public TreeSet<Integer> getCoveredClasses(ClassCoverageUtils.Covered cover, TreeSet<Integer> subnet) Gets the classes which are covered by subnet, with specified level of coverage.- Parameters:
cover- The level of coverge we are looking for.subnet- The subnetwork of stations to examine.- Returns:
- the resulting tree set
-
calculateSubnetWeight
Calculates the weight of a subnetwork by implementing equation (10) from the LamLien83 paper.- Parameters:
n- The tree node to calculate the subnet weight at (subnet consists of all descendents).- Returns:
- The weight of the subnetwork.
-
contract
public PopulationVector contract(PopulationVector largePopVec, TreeSet<Integer> largePcs, TreeSet<Integer> smallPcs) Contracts a population vector to the necessary size depending on partially covered classes in smallPcs.- Parameters:
largePopVec- The population vector containing populations for each class in largePcs.largePcs- The set of partially covered classes corresponding to the largePopVec.smallPcs- The set of partially covered classes we want to find populations for.- Returns:
- The population vector containing populations for each class in smallPcs.
-
expand
public PopulationVector expand(PopulationVector oldPopVec, TreeSet<Integer> oldPcs, PopulationVector newPopVec, TreeSet<Integer> newPcs) Expands a population vector to the necessary size depending on partially covered classes in newPcs.- Parameters:
oldPopVec- The population vector.oldPcs- The old set of partially covered classes.newPopVec- The population vector containing max values for all classes in newPcs.newPcs- The news set of partially covered classes.- Returns:
-
getIndex
-
convertIndex
Finds the index of a class in one set (oldPcs) then calculates the classes index in the new set (newPcs).- Parameters:
idx- The index of the class.oldPcs- The set to find the class in initially.newPcs- The set for which an index is calculated.- Returns:
- The index of the class in newPcs.
-
nextPermutation
Returns the next permutation of a population vector to be used in the convolution computation, given the current vector and the original start vector.- Parameters:
pv- The current permutation of the vector.orig- The original/start permutation of the vector.- Returns:
- The next permutation of the vector.
-
nextPermutationUpwards
Returns the next permutation of a population vector to be used in the convolution computation, given the current vector and the original start vector. This version counts upwards instead of down.- Parameters:
pv- The current permutation of the vector.orig- The original/start permutation of the vector.- Returns:
- The next permutation of the vector.
-