Package jline.solvers

Class AvgHandle

java.lang.Object
jline.solvers.AvgHandle

public class AvgHandle extends Object
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 Details

    • AvgHandle

      public AvgHandle()
      Constructs an empty AvgHandle.
  • Method Details

    • get

      public Metric get(Station station, JobClass jobClass)
      Retrieves the metric for a specific station and job class.
      Parameters:
      station - the station to query
      jobClass - the job class to query
      Returns:
      the metric for the given station and job class, or null if not found
    • get

      public Map<JobClass,Metric> get(Station station)
      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

      public Map<Station,Map<JobClass,Metric>> get()
      Retrieves the complete data structure containing all metrics.
      Returns:
      the full nested map: Station -> JobClass -> Metric
    • hasMetric

      public boolean hasMetric(Station station, JobClass jobClass)
      Checks if a metric exists for the specified station and job class.
      Parameters:
      station - the station to check
      jobClass - 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

      public Set<Station> keySet()
      Returns the set of all stations that have metrics stored.
      Returns:
      a set containing all stations with stored metrics
    • put

      public void put(Station station, JobClass jobClass, Metric metric)
      Stores a metric for a specific station and job class.
      Parameters:
      station - the station associated with the metric
      jobClass - the job class associated with the metric
      metric - the metric value to store
    • remove

      public void remove(Station station, JobClass jobClass)
      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 from
      jobClass - the job class to remove