Package jline.solvers
Class AvgHandle
java.lang.Object
jline.solvers.AvgHandle
Handle for managing performance metrics organized by station and job class.
AvgHandle provides a structured way to store and access performance metrics (such as throughput, utilization, queue length, response time) that are computed by LINE solvers. The metrics are organized in a two-level hierarchy: first by station (queue, delay, etc.) and then by job class.
This class acts as a container that maps each (station, job class) pair to its corresponding performance metric. It provides methods for storing, retrieving, and managing these metrics efficiently.
Example usage:
AvgHandle handle = new AvgHandle(); handle.put(queue1, classA, new Metric(MetricType.Throughput, 2.5)); Metric throughput = handle.get(queue1, classA);
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()Retrieves the complete data structure containing all metrics.Retrieves all metrics for a specific station across all job classes.Retrieves the metric for a specific station and job class.booleanChecks if a metric exists for the specified station and job class.booleanisEmpty()Checks if this handle contains no metrics.keySet()Returns the set of all stations that have metrics stored.voidStores a metric for a specific station and job class.voidRemoves the metric for a specific station and job class.
-
Constructor Details
-
AvgHandle
public AvgHandle()Constructs an empty AvgHandle.
-
-
Method Details
-
get
Retrieves the metric for a specific station and job class.- Parameters:
station- the station to queryjobClass- the job class to query- Returns:
- the metric for the given station and job class, or null if not found
-
get
Retrieves all metrics for a specific station across all job classes.- Parameters:
station- the station to query- Returns:
- a map from job class to metric for the given station, empty if station not found
-
get
Retrieves the complete data structure containing all metrics.- Returns:
- the full nested map: Station -> JobClass -> Metric
-
hasMetric
Checks if a metric exists for the specified station and job class.- Parameters:
station- the station to checkjobClass- the job class to check- Returns:
- true if a metric exists for the given station and job class, false otherwise
-
isEmpty
public boolean isEmpty()Checks if this handle contains no metrics.- Returns:
- true if no metrics are stored, false otherwise
-
keySet
Returns the set of all stations that have metrics stored.- Returns:
- a set containing all stations with stored metrics
-
put
Stores a metric for a specific station and job class.- Parameters:
station- the station associated with the metricjobClass- the job class associated with the metricmetric- the metric value to store
-
remove
Removes the metric for a specific station and job class.If this removal leaves the station with no job classes, the station entry is also removed from the data structure.
- Parameters:
station- the station to remove fromjobClass- the job class to remove
-