RackSystem


RackSystem is used to represent a number of storages as a single block with multiple rows and aisles and serves as a central access and management point for them. This makes sense if the storages are used in a similar way.

To create a rack system you first need to define each individual storage graphically with a pallet rack, and specify the rack's number of positions and levels. The storages do not need to be identical: they can have different capacities and cell sizes; neither do they need to be graphically aligned. Then you should provide the list of storages to the Storages parameter of the RackSystem.

RackSystem exposes exactly the same API as a pallet rack, but the row numbering goes from 0 to the 2*(number of storages)-1, so that the storage that is, say, 5th in the list will have row numbers 8 and 9 in the zone. Additionally, the zone has a function cellExists( row, position, level ) to check whether the cell with given coordinates exists in the zone, and getMaxPositions() to obtain the number of positions in the longest storage, which is useful when you iterate over the zone cells.

The actions entered in the zone’s extension points (like On put, On reserve, etc.) do not override the corresponding actions of individual storages and are executed after them.

It is important that the blocks RackStore and RackPick can work transparently both with a single storage and with the zone. 

Parameters

Agent type [dynamic]
The type of the agents that are stored in the rack system. 
Default value: Agent
Referred below as: T
Pallet racks
The list of pallet racks that should be included in the rack system.
Syntax: PalletRack[] palletRacks
Advanced
Force statistics collection
By default statistics is collected for all Process Modeling Library blocks. However, you may tune this and switch off the statistics collection to optimize your model performance. To do this, add PML Settings block and deselect there the option Enable statistics by default. This way you switch stats collecting off for all flowchart blocks in the model. However, you can choose some specific blocks to override this setting and collect statistics by selecting this particular option Force statistics collection in the block properties.
Syntax: boolean forceStatisticsCollection
Default value: false
Draw stored agents
Here you can choose where you want to display agents stored in the storage: At the default position, At the top left corner of the cell, At the center of the cell, or Don't draw, use color indication only (fast). In the last case individual agent animation is hidden, and the cell is filled with the agent color or blend of vertically stored agents' colors: this allows more informing view on multi-level racks and has much better performance for large-scale warehouses. The agent color may be set by calling agent.setColor() function.
Get value: drawMode
Default value: At the default position (RackSystem.DRAW_DEFAULT)
Valid values: RackSystem.DRAW_DEFAULT
           RackSystem.DRAW_TOPLEFT
           RackSystem.DRAW_CENTER
           RackSystem.DRAW_INDICATION_ONLY
Actions
On put [code]
Code executed when the agent is put in the rack system (after the corresponding code of the individual storage is executed).
Local variables: agent - the agent.
             int row - the row of the cell.
             int position - the position of the cell.
             int level - the level of the cell. 
On remove [code]
Code executed when the agent is removed from the rack system (after the corresponding code of the individual storage is executed).
Local variables: T agent - the agent.
             int row - the row of the cell.
             int position - the position of the cell.
             int level - the level of the cell.
On reserve [code]
Code executed when the cell is marked as reserved (after the corresponding code of the individual storage is executed).
Local variables: T agent - the agent.
             int row - the row of the cell.
             int position - the position of the cell.
             int level - the level of the cell.
On release [code]
Code executed when the cell reservation is dropped (after the corresponding code of the individual storage is executed).
Local variables: int row - the row of the cell.
             int position - the position of the cell.
             int level - the level of the cell. 

Functions

Finding out the number of cells

int nRows() - Returns the number of rows in this rack system.

int nLevels(int row) - Returns the number of levels in the given row.

int nPositions(int row)Returns the number of positions in the given row. The total number of positions can be calculated by multiplying this number by the number of deep positions and by the number of levels.

int nDeepPositions(int row) - [if cells have depth] Returns the number of deep positions in the given row.

int capacity() - Returns the capacity of the rack system, which is the sum of capacities of its individual pallet racks.

int getMaxPositions() - Returns the number of positions per row of the longest pallet rack in the rack system.

Cell reservation

void reserve(int row, int position, int level, boolean leftAisle)Marks a given cell [row,position,level] as reserved. The cell must be free.

int nReserved(int row, int position, int level)Tests if a given cell [row,position,level] is reserved.

int reserved() - Returns the number of reserved cells in the rack system.

void release(int row, int position, int level, boolean leftAisle)Discards a reservation of a given cell [row,position,level]. The cell must be reserved.

boolean cellExists(int row, int position, int level)Tests if a given cell  [row,position,level] exists in the rack system (this is useful when different pallet racks in the rack system have different lengths or number of levels).

boolean contains(Agent agent) - Tests if the rack system contains a given agent.

T get(int row, int position, int level, int deepPosition)Returns the agent stored at the specified cell [row,position,level], or null if the cell is reserved or free.

PalletRackApproachDirection getApproachDirection(Agent agent, int rowToSearch) - returns the array containing the coordinates of a cell with a given agent [row,position,level], or null if the agent is not stored here.

Putting / picking agents to / from cells

void put(int row, int position, int level, boolean leftAisle, Agent agent)Puts the agent into the cell with the specified coordinates [row,position,level]. If the cell is occupied, signals error. Does not check if the cell is reserved.

T randomAgent()Returns a random agent in the rack system, or null if the rack system is empty.

T remove(Agent agent)Removes a given agent from the rack system and returns it. If the agent is not stored here, returns null.

T removeFromCell(int row, int position, int level, boolean leftAisle)Removes the agent stored in a given cell [row,position,level] from the rack system and returns it.

T removeFromCell(PalletRackLocation location, boolean leftAisle) - Removes the agent stored in a given cell [row,position,level] from the rack system and returns it.

T getByIndex(int index) - Returns the stored agent with a given index. The order of agents is internal and may change when agents are added or removed. If the index is greater than (number of agents - 1), returns null.

PalletRackLocation getCellOf(Agent agent)Returns the array containing the coordinates of a cell with a given agent [row,position,level], or null if the agent is not stored here.

PalletRackLocation getFreeCell(boolean infront)Returns the array [row,position,level] with the coordinates of a free cell that is closest to either front of back of the rack system, depending on the parameter infront. If the rack system is full, returns null.

Position getPositionAtCell(int row, int position, int level, int deepPosition, double offset, double depth, boolean leftAisle, Position out) - Returns the position at the given cell.

Position getPositionAtCellEntry(int row, int position, int level, boolean leftAisle, Position out) - Returns the position at the enter to the given cell.

Position getPositionInAisle(int row, int position, boolean leftAisle, Position out) - Returns the position in the pallet rack aisle located in front of a cell with a given row and position (level does not matter as cells located one above the other have same position).

PalletRack getPalletRack(int row) - Returns the pallet rack containing a given row.

boolean hasSpace() - Tests if the rack system has free space, i.e. if there are cells that are neither occupied nor reserved.

boolean isFree(int row, int position, int level)Tests if a given cell [row,position,level] is free, i.e. neither occupied nor reserved.

int nFree(int row, int position, int level) - Tests if a given cell [row,position,level] is free, i.e. neither occupied nor reserved and returns the number of free slots in the depth of the cell.

void resetStats() - Resets the statistics collected for this block.

int size() - Returns the current number of agents in the rack system.