Class Transporter

    • Field Detail

      • STATE_CHANGE

        public static final int STATE_CHANGE
        Indicates that the transporter has changed state to its observers
      • myTransporterSets

        protected java.util.Set<TransporterSet> myTransporterSets
        The list of transporter sets currently holding this transporter
      • myCurrentPath

        protected Path myCurrentPath
        A variable that can be used to hold the path once found
      • myPathFinder

        protected PathFinder myPathFinder
        An object that knows how to find the path for this transporter
      • myCreatedState

        protected Transporter.Created myCreatedState
        The created state is used when the transporter is first created. Can transition to inactive state or idle state
      • myIdleState

        protected Transporter.Idle myIdleState
        Represents the state of being active but not busy Can become inactive, moving idle, or allocated
      • myInactiveState

        protected Transporter.Inactive myInactiveState
        Inactive means that it is unavailable. Can only transition to active state
      • myAllocatedState

        protected Transporter.Allocated myAllocatedState
        Represents the state of being allocated to do a transport Busy, but not yet moving
      • myIdleMoveCompletionListener

        protected IdleMoveCompletionIfc myIdleMoveCompletionListener
        Can be supplied to give logic for the transporter when an idle move is completed
      • myEmptyMoveCompletionListener

        protected EmptyMoveCompletionIfc myEmptyMoveCompletionListener
        Can be supplied to give logic for the transporter for when an empty move is completed.
      • myLoadedMoveCompletionListener

        protected TransportCompletionIfc myLoadedMoveCompletionListener
        Can be supplied to provide logic for the transporter for when a loaded move is completed
      • myLoadingState

        protected State myLoadingState
        Can be used by clients to collect the time spent loading
      • myUnloadingState

        protected State myUnloadingState
        Can be used by clients to collect the time spent unloading
    • Constructor Detail

      • Transporter

        public Transporter​(ModelElement parent)
        Creates a Transporter2D with (0.0, 0.0) position. The SpatialModel2D of the parent is used as the SpatialModel2D. If the parent does not have a SpatialModel2D, then an IllegalArgumentException is thrown
        Parameters:
        parent - the parent
      • Transporter

        public Transporter​(ModelElement parent,
                           java.lang.String name)
        Creates a Transporter2D with (0.0, 0.0) position. The SpatialModel2D of the parent is used as the SpatialModel2D. If the parent does not have a SpatialModel2D, then an IllegalArgumentException is thrown
        Parameters:
        parent - the parent
        name - the name of the transporter
      • Transporter

        public Transporter​(ModelElement parent,
                           double x,
                           double y)
        Creates a Transporter2D with the given (x,y) position. The SpatialModel2D of the parent is used as the SpatialModel2D. If the parent does not have a SpatialModel2D, then an IllegalArgumentException is thrown
        Parameters:
        parent - the parent
        x - the initial x position
        y - the initial y position
      • Transporter

        public Transporter​(ModelElement parent,
                           CoordinateIfc position)
        Creates a Transporter2D with at the coordinates of the supplied position. The SpatialModel2D of the parent is used as the SpatialModel2D. If the parent does not have a SpatialModel2D, then an IllegalArgumentException is thrown
        Parameters:
        parent - the parent
        position - the initial position
      • Transporter

        public Transporter​(ModelElement parent,
                           java.lang.String name,
                           SpatialModel spatialModel)
        Creates a Transporter2D with the given parent and SpatialModel2D. The default position is (0.0, 0.0). If the SpatialModel2D is null, the SpatialModel2D of the parent is used as the SpatialModel2D. If the parent does not have a SpatialModel2D, then an IllegalArgumentException is thrown
        Parameters:
        parent - the parent
        name - the name of the transporter
        spatialModel - the spatial model
      • Transporter

        public Transporter​(ModelElement parent,
                           SpatialModel spatialModel)
        Creates a Transporter2D with the given parent and SpatialModel2D. The default position is (0.0, 0.0). If the SpatialModel2D is null, the SpatialModel2D of the parent is used as the SpatialModel2D. If the parent does not have a SpatialModel2D, then an IllegalArgumentException is thrown
        Parameters:
        parent - the parent
        spatialModel - the spatial model
      • Transporter

        public Transporter​(ModelElement parent,
                           java.lang.String name,
                           SpatialModel spatialModel,
                           double x,
                           double y)
        Creates a Transporter2D with the given parent and SpatialModel2D. If the SpatialModel2D is null, the SpatialModel2D of the parent is used as the SpatialModel2D. If the parent does not have a SpatialModel2D, then an IllegalArgumentException is thrown
        Parameters:
        parent - the parent
        name - the name of the transporter
        spatialModel - the spatial model
        x - the initial x position
        y - the initial y position
      • Transporter

        public Transporter​(ModelElement parent,
                           java.lang.String name,
                           SpatialModel spatialModel,
                           double x,
                           double y,
                           double z)
        Creates a Transporter2D with the given parent and SpatialModel2D. If the SpatialModel2D is null, the SpatialModel2D of the parent is used as the SpatialModel2D. If the parent does not have a SpatialModel2D, then an IllegalArgumentException is thrown
        Parameters:
        parent - the parent
        name - the name of the transporter
        spatialModel - the spatial model
        x - the initial x position
        y - the initial y position
        z - the initial z position
      • Transporter

        public Transporter​(ModelElement parent,
                           java.lang.String name,
                           SpatialModel spatialModel,
                           CoordinateIfc coordinate)
        Creates a Transporter2D with the given parent and SpatialModel2D. If the SpatialModel2D is null, the SpatialModel2D of the parent is used as the SpatialModel2D. If the parent does not have a SpatialModel2D, then an IllegalArgumentException is thrown
        Parameters:
        parent - the parent
        name - the name of the transporter
        spatialModel - the spatial model
        coordinate - the initial coordinate
    • Method Detail

      • isCreated

        public final boolean isCreated()
      • isIdle

        public final boolean isIdle()
      • isBusy

        public final boolean isBusy()
      • isInactive

        public final boolean isInactive()
      • isAllocated

        public final boolean isAllocated()
      • isAllocatedMovingEmpty

        public final boolean isAllocatedMovingEmpty()
      • isAllocatedMovingLoaded

        public final boolean isAllocatedMovingLoaded()
      • isMovingIdle

        public final boolean isMovingIdle()
      • activate

        public void activate()
      • inactivate

        public void inactivate()
      • allocate

        public void allocate()
      • free

        public void free()
      • beginLoading

        public final void beginLoading()
        Allows the client to indicate that the transporter is loading It is up to the client to also indicate that loading has ended
      • endLoading

        public final void endLoading()
        Allows the client to indicate that the transporter is done loading. This has no tie to the underlying state transition for the transporter
      • isLoading

        public final boolean isLoading()
        Checks if a client has indicated that the transporter is loading
        Returns:
        true if loading
      • beginUnloading

        public final void beginUnloading()
        Allows the client to indicate that the transporter is unloading It is up to the client to also indicate that unloading has ended This has no tie to the underlying state transition for the transporter
      • endUnloading

        public final void endUnloading()
        Allows the client to indicate that the transporter is done unloading. This has no tie to the underlying state transition for the transporter
      • isUnloading

        public final boolean isUnloading()
        Checks if a client has indicated that the transporter is unloading
        Returns:
        true if unloading
      • initialize

        protected void initialize()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need actions performed to initialize prior to a replication. It is called once before each replication occurs if the model element wants initialization. It is called after beforeReplication() is called
        Overrides:
        initialize in class AbstractMover
      • warmUp

        protected void warmUp()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need actions performed at the warm up event during each replication. It is called once during each replication if the model element reacts to warm up actions.
        Overrides:
        warmUp in class ModelElement
      • afterTripEnds

        protected void afterTripEnds()
        Description copied from class: AbstractMover
        Can be used by subclasses to invoke logic after a trip ends
        Overrides:
        afterTripEnds in class AbstractMover
      • addTransporterSet

        protected final boolean addTransporterSet​(TransporterSet set)
      • removeTransporterSet

        protected final boolean removeTransporterSet​(TransporterSet set)
      • notifyTransporterSetsOfIdleness

        protected final void notifyTransporterSetsOfIdleness()
      • notifyTransporterSetsOfNonIdleness

        protected final void notifyTransporterSetsOfNonIdleness()