Class TransporterSet

    • Constructor Detail

      • TransporterSet

        public TransporterSet​(ModelElement parent)
        Creates a transporter set with the given model element as a parent and assigned a default name.
        Parameters:
        parent -
      • TransporterSet

        public TransporterSet​(ModelElement parent,
                              java.lang.String name)
        Creates a transporter set with the given model element as a parent and the given name.
        Parameters:
        parent -
        name -
    • Method Detail

      • addTransporter

        public final Transporter addTransporter()
        Creates and adds a transporter to the set
        Returns:
      • addTransporter

        public final void addTransporter​(int n)
        Creates the specified number of transporters and add them to the transporter set
        Parameters:
        n - The number of desired transporters (n>0)
      • addTransporter

        public final void addTransporter​(Transporter transporter)
        Adds a transporter to the set
        Parameters:
        transporter -
      • getTransporterIterator

        public final java.util.ListIterator<Transporter> getTransporterIterator()
        Returns an iterator to the transporters in this set
        Returns:
      • selectIdleTransporter

        public Transporter selectIdleTransporter​(QObject request)
        Selects an idle transporter from this TransporterSet for use by the client. Returns null if no idle transporter can be recommended. By default the recommended transporter is whatever transporter is at the top of the list of idle transporters. Since by default the transporters are added to the end of the list when they become idle, this will be the transporter that has been idle the longest. The client can supply a TransporterSelectionRuleIfc rule to change this behavior. Alternately the client can override this method. This method only recommends an idle transporter. It does not remove it from the list of idle transporters. The transporter will remove itself if it become non-idle
        Parameters:
        request -
        Returns:
      • getTransporterSelectionRule

        public final TransporterSelectionRuleIfc getTransporterSelectionRule()
        Returns the current transportation selection rule or null if none
        Returns:
      • setTransporterSelectionRule

        public final void setTransporterSelectionRule​(TransporterSelectionRuleIfc rule)
        Sets the transportation selection rule. The supplied rule is responsible for both recommending an idle transporter (not removing it) and for returning an idle transporter back to the list. This allows the rule to maintain the list in an order if necessary.
        Parameters:
        rule -
      • removeIdleTransporter

        protected boolean removeIdleTransporter​(Transporter transporter)
      • addIdleTransporter

        protected void addIdleTransporter​(Transporter transporter)
      • addTransporterProvider

        protected final boolean addTransporterProvider​(TransporterProvider arg0)