AnyLogic
Expand
Font size

Class Storage

All Implemented Interfaces:
AggregatableAnimationElement, HasLevel, LevelElement, LevelMarkup, RackUnitAggregator, SVGElement, java.io.Serializable

public class Storage
extends AbstractLevelMarkup
implements RackUnitAggregator
See Also:
Serialized Form

Constructor Summary

Constructors 
Storage()
Creates a new Storage with default parameters.
Storage​(Agent owner, ShapeDrawMode drawMode, boolean isPublic, boolean isObstacle, IStorageDescriptor d, double x, double y, double z, RackType rackType, RackSkuFlow skuFlow, RackPlacement rackPlacement, int numberOfStorageUnits, int numberOfBays, int numberOfCellsPerSlot, double rightPassageMeter, double leftPassageMeter, double heightMeter, double widthMeter, double aisleWidthMeter, double slotDepthMeter, double cellWidthMeter, double rotation, boolean singleUnitFirst, java.awt.Color shelvesColor, java.awt.Color frameColor, boolean drawLegs, int baysBetweenLegs, boolean simplifiedAgentAnimation)  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
void cancelReservation​(Agent agent)
Discards any reservations made for the specified agent.
int capacity()
Returns the maximum possible number of agents that can be stored in the storage.
boolean contains​(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
boolean contains​(Agent agent)
Returns true if the specified agent is stored in the storage and false otherwise.
void deactivateCells​(int rack)  
void deactivateCells​(int rack, int bay)  
void deactivateCells​(int rack, int bay, int shelf)  
void enableDebugAnimator​(ShapeDrawMode mode)  
void enableGeometryAnimator()  
SVGElement findSVGElement​(long svgId)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
java.util.List<StorageCell> freeCells​(int rack)
Returns a list of all free cells in the specified rack.
java.util.List<StorageCell> freeCells​(int rack, int bay)
Returns a list of all free cells in the specified bay.
java.util.List<StorageCell> freeCells​(int rack, int bay, int shelf)
Returns a list of all free cells in the specified slot Can be called only after markup initialization.
double getAccessZone​(LengthUnits units)
Returns the width of access zone in specified length units.
Agent getAgentInCell​(int rack, int bay, int shelf, int deepPosition)
Returns the agent stored in the specified cell.
java.util.List<Agent> getAgents()
Returns a list of agents stored in the storage, ordered according to rack type.
double getAisleWidth()  
double getAisleWidth​(LengthUnits units)
Returns the aisle width in specified length units.
BoundingRectangle getBoundingRectangle()  
StorageCell getCell​(int rack, int bay, int shelf, int deepPosition)
Returns the specified cell.
StorageCell getCell​(Agent agent)
Returns the cell that contains the specified agent.
double getCellDepth()  
double getCellDepth​(LengthUnits units)  
double getCellHeight()  
java.util.List<StorageCell> getCells()
Returns a list of cells ordered according to rack type.
double getCellWidth()  
double getCellWidth​(LengthUnits units)
Returns the cell width in specified length units.
Point[] getCorners()  
java.awt.Color getFrameColor()
Returns the color of rack frame.
double getFullHeight()  
double getFullWidth()  
double getInslotSpeed​(SpeedUnits units)
Returns in-slot speed in specified speed units.
double getLeftPassage()  
IStorageDescriptor getLibraryDescriptor()  
double getNumberOfAisles()  
int getNumberOfBays()
Returns the number of bays per rack.
int getNumberOfCellsPerSlot()
Returns the number of cells per slot.
int getNumberOfRacks()
Returns the number of racks.
int getNumberOfShelves()
Returns the number of shelves per rack.
double getRackDepth​(LengthUnits units)
Returns the rack depth in specified length units.
RackPlacement getRackPlacement()
Returns rack placement type.
RackType getRackType()
Returns the rack type.
Agent getRandomAgent()
Returns a random agent stored in the storage.
StorageCell getRandomFreeCell()
Returns the next cell available for reservation in a random slot from the storage.
double getRightPassage()  
double getRotation()
Returns the rotation of the storage in radians.
double getShelfHeight​(LengthUnits units)
Returns the z-height of a shelf in specified length units.
java.awt.Color getShelvesColor()
Returns the color of rack shelves.
RackSkuFlow getSkuFlow()
Returns the storage SKU flow.
StorageSlot getSlot​(int rack, int bay, int shelf)
Returns slot address.
double getSlotDepth()  
RackUnitAggregator getStorageSystem()
Returns the storage system this element belongs to.
double getUnitHeight()  
double getUnitLength()  
double getX()
Returns the X coordinate of this storage.
double getY()
Returns the Y coordinate of this storage.
double getZ()
Returns the Z coordinate of this storage.
boolean hasSpace()
Returns true if the storage has cells available for reservation and false otherwise.
boolean hasSpace​(int rack, int bay, int shelf)
Returns true if the specified slot has cells available for reservation and false otherwise.
boolean isFree​(int rack, int bay, int shelf, int depth)  
boolean isIgnoreCellAccessibility()  
boolean isInvertedRack​(int rack)  
boolean isObstacle()
Returns true if racks of this storage are considered obstacles by transporters moving in free space mode.
boolean isSimplifiedAgentAnimation()
Returns true if stored agent animation is replaced with cell color indication, otherwise returns false.
boolean isSingleUnitFirst()  
boolean isSpecifiedInslotSpeed()
Returns true if specific in-slot speed was enabled and else otherwise.
boolean isUnitAccessibleFromLeftAdd​(int unit)  
boolean isUnitAccessibleFromLeftRemove​(int unit)  
boolean isUnitAccessibleFromRightAdd​(int unit)  
boolean isUnitAccessibleFromRightRemove​(int unit)  
int nFreeCells()
Returns the number of free cells.
int nFreeCells​(int rack)
Returns the number of free cells in the specified rack.
int nFreeCells​(int rack, int bay)
Returns the number of free cells in the specified bay.
int nFreeCells​(int rack, int bay, int shelf)
Returns the number of free cells in the specified slot Can be called only after markup initialization.
int nReservedCells()
Returns the number of reserved (but not occupied) cells.
int nRetrieved()
Returns the total number of retrieved agents.
int nStored()
Returns the total number of stored agents.
void onAgentRetrieval​(Agent agent, StorageCell cell)
Calls the storage's onAgentRetrieval callback code
void onAgentStorage​(Agent agent, StorageCell cell)
Calls the storage's onAgentStorage callback code
java.util.List<StorageCell> reservedCells​(int rack, int bay)
Returns a list of reserved cells located in the specified bay.
java.util.List<StorageCell> reservedCells​(int rack, int bay, int shelf)
Returns a list of reserved cells located in the specified slot.
void resetStats()
Resets statistics: the number of stored agents and the number of retrieved agents.
void resetSVGState()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Agent retrieve​(int rack)
Retrieves and returns the next agent from the specified rack.
Agent retrieve​(int rack, int bay)
Retrieves and returns the next agent from the specified bay.
Agent retrieve​(int rack, int bay, int shelf)
Retrieves and returns the next agent from the specified slot.
Agent retrieve​(Agent agent)
Retrieves and returns the previously stored agent from the storage.
void setAccessZone​(double zoneWidth, LengthUnits units)
Sets the width of access zone in specified length units.
void setAisleWidth​(double aisleWidth, LengthUnits units)
Sets the aisle width in specified length units.
void setCellWidth​(double cellWidth, LengthUnits units)
Sets the cell width in specified length units.
void setFrameColor​(java.awt.Color frameColor)
Sets the color of rack frame.
void setIgnoreCellAccessibility​(boolean ignore)  
void setInslotSpeed​(double speed, SpeedUnits units)
Sets in-slot speed in specified speed units
void setNumberOfBays​(int numberOfBays)
Sets the number of bays per rack.
void setNumberOfCellsPerSlot​(int numberOfCells)
Sets number of cells per slot.
void setNumberOfRacks​(int numberOfRacks)
Sets the number of racks.
void setNumberOfShelves​(int numberOfShelves)
Sets number of shelves per rack.
void setObstacle​(boolean isObstacle)
Sets the racks of this storage as obstacles for transporters moving in free space mode.
void setRackDepth​(double rackDepth, LengthUnits units)
Sets the rack depth in specified length units.
void setRackPlacement​(RackPlacement rackPlacement)
Defines rack placement.
void setRackType​(RackType type)
Sets the rack type.
void setReservation​(Agent agent, int rack, int bay)
Reserves a cell for the specified agent in the specified bay.
void setReservation​(Agent agent, int rack, int bay, int shelf)
Reserves a cell for the specified agent in the specified slot.
void setRotation​(double rotation)
Sets the rotation of the storage.
void setShelfHeight​(double shelfHeight, LengthUnits units)
Sets the z-height of a shelf in specified length units.
void setShelvesColor​(java.awt.Color shelvesColor)
Sets the color of rack shelves.
void setSimplifiedAgentAnimation​(boolean simplifiedAgentAnimation)
Controls the way the stored agents are drawn.
void setSkuFlow​(RackSkuFlow skuFlow)
Sets the SKU flow in the storage.
void setSpecifiedInslotSpeed​(boolean enabled)
Enables specific in-slot speed if the argument is true and disables if the argument is false.
void setStorageSystem​(RackUnitAggregator rs)  
void setX​(double x)
Sets the X coordinate of this storage.
void setY​(double y)
Sets the Y coordinate of this storage.
void setZ​(double z)
Sets the Z coordinate of this storage.
int size()
Returns the number of stored agents.
void store​(Agent agent)
Stores the given agent in the storage.
void store​(Agent agent, int rack)
Stores the agent in the specified rack.
void store​(Agent agent, int rack, int bay)
Stores the agent in the specified bay.
void store​(Agent agent, int rack, int bay, int shelf)
Stores the agent in the specified slot.
boolean unitHasAvailableCells​(int unit, Agent agent)  
void updateColorMap​(int unit, int bay, int level, int deepPosition, boolean put)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
SVGElement updateSVGProperties​(java.util.List<SVGCommand> output, ShapeDrawMode drawMode, boolean publicOnly, SVGElement owner, SVGElement elbehind)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Updates SVG properties of the element that are then sent to the rendering client.
double utilization()
Returns the storage's utilization.
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup

getDrawMode, getLevel, setLevel

Methods inherited from class com.anylogic.engine.markup.MarkupShape

error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner

Methods inherited from class com.anylogic.engine.markup.AbstractMarkup

discardOwner, executeUserAction, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, onAggregatorVisibilityChanged, postInitialize

Methods inherited from interface com.anylogic.engine.markup.RackUnitAggregator

getName

Constructor Detail

Storage

public Storage()
Creates a new Storage with default parameters. Parameters may be changed before markup initialization (see Level.initialize()). Any operations with cells must be done after markup initialization.

Storage

@AnyLogicInternalCodegenAPI
public Storage​(Agent owner,
               ShapeDrawMode drawMode,
               boolean isPublic,
               boolean isObstacle,
               IStorageDescriptor d,
               double x,
               double y,
               double z,
               RackType rackType,
               RackSkuFlow skuFlow,
               RackPlacement rackPlacement,
               int numberOfStorageUnits,
               int numberOfBays,
               int numberOfCellsPerSlot,
               double rightPassageMeter,
               double leftPassageMeter,
               double heightMeter,
               double widthMeter,
               double aisleWidthMeter,
               double slotDepthMeter,
               double cellWidthMeter,
               double rotation,
               boolean singleUnitFirst,
               java.awt.Color shelvesColor,
               java.awt.Color frameColor,
               boolean drawLegs,
               int baysBetweenLegs,
               boolean simplifiedAgentAnimation)

Method Detail

setStorageSystem

@AnyLogicInternalLibraryAPI
public void setStorageSystem​(RackUnitAggregator rs)

getStorageSystem

public RackUnitAggregator getStorageSystem()
Returns the storage system this element belongs to.
Returns:
StorageSystem this element belongs to

isObstacle

public boolean isObstacle()
Returns true if racks of this storage are considered obstacles by transporters moving in free space mode. Otherwise, returns false.
Returns:
true if racks of this storage are considered obstacles by transporters moving in free space mode. Otherwise, returns false

setObstacle

public void setObstacle​(boolean isObstacle)
Sets the racks of this storage as obstacles for transporters moving in free space mode.
Parameters:
isObstacle - - if true, the racks are set as obstacles. Otherwise, not.

isSimplifiedAgentAnimation

public boolean isSimplifiedAgentAnimation()
Returns true if stored agent animation is replaced with cell color indication, otherwise returns false.
Returns:
true if stored agent animation is replaced with cell color indication, otherwise returns false

setSimplifiedAgentAnimation

public void setSimplifiedAgentAnimation​(boolean simplifiedAgentAnimation)
Controls the way the stored agents are drawn. true value disables agent animation inside the storage and fills cells with agent color indicating occupancy (best animation performance). false draws agents inside the storage as is. Cannot be called after markup initialization.
Parameters:
simplifiedAgentAnimation - - true value disables agent animation inside the storage and fills cells with agent color indicating occupancy (best animation performance). false draws agents inside the storage as is

getShelvesColor

public java.awt.Color getShelvesColor()
Returns the color of rack shelves. For drive in storage an error will occur.
Returns:
color of rack shelves

getFrameColor

public java.awt.Color getFrameColor()
Returns the color of rack frame.
Returns:
color of rack frame

setShelvesColor

public void setShelvesColor​(java.awt.Color shelvesColor)
Sets the color of rack shelves. For drive in storage, shelves color will be ignored.
Parameters:
shelvesColor - color of rack shelves

setFrameColor

public void setFrameColor​(java.awt.Color frameColor)
Sets the color of rack frame.
Parameters:
frameColor - color of rack frame

getLibraryDescriptor

@AnyLogicInternalAPI
public IStorageDescriptor getLibraryDescriptor()

isUnitAccessibleFromLeftAdd

@AnyLogicInternalLibraryAPI
public boolean isUnitAccessibleFromLeftAdd​(int unit)

isUnitAccessibleFromRightAdd

@AnyLogicInternalLibraryAPI
public boolean isUnitAccessibleFromRightAdd​(int unit)

isUnitAccessibleFromLeftRemove

@AnyLogicInternalLibraryAPI
public boolean isUnitAccessibleFromLeftRemove​(int unit)

isUnitAccessibleFromRightRemove

@AnyLogicInternalLibraryAPI
public boolean isUnitAccessibleFromRightRemove​(int unit)

getNumberOfRacks

public int getNumberOfRacks()
Returns the number of racks.
Returns:
number of racks

setNumberOfRacks

public void setNumberOfRacks​(int numberOfRacks)
Sets the number of racks. Cannot be called after markup initialization.
Parameters:
numberOfRacks - positive integer value

getX

public double getX()
Returns the X coordinate of this storage.
Returns:
the X coordinate of this storage

setX

public void setX​(double x)
Sets the X coordinate of this storage. Cannot be called after markup initialization.
Parameters:
x - the X coordinate of this storage

getY

public double getY()
Returns the Y coordinate of this storage.
Returns:
the Y coordinate of this storage

setY

public void setY​(double y)
Sets the Y coordinate of this storage. Cannot be called after markup initialization.
Parameters:
y - the Y coordinate of this storage

getZ

public double getZ()
Returns the Z coordinate of this storage.
Returns:
the Z coordinate of this storage

setZ

public void setZ​(double z)
Sets the Z coordinate of this storage. Cannot be called after markup initialization.
Parameters:
z - the Z coordinate of this storage

getNumberOfBays

public int getNumberOfBays()
Returns the number of bays per rack.
Returns:
number of bays per rack

setNumberOfBays

public void setNumberOfBays​(int numberOfBays)
Sets the number of bays per rack. Cannot be called after markup initialization.
Parameters:
numberOfBays - positive integer value

getNumberOfCellsPerSlot

public int getNumberOfCellsPerSlot()
Returns the number of cells per slot.
Returns:
number of cells per slot

setNumberOfCellsPerSlot

public void setNumberOfCellsPerSlot​(int numberOfCells)
Sets number of cells per slot. Cannot be called after markup initialization.
Parameters:
numberOfCells - positive integer value

getSlotDepth

@AnyLogicInternalLibraryAPI
public double getSlotDepth()

getRackDepth

public double getRackDepth​(LengthUnits units)
Returns the rack depth in specified length units.
Parameters:
units - - length units
Returns:
rack depth in specified length units

setRackDepth

public void setRackDepth​(double rackDepth,
                         LengthUnits units)
Sets the rack depth in specified length units. Cannot be called after markup initialization.
Parameters:
rackDepth - - finite positive value in specified length units
units - - length units

getNumberOfShelves

public int getNumberOfShelves()
Returns the number of shelves per rack.
Returns:
number of shelves per rack

setNumberOfShelves

public void setNumberOfShelves​(int numberOfShelves)
Sets number of shelves per rack. May not be called after initialization of markup.
Parameters:
numberOfShelves - positive integer value

isSpecifiedInslotSpeed

public boolean isSpecifiedInslotSpeed()
Returns true if specific in-slot speed was enabled and else otherwise.
Returns:
true if specific in-slot speed was enabled and else otherwise

setSpecifiedInslotSpeed

public void setSpecifiedInslotSpeed​(boolean enabled)
Enables specific in-slot speed if the argument is true and disables if the argument is false. Use setInslotSpeed(double, SpeedUnits) method to set the speed value afterwards.
Parameters:
enabled - argument flag

getInslotSpeed

public double getInslotSpeed​(SpeedUnits units)
Returns in-slot speed in specified speed units.
Parameters:
units - - speed units
Returns:
inslot speed in specified speed units

setInslotSpeed

public void setInslotSpeed​(double speed,
                           SpeedUnits units)
Sets in-slot speed in specified speed units
Parameters:
speed - - speed value
units - - speed units

getCellHeight

@AnyLogicInternalLibraryAPI
public double getCellHeight()

getShelfHeight

public double getShelfHeight​(LengthUnits units)
Returns the z-height of a shelf in specified length units.
Parameters:
units - - length units
Returns:
z-height of shelf in specified length units

setShelfHeight

public void setShelfHeight​(double shelfHeight,
                           LengthUnits units)
Sets the z-height of a shelf in specified length units. Cannot be called after markup initialization.
Parameters:
shelfHeight - - finite positive value in specified length units
units - - length units

getAisleWidth

@AnyLogicInternalLibraryAPI
public double getAisleWidth()

getAisleWidth

public double getAisleWidth​(LengthUnits units)
Returns the aisle width in specified length units.
Parameters:
units - - length units
Returns:
aisle width in specified length units

setAisleWidth

public void setAisleWidth​(double aisleWidth,
                          LengthUnits units)
Sets the aisle width in specified length units. Cannot be called after markup initialization.
Parameters:
aisleWidth - finite positive value in specified length units
units - length units

getCellDepth

@AnyLogicInternalLibraryAPI
public double getCellDepth()

getCellDepth

@AnyLogicInternalAPI
public double getCellDepth​(LengthUnits units)

getUnitLength

@AnyLogicInternalAPI
public double getUnitLength()

getUnitHeight

@AnyLogicInternalAPI
public double getUnitHeight()

getAccessZone

public double getAccessZone​(LengthUnits units)
Returns the width of access zone in specified length units.
Parameters:
units - - length units
Returns:
width of access zone in specified length units

setAccessZone

public void setAccessZone​(double zoneWidth,
                          LengthUnits units)
Sets the width of access zone in specified length units. Cannot be called after markup initialization.
Parameters:
zoneWidth - - finite positive value in specified length units
units - - length units

getLeftPassage

@AnyLogicInternalLibraryAPI
public double getLeftPassage()

getRightPassage

@AnyLogicInternalLibraryAPI
public double getRightPassage()

getCellWidth

@AnyLogicInternalLibraryAPI
public double getCellWidth()

getCellWidth

public double getCellWidth​(LengthUnits units)
Returns the cell width in specified length units.
Parameters:
units - - length units
Returns:
cell width in specified length units

setCellWidth

public void setCellWidth​(double cellWidth,
                         LengthUnits units)
Sets the cell width in specified length units. Cannot be called after markup initialization.
Parameters:
cellWidth - - finite positive value in specified length units
units - - length units

unitHasAvailableCells

@AnyLogicInternalLibraryAPI
public boolean unitHasAvailableCells​(int unit,
                                     Agent agent)

getRotation

public double getRotation()
Returns the rotation of the storage in radians.
Returns:
rotation of the storage in radians

setRotation

public void setRotation​(double rotation)
Sets the rotation of the storage. Cannot be called after markup initialization.
Parameters:
rotation - finite value in radians

getRackType

public RackType getRackType()
Returns the rack type.
Returns:
rack type

setRackType

public void setRackType​(RackType type)
Sets the rack type. Cannot be called after markup initialization.
Parameters:
type - type of the storage. Cannot be null.

getRackPlacement

public RackPlacement getRackPlacement()
Returns rack placement type.
Returns:
rack placement type

setRackPlacement

public void setRackPlacement​(RackPlacement rackPlacement)
Defines rack placement. Cannot be called after markup initialization.
Parameters:
rackPlacement - rack placement type. Cannot be null.

getSkuFlow

@AnyLogicInternalAPI
public RackSkuFlow getSkuFlow()
Returns the storage SKU flow.
Returns:
storage SKU flow.

setSkuFlow

@AnyLogicInternalAPI
public void setSkuFlow​(RackSkuFlow skuFlow)
Sets the SKU flow in the storage. Cannot be called after markup initialization.
Parameters:
skuFlow - - SKU flow. Cannot be null.

contains

public boolean contains​(double px,
                        double py)
Description copied from class: MarkupShape
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e. in the same system with the coordinates of this shape, x and y)
Specified by:
contains in class MarkupShape
Parameters:
px - the x coordinate relative to this shape's container
py - the y coordinate relative to this shape's container
Returns:
true if the shape contains the point with the given coordinates

getBoundingRectangle

public BoundingRectangle getBoundingRectangle()

getCorners

@AnyLogicInternalAPI
public Point[] getCorners()

getNumberOfAisles

@AnyLogicInternalAPI
public double getNumberOfAisles()

getFullWidth

@AnyLogicInternalAPI
public double getFullWidth()

getFullHeight

@AnyLogicInternalAPI
public double getFullHeight()

capacity

public int capacity()
Returns the maximum possible number of agents that can be stored in the storage. Deactivated cells are excluded from the result.
Returns:
capacity of the storage

nStored

public int nStored()
Returns the total number of stored agents. May be reset via resetStats().
Returns:
total number of stored agents.

nRetrieved

public int nRetrieved()
Returns the total number of retrieved agents. May be reset via resetStats().
Returns:
total number of retrieved agents.

utilization

public double utilization()
Returns the storage's utilization. Utilization is a double value in range [0, 1] that is calculated as a ratio of occupied cells to capacity.
Returns:
storage's utilization

resetStats

public void resetStats()
Resets statistics: the number of stored agents and the number of retrieved agents.

setReservation

public void setReservation​(Agent agent,
                           int rack,
                           int bay,
                           int shelf)
Reserves a cell for the specified agent in the specified slot. This reservation is implicit. Can be called only after markup initialization.
Parameters:
agent - - the agent that reserves the cell
rack - - index of rack
bay - - index of bay
shelf - - index of shelf

setReservation

public void setReservation​(Agent agent,
                           int rack,
                           int bay)
Reserves a cell for the specified agent in the specified bay. This reservation is implicit. Can be called only after markup initialization.
Parameters:
agent - - the agent that reserves the cell
rack - - index of rack
bay - - index of bay

cancelReservation

public void cancelReservation​(Agent agent)
Discards any reservations made for the specified agent. Can be called only after markup's initialization.
Parameters:
agent - - agent for whom the reservation should be canceled

retrieve

public Agent retrieve​(Agent agent)
Retrieves and returns the previously stored agent from the storage. Can be called only after markup initialization.
Parameters:
agent - - the agent that should be retrieved from storage.
Returns:
retrieved agent.

retrieve

public Agent retrieve​(int rack,
                      int bay,
                      int shelf)
Retrieves and returns the next agent from the specified slot. Can be called only after markup initialization.
Parameters:
rack - - index of rack
bay - - index of bay
shelf - - index of shelf
Returns:
retrieved agent

retrieve

public Agent retrieve​(int rack,
                      int bay)
Retrieves and returns the next agent from the specified bay. Can be called only after markup initialization.
Parameters:
rack - - index of rack
bay - - index of bay
Returns:
retrieved agent

retrieve

public Agent retrieve​(int rack)
Retrieves and returns the next agent from the specified rack. Can be called only after markup initialization.
Parameters:
rack - - index of rack
Returns:
retrieved agent

deactivateCells

public void deactivateCells​(int rack)

deactivateCells

public void deactivateCells​(int rack,
                            int bay)

deactivateCells

public void deactivateCells​(int rack,
                            int bay,
                            int shelf)

nReservedCells

public int nReservedCells()
Returns the number of reserved (but not occupied) cells.
Returns:
number of reserved (but not occupied) cells

hasSpace

public boolean hasSpace​(int rack,
                        int bay,
                        int shelf)
Returns true if the specified slot has cells available for reservation and false otherwise. Can be called only after markup initialization.
Parameters:
rack - - index of rack
bay - - index of bay
shelf - - index of shelf
Returns:
true if the specified slot has cells available for reservation and false otherwise

hasSpace

public boolean hasSpace()
Returns true if the storage has cells available for reservation and false otherwise. Can be called only after markup initialization.
Returns:
true if the storage has cells available for reservation and false otherwise

reservedCells

public java.util.List<StorageCell> reservedCells​(int rack,
                                                 int bay,
                                                 int shelf)
Returns a list of reserved cells located in the specified slot. Can be called only after markup initialization.
Parameters:
rack - - index of rack
bay - - index of bay
shelf - - index of shelf
Returns:
list of reserved cells located in the specified slot.

reservedCells

public java.util.List<StorageCell> reservedCells​(int rack,
                                                 int bay)
Returns a list of reserved cells located in the specified bay. Can be called only after markup initialization.
Parameters:
rack - - index of rack
bay - - index of bay
Returns:
list of reserved cells located in the specified bay.

store

public void store​(Agent agent)
Stores the given agent in the storage. The position is chosen according to the storage type. If there are no cells available for reservation, an error will occur. Can be called only after markup initialization.
Parameters:
agent - - agent to be stored in the storage, cannot be null

store

public void store​(Agent agent,
                  int rack)
Stores the agent in the specified rack. The position is chosen according to the storage type. If there are no cells available for reservation, an error will occur. Can be called only after markup initialization.
Parameters:
agent - - agent to be stored in the rack, cannot be null
rack - - index of rack

store

public void store​(Agent agent,
                  int rack,
                  int bay)
Stores the agent in the specified bay. The position is chosen according to the storage type. If there are no cells available for reservation, an error will occur. Can be called only after markup initialization.
Parameters:
agent - - agent to be stored in the bay, cannot be null
rack - - index of rack
bay - - index of bay

store

public void store​(Agent agent,
                  int rack,
                  int bay,
                  int shelf)
Stores the agent in the specified slot. The position is chosen according to the storage type. If there are no cells available for reservation, an error will occur. Can be called only after markup initialization.
Parameters:
agent - - agent to be stored in the slot, cannot be null
rack - - index of rack
bay - - index of bay
shelf - - index of shelf

getAgentInCell

public Agent getAgentInCell​(int rack,
                            int bay,
                            int shelf,
                            int deepPosition)
Returns the agent stored in the specified cell. Can be called only after markup initialization.
Parameters:
rack - - index of rack
bay - - index of bay
shelf - - index of shelf
deepPosition - - index of cell
Returns:
agent stored in the specified cell.

getAgents

public java.util.List<Agent> getAgents()
Returns a list of agents stored in the storage, ordered according to rack type. See help for more info. Can be called only after markup initialization.
Returns:
ordered list of agents stored in the storage.

getCell

public StorageCell getCell​(Agent agent)
Returns the cell that contains the specified agent. Can be called only after markup initialization.
Parameters:
agent - - an agent that is stored in the storage. Cannot be null.
Returns:
cell that contains the specified agent

getCell

public StorageCell getCell​(int rack,
                           int bay,
                           int shelf,
                           int deepPosition)
Returns the specified cell. Can be called only after markup initialization.
Parameters:
rack - - index of rack
bay - - index of bay
shelf - - index of shelf
deepPosition - - index of cell
Returns:
the specified cell

getSlot

public StorageSlot getSlot​(int rack,
                           int bay,
                           int shelf)
Returns slot address.
Parameters:
rack - index of rack
bay - index of bay
shelf - index of shelf
Returns:
slot address

getCells

public java.util.List<StorageCell> getCells()
Returns a list of cells ordered according to rack type. See help for more info. Can be called only after markup initialization.
Returns:
ordered list of cells

getRandomAgent

public Agent getRandomAgent()
Returns a random agent stored in the storage. If the storage is empty, returns null. Can be called only after markup initialization.
Returns:
random agent stored in the storage

contains

public boolean contains​(Agent agent)
Returns true if the specified agent is stored in the storage and false otherwise. Can be called only after markup initialization.
Parameters:
agent - - agent that you want to check
Returns:
true if the specified agent is stored in the storage and false otherwise

size

public int size()
Returns the number of stored agents. Can be called only after markup initialization.
Returns:
number of stored agents

getRandomFreeCell

public StorageCell getRandomFreeCell()
Returns the next cell available for reservation in a random slot from the storage. Can be called only after markup initialization.
Returns:
next cell available for reservation in a random slot from the storage

freeCells

public java.util.List<StorageCell> freeCells​(int rack)
Returns a list of all free cells in the specified rack. Can be called only after markup initialization.
Parameters:
rack - - index of rack
Returns:
list of all free cells in the specified rack

freeCells

public java.util.List<StorageCell> freeCells​(int rack,
                                             int bay)
Returns a list of all free cells in the specified bay. Can be called only after markup initialization.
Parameters:
rack - - index of rack
bay - - index of bay
Returns:
list of all free cells in the specified bay

freeCells

public java.util.List<StorageCell> freeCells​(int rack,
                                             int bay,
                                             int shelf)
Returns a list of all free cells in the specified slot Can be called only after markup initialization.
Parameters:
rack - - index of rack
bay - - index of bay
shelf - - index of shelf
Returns:
list of all free cells in the specified slot

isFree

@AnyLogicInternalAPI
public boolean isFree​(int rack,
                      int bay,
                      int shelf,
                      int depth)

nFreeCells

public int nFreeCells()
Returns the number of free cells. Can be called only after markup initialization.
Returns:
number of free cells

nFreeCells

public int nFreeCells​(int rack)
Returns the number of free cells in the specified rack. Can be called only after markup initialization.
Parameters:
rack - - index of rack
Returns:
number of free cells in the specified rack

nFreeCells

public int nFreeCells​(int rack,
                      int bay)
Returns the number of free cells in the specified bay. Can be called only after markup initialization.
Parameters:
rack - - index of rack
bay - - index of bay
Returns:
number of free cells in the specified bay

nFreeCells

public int nFreeCells​(int rack,
                      int bay,
                      int shelf)
Returns the number of free cells in the specified slot Can be called only after markup initialization.
Parameters:
rack - - index of rack
bay - - index of bay
shelf - - index of shelf
Returns:
number of free cells in the specified slot

enableDebugAnimator

@AnyLogicInternalAPI
public void enableDebugAnimator​(ShapeDrawMode mode)

enableGeometryAnimator

@AnyLogicInternalAPI
public void enableGeometryAnimator()

setIgnoreCellAccessibility

@AnyLogicInternalAPI
public void setIgnoreCellAccessibility​(boolean ignore)

isIgnoreCellAccessibility

@AnyLogicInternalAPI
public boolean isIgnoreCellAccessibility()

isSingleUnitFirst

@AnyLogicInternalAPI
public boolean isSingleUnitFirst()

onAgentStorage

public void onAgentStorage​(Agent agent,
                           StorageCell cell)
Calls the storage's onAgentStorage callback code
Parameters:
agent - - the agent that has been stored in storage
cell - - the cell that was occupied by agent

onAgentRetrieval

public void onAgentRetrieval​(Agent agent,
                             StorageCell cell)
Calls the storage's onAgentRetrieval callback code
Parameters:
agent - - the agent that has been retrieved from storage
cell - - the cell that was released by agent

updateSVGProperties

@AnyLogicInternalAPI
public SVGElement updateSVGProperties​(java.util.List<SVGCommand> output,
                                      ShapeDrawMode drawMode,
                                      boolean publicOnly,
                                      SVGElement owner,
                                      SVGElement elbehind)
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Updates SVG properties of the element that are then sent to the rendering client. If the element is not yet in the SVG scene, generates "C" command, if it is there, but some properties are out of date, generates "U" command. If SVG drawing of this element is not needed because of public only settings, or permanently not needed, or not supported yet, returns false and does nothing.
Specified by:
updateSVGProperties in interface SVGElement
Overrides:
updateSVGProperties in class AbstractMarkup
Parameters:
output - the list of commands to add to
drawMode - TODO
publicOnly - drawing context: if true, only shapes that are marked as public only are updated
owner - the SVG element that serves as a container for this element
elbehind - the SVG element behind this one, or null if none or if order is irrelevant
Returns:
the actual owner this element has been added to or null if element is not drawn (e.g. drawing of this element is not needed because of public only settings, permanently not needed or not supported - hence SVG id is not set). The actual owner may differ from the given owner when the svg element is added to a different place (e.g. GIS map).

resetSVGState

@AnyLogicInternalAPI
public void resetSVGState()
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
resetSVGState in interface SVGElement
Overrides:
resetSVGState in class AbstractMarkup

findSVGElement

@AnyLogicInternalAPI
public SVGElement findSVGElement​(long svgId)
Description copied from interface: SVGElement
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
findSVGElement in interface SVGElement
Overrides:
findSVGElement in class AbstractMarkup

isInvertedRack

@AnyLogicInternalAPI
public boolean isInvertedRack​(int rack)

updateColorMap

@AnyLogicInternalAPI
public void updateColorMap​(int unit,
                           int bay,
                           int level,
                           int deepPosition,
                           boolean put)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
How can we improve this article?