Class Station

  • All Implemented Interfaces:
    java.io.Serializable , jline.lang.Copyable

    
    public abstract class Station
    extends ServiceNode implements Serializable
                        

    A node where jobs can spend time stationing there

    • Constructor Detail

      • Station

        Station(String name)
        Creates a new station with the specified name.
        Parameters:
        name - the name for this station
    • Method Detail

      • getCap

         double getCap()

        Returns the total capacity limit for this node. Default implementation returns infinite capacity.

        Returns:

        the total capacity limit

      • setCapacity

         void setCapacity(int cap)

        Sets the total capacity limit for this station. Capacity follows Kendall notation where K = total system capacity (queue + in-service).

        Parameters:
        cap - the maximum number of jobs that can be at this station
      • setCap

         void setCap(int cap)

        Alias for setCapacity() for backwards compatibility.

        Parameters:
        cap - the maximum number of jobs that can be at this station
      • getClassCap

         double getClassCap(JobClass jobClass)

        Returns the capacity limit for a specific job class at this node. Default implementation returns infinite capacity.

        Parameters:
        jobClass - the job class to query
        Returns:

        the capacity limit for the job class

      • getDropRule

         DropStrategy getDropRule(JobClass jobclass)

        Gets the drop strategy for a specific job class when capacity is exceeded.

        Parameters:
        jobclass - the job class to query
        Returns:

        the drop strategy for the job class, or null if not set

      • getLimitedLoadDependence

         Matrix getLimitedLoadDependence()

        Gets the limited load-dependent scaling matrix for this station.

        Returns:

        the load-dependent scaling matrix

      • setLimitedLoadDependence

         void setLimitedLoadDependence(Matrix alpha)

        Sets the limited load-dependent scaling matrix for this station.

        Parameters:
        alpha - the load-dependent scaling matrix
      • getLimitedJointDependence

         Matrix getLimitedJointDependence()

        Gets the limited joint-dependent scaling matrix for this station.

        Returns:

        the joint-dependent scaling matrix (linearized)

      • setLimitedJointDependence

         void setLimitedJointDependence(Matrix scalingTable, Matrix cutoffs)

        Sets the limited joint-dependent scaling for this station.

        Parameters:
        scalingTable - the linearized scaling table
        cutoffs - the per-class cutoffs [N1, N2, ...
      • getLimitedJointClassDependence

         Map<JobClass, Matrix> getLimitedJointClassDependence()

        Gets the limited joint-class-dependent scaling tables for this station. Each class has its own scaling table indexed by population vector.

        Returns:

        map from JobClass to scaling matrix

      • setLimitedJointClassDependence

         void setLimitedJointClassDependence(Map<JobClass, Matrix> scalingTables, Matrix cutoffs)

        Sets the limited joint-class-dependent scaling for this station. Unlike setLimitedJointDependence which uses a single table for all classes, this method allows each class to have its own scaling table indexed by the population vector (n1, n2, ..., nK).

        Parameters:
        scalingTables - map from JobClass to linearized scaling table
        cutoffs - the per-class cutoffs [N1, N2, ...
      • setNumberOfServers

         void setNumberOfServers(int numberOfServers)

        Sets the number of servers at this station.

        Parameters:
        numberOfServers - the number of servers (use Integer.
      • getSchedStrategy

         SchedStrategy getSchedStrategy()

        Returns the scheduling strategy used by this station.

        Returns:

        the scheduling strategy (FCFS, PS, etc.)

      • getServiceRates

         List<Object> getServiceRates()

        Gets the service rates configured for all job classes at this station. Returns a list containing rate values or Distribution objects.

        Returns:

        list of service rates for each job class

      • getSourceRates

         List<Object> getSourceRates()

        Gets the source (arrival) rates for all job classes at this station. Only applicable for source nodes.

        Returns:

        list of source rates for each job class

      • isReferenceStation

         boolean isReferenceStation()

        Checks if this node is a reference station. Default implementation returns false; override in subclasses as needed.

        Returns:

        true if this is a reference station, false otherwise

      • isServiceDefined

         Array<boolean> isServiceDefined()

        Checks which job classes have defined service processes.

        Returns:

        array indicating which classes have defined service processes

      • isServiceDefined

         boolean isServiceDefined(JobClass jobClass)

        Checks if a specific job class has a defined service process.

        Parameters:
        jobClass - the job class to check
        Returns:

        true if service is defined for this class, false otherwise

      • isServiceDisabled

         Array<boolean> isServiceDisabled()

        Checks which job classes have disabled service processes.

        Returns:

        array indicating which classes have disabled service processes

      • isServiceDisabled

         boolean isServiceDisabled(JobClass jobClass)

        Checks if a specific job class has a disabled service process.

        Parameters:
        jobClass - the job class to check
        Returns:

        true if service is disabled for this class, false otherwise

      • setChainCapacity

         void setChainCapacity(Array<double> values)

        Sets the capacity for each chain in the network. Configures per-class capacity based on chain membership and service availability.

      • setClassCap

         void setClassCap(JobClass jobClass, int cap)

        Sets the capacity limit for a specific job class at this station.

        Parameters:
        jobClass - the job class to set capacity for
        cap - the maximum number of jobs of this class
      • setDropRule

         void setDropRule(JobClass jobclass, DropStrategy drop)

        Sets the drop strategy for a specific job class when capacity is exceeded.

        Parameters:
        jobclass - the job class to configure
        drop - the drop strategy to apply
      • setSwitchoverTime

         void setSwitchoverTime(JobClass fromClass, JobClass toClass, Distribution switchoverTime)

        Sets the switchover time from one job class to another. This is used for class-to-class switchover functionality.

        Parameters:
        fromClass - the job class to switch from
        toClass - the job class to switch to
        switchoverTime - the switchover time distribution
      • getSwitchoverTime

         Distribution getSwitchoverTime(JobClass fromClass, JobClass toClass)

        Gets the switchover time from one job class to another.

        Parameters:
        fromClass - the job class to switch from
        toClass - the job class to switch to
        Returns:

        the switchover time distribution, or null if not set

      • hasSwitchoverTime

         boolean hasSwitchoverTime(JobClass fromClass, JobClass toClass)

        Checks if a switchover time is set for the given job class pair.

        Parameters:
        fromClass - the job class to switch from
        toClass - the job class to switch to
        Returns:

        true if switchover time is set, false otherwise

      • setPatience

         void setPatience(JobClass jobClass, Distribution distribution)

        Sets the patience distribution for a specific job class at this station. Jobs that wait longer than their patience time will abandon the queue. This setting takes precedence over the global class patience. Defaults to RENEGING patience type for backwards compatibility.

        Parameters:
        jobClass - the job class
        distribution - the patience time distribution
      • setPatience

         void setPatience(JobClass jobClass, ImpatienceType impatienceType, Distribution distribution)

        Sets the impatience type and distribution for a specific job class at this station. Jobs that wait longer than their patience time will abandon the queue. This setting takes precedence over the global class patience.

        Parameters:
        jobClass - the job class
        impatienceType - the type of impatience (RENEGING or BALKING)
        distribution - the patience time distribution
      • getPatience

         Distribution getPatience(JobClass jobClass)

        Gets the effective patience distribution for a specific job class. Returns the station-specific setting if available, otherwise falls back to the global class patience.

        Parameters:
        jobClass - the job class
        Returns:

        the patience distribution, or null if not set

      • getPatienceLocal

         Distribution getPatienceLocal(JobClass jobClass)

        Gets the station-specific patience distribution (without fallback).

        Parameters:
        jobClass - the job class
        Returns:

        the station-specific patience distribution, or null if not set

      • getImpatienceType

         ImpatienceType getImpatienceType(JobClass jobClass)

        Gets the effective impatience type for a specific job class. Returns the station-specific setting if available, otherwise falls back to the global class impatience type.

        Parameters:
        jobClass - the job class
        Returns:

        the impatience type, or null if not set

      • getImpatienceTypeLocal

         ImpatienceType getImpatienceTypeLocal(JobClass jobClass)

        Gets the station-specific impatience type (without fallback).

        Parameters:
        jobClass - the job class
        Returns:

        the station-specific impatience type, or null if not set

      • hasPatience

         boolean hasPatience(JobClass jobClass)

        Checks if patience is configured for a job class (local or global).

        Parameters:
        jobClass - the job class
        Returns:

        true if patience is configured, false otherwise

      • hasPatienceLocal

         boolean hasPatienceLocal(JobClass jobClass)

        Checks if patience is configured locally at this station.

        Parameters:
        jobClass - the job class
        Returns:

        true if local patience is configured, false otherwise

      • setBalking

         void setBalking(JobClass jobClass, BalkingStrategy strategy, List<BalkingThreshold> thresholds)

        Sets the balking configuration for a specific job class at this station. This setting takes precedence over the global class balking configuration.

        Parameters:
        jobClass - the job class
        strategy - the balking strategy to use
        thresholds - list of balking thresholds mapping queue lengths to probabilities
      • setBalking

         void setBalking(JobClass jobClass, BalkingStrategy strategy, int minJobs, double probability)

        Sets the balking configuration using a single threshold. Convenience method for simple balking configurations.

        Parameters:
        jobClass - the job class
        strategy - the balking strategy to use
        minJobs - minimum queue length to trigger balking
        probability - balking probability when queue length >= minJobs
      • getBalkingStrategy

         BalkingStrategy getBalkingStrategy(JobClass jobClass)

        Gets the effective balking strategy for a specific job class. Returns the station-specific setting if available, otherwise falls back to the global class balking strategy.

        Parameters:
        jobClass - the job class
        Returns:

        the balking strategy, or null if not configured

      • getBalkingStrategyLocal

         BalkingStrategy getBalkingStrategyLocal(JobClass jobClass)

        Gets the station-specific balking strategy (without fallback).

        Parameters:
        jobClass - the job class
        Returns:

        the station-specific balking strategy, or null if not set

      • getBalkingThresholds

         List<BalkingThreshold> getBalkingThresholds(JobClass jobClass)

        Gets the effective balking thresholds for a specific job class. Returns the station-specific setting if available, otherwise falls back to the global class balking thresholds.

        Parameters:
        jobClass - the job class
        Returns:

        the balking thresholds, or null if not configured

      • getBalkingThresholdsLocal

         List<BalkingThreshold> getBalkingThresholdsLocal(JobClass jobClass)

        Gets the station-specific balking thresholds (without fallback).

        Parameters:
        jobClass - the job class
        Returns:

        the station-specific balking thresholds, or null if not set

      • hasBalking

         boolean hasBalking(JobClass jobClass)

        Checks if balking is configured for a job class (local or global).

        Parameters:
        jobClass - the job class
        Returns:

        true if balking is configured, false otherwise

      • hasBalkingLocal

         boolean hasBalkingLocal(JobClass jobClass)

        Checks if balking is configured locally at this station.

        Parameters:
        jobClass - the job class
        Returns:

        true if local balking is configured, false otherwise

      • setRetrial

         void setRetrial(JobClass jobClass, Distribution delayDistribution, int maxAttempts)

        Sets the retrial configuration for a specific job class at this station. This setting takes precedence over the global class retrial configuration.

        Parameters:
        jobClass - the job class
        delayDistribution - the distribution for retrial delay times
        maxAttempts - maximum retry attempts (-1 for unlimited, 0 for no retries)
      • setRetrial

         void setRetrial(JobClass jobClass, Distribution delayDistribution)

        Sets the retrial configuration with unlimited retry attempts.

        Parameters:
        jobClass - the job class
        delayDistribution - the distribution for retrial delay times
      • getRetrialDelayDistribution

         Distribution getRetrialDelayDistribution(JobClass jobClass)

        Gets the effective retrial delay distribution for a specific job class. Returns the station-specific setting if available, otherwise falls back to the global class retrial distribution.

        Parameters:
        jobClass - the job class
        Returns:

        the retrial delay distribution, or null if not configured

      • getRetrialDelayDistributionLocal

         Distribution getRetrialDelayDistributionLocal(JobClass jobClass)

        Gets the station-specific retrial delay distribution (without fallback).

        Parameters:
        jobClass - the job class
        Returns:

        the station-specific retrial delay distribution, or null if not set

      • getMaxRetrialAttempts

         int getMaxRetrialAttempts(JobClass jobClass)

        Gets the effective maximum retrial attempts for a specific job class. Returns the station-specific setting if available, otherwise falls back to the global class max attempts.

        Parameters:
        jobClass - the job class
        Returns:

        maximum attempts (-1 for unlimited), or -1 if not configured

      • getMaxRetrialAttemptsLocal

         Integer getMaxRetrialAttemptsLocal(JobClass jobClass)

        Gets the station-specific maximum retrial attempts (without fallback).

        Parameters:
        jobClass - the job class
        Returns:

        the station-specific max attempts, or null if not set

      • hasRetrial

         boolean hasRetrial(JobClass jobClass)

        Checks if retrial is configured for a job class (local or global).

        Parameters:
        jobClass - the job class
        Returns:

        true if retrial is configured, false otherwise

      • hasRetrialLocal

         boolean hasRetrialLocal(JobClass jobClass)

        Checks if retrial is configured locally at this station.

        Parameters:
        jobClass - the job class
        Returns:

        true if local retrial is configured, false otherwise