Conveyor
A conveyor consists of a series of segments. A segment has a starting location (origin) and an ending location (destination) and is associated with a conveyor. The start and end of each segment represent locations along the conveyor where entities can enter and exit. A conveyor does not utilize a spatial model. The locations associated with its segments are instances of the interface IdentityIfc. Thus, movement on the conveyor is disassociated with any spatial model associated with the entity using the conveyor. Since a spatial model using instances of the LocationIfc interface and LocationIfc extends the IdentityIfc, the locations associated with segments can be the same as those associated with spatial models. If the destination of a ride request is an instance of LocationIfc then the entity's curren location property will be updated after the movement. However, if the segments are not defined by locations within a spatial model, no updating of the entity's location will take place. The modeler is responsible for making the update to the entity location, if applicable.
A conveyor has a cell size, which represents the length of each cell on all segments of the conveyor. A conveyor also has a maximum permitted number of cells that can be occupied by an item riding on the conveyor. A conveyor has an initialVelocity. Each segment moves at the same velocity.
Each segment has a specified length that is divided into a number of equally sized contiguous cells. The length of any segment must be an integer multiple of the conveyor's cell size so that each segment will have an integer number of cells to represent its length. If a segment consists of 12 cells and the length of the conveyor is 12 feet then each cell represents 1 foot. If a segment consists of 4 cells and the length of the segment is 12 feet, then each cell of the segment represents 3 feet. Thus, a cell represents a generalized unit of distance along the segment. Segments may have a different number of cells because they may have different lengths.
The cells on a conveyor are numbered from 1 to n, with 1 at the entry of the first segment, and n at the exit of the last segment, where n is the number of cells for the conveyor.
Items that ride on the conveyor must be allocated cells and then occupy the cells while moving on the conveyor. Items can occupy more than one cell while riding on the conveyor. For example, if the conveyor has 5 cells (1, 2, 3, 4, 5) and the item needs 2 cells and is occupying cells 2 and 3, then the front cell associated with the item is cell 3 and the rear cell associated with the item is cell 2.
An entity trying to access the conveyor at an entry cell of the conveyor, waits until it can block the cell. A request for entry on the conveyor will wait for the entry cell if the entry cell is unavailable (blocked or occupied) or if another item is positioned to use the entry cell. Once the entity has control of the entry cell, this creates a blockage on the conveyor, which may restrict conveyor movement. For a non-accumulating conveyor the blockage stops all movement on the conveyor. For accumulating conveyors, the blockage restricts movement behind the blocked cell. Gaining control of the entry cell does not position the entity to ride on the conveyor. The entity simply controls the entry cell and causes a blockage. The entity is not on the conveyor during the blockage.
If the entity decides to ride on the conveyor, the entity will be allocated cells based on its request and occupy those cells while moving on the conveyor. First, the entity's request is removed from the request queue and positioned to enter the conveyor at the entry cell. To occupy a cell, the entity must move the distance represented by the cell (essentially covering the cell). Thus, an entering entity takes the time needed to move through its required cells before being fully on the conveyor. An entity occupies a cell during the time it traverses the cell's length. Thus, assuming a single item, the time to move from the start of a segment to the end of the segment is the time that it takes to travel through all the cells of the segment, including the entry cell and the exit cell.
When an entity riding on the conveyor reaches its destination (an exit cell), the entity causes a blockage on the conveyor. For a non-accumulating conveyor, the entire conveyor stops. For an accumulating conveyor, the blockage restricts movement behind the blockage causing items behind the blockage to continue to move until they cannot move forward. When an entity exits the conveyor, there will be a delay for the entity to move through the cells that it occupies before the entity can be considered completely off of the conveyor. Thus, exiting the conveyor is not assumed to be instantaneous. This implementation assumes that the entity must move through the occupied cells to get off the conveyor. Any delay to unload the item from the conveyor will be in addition to the exiting delay. Thus, a modeling situation in which the entity is picked up off the conveyor may need to account for the "extra" exiting delay. This implementation basically assumes that the item is pushed through the occupying cells at the end of the conveyor in order to exit. Scenarios where the item is picked up would not necessarily require the time to move through the cells.
A conveyor is considered circular if the entry location of the first segment is the same as the exit location of the last segment.
To construct a conveyor use the supplied builder or specify the segment data.
Parameters
the containing model element
the initial velocity of the conveyor
the specification of the segments
the maximum number of cells that an entity can occupy while riding on the conveyor
the name of the conveyor
Constructors
Types
A cell represents a length of space along the conveyor that can be allocated to and occupied by conveyable items. A conveyor is divided into a set of cells to represent its length. A cell acts like a general unit of distance along the conveyor.
A conveyor request represents the holding of cells on a conveyor and acts as a "ticket" to use the conveyor. Once an entity has a conveyor request, the entity has control over the cells at the start of the segment associated with the entry location along the conveyor. After receiving a request to access the conveyor the entity can either ride on the conveyor or exit. The conveyor request blocks at the point of access until riding or exiting. The request is placed in the blocking entry state. When the entity asks to ride the conveyor then the request will be placed in the riding state. If the entity never rides the conveyor, then the request stays in the blocking entry state. The property isWaitingForEntry indicates that the conveyor request is waiting to be allowed to block the entry cell of the conveyor at its current location. Once the conveyor request is used to ride the conveyor, the isWaitingToConvey property will report false. The isBlockingEntry property will report true until the request begins riding. Once the request reaches its destination, the isBlockingExit property will be true and the request is in the blocking exit state. When the request exits the conveyor the isCompleted property is true and the request is in the completed state. Once in the completed state, the request can no longer be used for any interaction with the conveyor.
Properties
A flag to control whether the model element reacts to after experiment actions.
A flag to control whether the model element reacts to after replication actions.
A flag to control whether the model element reacts to before experiment actions.
A flag to control whether the model element reacts to before replication actions.
The time that it takes an item on the conveyor to travel through a cell in order to fully occupy the cell. This is based on the cell size and the velocity of the conveyor.
Indicates the current status of the model element for observers of ModelElement.Status
The locations that can be used to enter (get on) the conveyor.
The locations that can be used as points of exit on the conveyor.
A flag to control whether the model element reacts to initialization actions
The initial velocity is the default movement velocity through cells on the conveyor. Changing the initial velocity will change the velocity that is set at the beginning of each replication.
Indicates if the conveyor's segments form a loop such that the location associated with the first segment is the same as the ending location of the last segment
the left traversal count for pre-order traversal of the model element tree
Returns a string representation of the model element and its child model elements. Useful for realizing the model element hierarchy.
A flag to control whether the model element participates in monte carlo actions.
Gets the number of model elements contained by this model elements.
Indicates the previous status of the model element for observers of ModelElement.Status This allows the transition to be noted by observers
A flag to control whether the model element reacts to end replication actions.
the right traversal count for pre-order traversal of the model element tree
The spatial model associated with this model element. By default, each model element uses its parent model element's spatial model unless changed via this property. This changes the spatial model for this model element and no others.
The time interval between TimedUpdate events. The default is zero, indicating no timed update
Specifies whether this model element participates in time update event specified by its parent
Specifies the havingPriority of this model element's timed update event.
Indicates whether the warm-up action occurred sometime during the simulation for this model element. False indicates that the warm-up action has not occurred
Specifies if this model element will be warmed up when the warmup action occurs for its parent. The warm-up flag indicates whether this model element will be warmed up when its parent warm up event/action occurs. The default value for all model elements is true. A value of true implies that the model element allows its parent's warm up event to call the warm-up action. A value of false implies that the model element does not allow its parent's warm up event to call the warm-up action. False does not necessarily mean that the model element will not be warmed up. It may, through the use of the lengthOfWarmUp property, have its own warm up event and action.
Specifies the priority of this model element's warm up event.
Functions
Returns the queue that holds requests that are waiting to access the conveyor at the supplied location
Returns a list of the cells that are blocked in the order of cell number.
The entry locations that are blocked and the corresponding blocked cell
The exit locations that are blocked and the corresponding blocked cell
Cancels the timed update event for this model element.
Cancels the warm-up event for this model element.
Checks if this model element or any model element directly above this model element in the hierarchy of model elements all the way until the top Model participates in the warm-up action.
A list of all conveyor requests that are currently associated with (occupying) cells on the conveyor in the order from the furthest along (closest to the exit location of the last segment) to the nearest request (closest to the entry location of the first segment).
By default (false), items riding on the conveyor have priority to enter entry cells over items waiting to enter. By setting the priority to true, the items waiting to begin riding the conveyor have priority to access over items already riding on the conveyor.
Find the first parent that has its own warm up event this guarantees that all elements below the found model element do not have their own warm-up event. A model element that has its own warm up event also opts out of the warm-up action. If the returned parent is the Model, then all are controlled by the model (unless they opt out). Elements can opt out and not have their own warm-up event. Thus, they have no warm up at all.
Fills up the supplied StringBuilder carrying a string representation of the model element and its child model elements Useful for realizing the model element hierarchy.
This method returns the planned time for the warm-up for this model element.
Checks if the conveyor has any blocked cells. A cell can be blocked for entry or for exit.
True if there is at least one cell that is occupied that can move on the conveyor
Checks if the conveyor does not have any blocked cells
Fills a StringBuilder carrying the model element names in the order that they will be initialized
Checks if a warm-up event is scheduled for any model element directly above this model element in the hierarchy of model elements all the way until the top Model.
Returns true if the entry location on the conveyor is blocked. Blocked means that an entity has control of the cell. A blockage causes non-accumulating conveyors to stop. For accumulating conveyors, items can continue moving until they reach the blockage and cannot move forward through the blockage. The entry cell remains blocked until released. The entity does not have to be on the conveyor to block the entry. The entity can release the blockage by exiting the conveyor (before getting on) or after riding on the conveyor. A blockage at an entry location is automatically released the instant that an item riding on a conveyor is completely on the conveyor. That is, when the item's rear most cell first occupies the entry cell.
Returns true if the exit location on the conveyor is blocked. Blocked means that an entity has control of the cell. A blockage causes non-accumulating conveyors to stop. For accumulating conveyors, items can continue moving until they reach the blockage and cannot move forward through the blockage. An exit location is blocked when the item occupying the exit cell has reached its destination while still on the conveyor. The exit cell becomes unblocked the instant that the item is fully off of the conveyor
If any of the cells of the conveyor are occupied by an entity then return true; otherwise, if there are no entities occupying cells return false.
Checks if current status is the supplied status
Checks if a timed update event has been scheduled for this model element
Checks if a warm-up event has been scheduled for this model element
Returns the value of a 1 millisecond time interval in terms of the base time unit
Turns on or off the default reporting for the utilization and time average number of busy cells for each segment of the conveyor
Sets the after experiment option of all model elements (children) contained by this model element.
Sets the after replication flag of all model elements (children) contained by this model element.
Sets the before experiment option of all model elements (children) contained by this model element.
Sets the before replication flag of all model elements (children) contained by this model element.
Sets the initialization option of all model elements (children) contained by this model element.
Sets the monte carlo option flag of all model elements (children) contained by this model element.
Sets the end replication option flag of all model elements (children) contained by this model element. Determines whether the replicationEnded() method will be called
Sets the timed update option flag of all model elements (children) contained by this model element.
Sets the warm-up option flag of all model elements (children) contained by this model element.
If the conveyor has been stopped using the stopConveyor() function, this will start it moving. If the conveyor has not been stopped using the stopConveyor() function, this method does nothing.
If a cell traversal is scheduled, it will be cancelled and movement on the conveyor will not occur.