Class EntityReceiver

    • Field Detail

      • mySendOption

        protected EntityType.SendOption mySendOption
        The option used by the receiver for sending entities.
      • myTimeInReceiver

        protected ResponseVariable myTimeInReceiver
        Used to collect time spent at receiver
      • myNumInReceiver

        protected TimeWeighted myNumInReceiver
        Used to collect number of entities at the receiver
      • myDirectEntityReceiver

        protected EntityReceiverAbstract myDirectEntityReceiver
        This can be used to directly specify the next receiver
      • myComposite

        protected EntityReceiver myComposite
        If the EntityReceiver is part of a CompositeReceiver this attribute contains the reference to the composite
      • mySender

        protected EntitySenderIfc mySender
        Used if the sending option is
    • Constructor Detail

      • EntityReceiver

        public EntityReceiver​(ModelElement parent)
      • EntityReceiver

        public EntityReceiver​(ModelElement parent,
                              java.lang.String name)
    • Method Detail

      • turnOnTimeInReceiverCollection

        public final void turnOnTimeInReceiverCollection()
        Causes the receiver to collect the time spent at the receiver. This must be called prior to any replications
      • turnOnNumberInReceiverCollection

        public final void turnOnNumberInReceiverCollection()
        Causes the receiver to collect the number of entity's at the receiver. This must be called prior to any replications
      • setComposite

        protected void setComposite​(EntityReceiver composite)
      • isPartOfComposite

        public boolean isPartOfComposite()
      • receive

        protected abstract void receive​(Entity entity)
        Represents logic to correctly receive the entity and process it accordingly
        Parameters:
        entity -
      • sendEntity

        protected void sendEntity​(Entity e)
        Can be used by sub-classes to send the entity to its next receiver according to one of the specified options.
        Parameters:
        e -
      • setEntitySender

        public final void setEntitySender​(EntitySenderIfc sender)
        Supply a sender to be used to send the entity If null is supplied the option is set to SendOption.NONE
        Parameters:
        sender -
      • setSendingOption

        public final void setSendingOption​(EntityType.SendOption option)
        Sets the sending option SendOption {DIRECT, SEQ, BY_TYPE} DIRECT, client must use setDirectEntityReceiver() to set receiver SEQ, entity uses predefined sequence in its EntityType BY_TYPE, entity uses its EntityType to determine next receiver
        Parameters:
        option -
      • getDirectEntityReceiver

        public final EntityReceiverAbstract getDirectEntityReceiver()
        An object that will directly receive the entity
        Returns:
      • setDirectEntityReceiver

        public final void setDirectEntityReceiver​(EntityReceiverAbstract receiver)
        Can be used to supply a direct receiver. If used the sending option is automatically changed to direct
        Parameters:
        receiver -
      • setDirectEntityReceiver

        public final void setDirectEntityReceiver​(GetEntityReceiverIfc g)
        See setDirectEntityReceiver()
        Parameters:
        g -