Class PR

    • Constructor Detail

      • PR

        public PR()
    • Method Detail

      • init

        public void init()
        This method is called upon start of a simulation to perform any initializations required.
      • beforeCalc

        public void beforeCalc​(PriorityQueue<? extends PrioRuleTarget> q)
        This method is called by a queue before evaluating it's elements. Use it to do some initialization prior to calcPrio().
        Parameters:
        q - The current queue.
      • calcPrio

        public abstract double calcPrio​(PrioRuleTarget entry)
        Returns the priority value of entry. This method has to be overwritten by a priority rule.
      • keepIdle

        public boolean keepIdle()
        If this method returns true, the machine is kept idle. This method is called after beforeCalc(PriorityQueue) but before calcPrio(PrioRuleTarget).
      • getName

        public String getName()
      • setTieBreaker

        public void setTieBreaker​(PR tieBreaker)
        Sets the tie breaker rule to use.
        Parameters:
        tieBreaker - The tie-breaker to use.
      • setFinalTieBreaker

        public PR setFinalTieBreaker​(PR tieBreaker)
        Convenience method to set the last tie breaker rule in a chain. The chain of rules is traversed until a rule without a tie breaker is found. The tie breaker of this rule is set to tieBreaker.
        Parameters:
        tieBreaker - The tie-breaker to use.
        Returns:
        The main rule, i.e., this.
        See Also:
        setTieBreaker(PR)
      • getTieBreaker

        public PR getTieBreaker()
      • primaryRule

        public PR primaryRule()
        If this rule is used as a tie-breaker for another rule, PrimaryRule points to the rule this rule is the tieBreaker for, i.e. this.primaryRule().getTieBreaker()==this.
      • arrivesTooLate

        public boolean arrivesTooLate​(PrioRuleTarget j)