AnyLogic
Expand
Font size

Class Storage

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

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

Constructor Summary

ConstructorDescription
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, boolean flipped, RackPlacement rackPlacement, int numberOfStorageUnits, int numberOfBays, int numberOfCellsPerSlot, double rightPassageMeter, double leftPassageMeter, double heightMeter, double widthMeter, double aisleWidthMeter, double slotDepthMeter, double cellWidthMeter, double rotation, double tiltAngle, boolean singleUnitFirst, Color shelvesColor, Color frameColor, boolean drawLegs, int baysBetweenLegs, boolean simplifiedAgentAnimation) 

Method Summary

Modifier and TypeMethodDescription
voidcancelReservation(Agent agent)
Discards any reservations made for the specified agent.
intcapacity()
Returns the maximum possible number of agents that can be stored in the storage.
booleancontains(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
booleancontains(Agent agent)
Returns true if the specified agent is stored in the storage and false otherwise.
voiddeactivateCells(int rack) 
voiddeactivateCells(int rack, int bay) 
voiddeactivateCells(int rack, int bay, int shelf) 
voidenableDebugAnimator(ShapeDrawMode mode) 
voidenableGeometryAnimator() 
SVGElementfindSVGElement(long svgId)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
List<StorageCell>freeCells(int rack)
Returns a list of all free cells in the specified rack.
List<StorageCell>freeCells(int rack, int bay)
Returns a list of all free cells in the specified bay.
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.
doublegetAccessZone(LengthUnits units)
Returns the width of access zone in specified length units.
AgentgetAgentInCell(int rack, int bay, int shelf, int deepPosition)
Returns the agent stored in the specified cell.
List<Agent>getAgents()
Returns a list of agents stored in the storage, ordered according to rack type.
doublegetAisleWidth() 
doublegetAisleWidth(LengthUnits units)
Returns the aisle width in specified length units.
BoundingRectanglegetBoundingRectangle() 
StorageCellgetCell(int rack, int bay, int shelf, int deepPosition)
Returns the specified cell.
StorageCellgetCell(Agent agent)
Returns the cell that contains the specified agent.
doublegetCellDepth() 
doublegetCellDepth(LengthUnits units) 
doublegetCellHeight() 
List<StorageCell>getCells()
Returns a list of cells ordered according to rack type.
doublegetCellWidth() 
doublegetCellWidth(LengthUnits units)
Returns the cell width in specified length units.
Point[]getCorners() 
ColorgetFrameColor()
Returns the color of rack frame.
doublegetFullHeight() 
doublegetFullWidth() 
doublegetInslotSpeed(SpeedUnits units)
Returns in-slot speed in specified speed units.
doublegetLeftPassage() 
IStorageDescriptorgetLibraryDescriptor() 
doublegetNumberOfAisles() 
intgetNumberOfBays()
Returns the number of bays per rack.
intgetNumberOfCellsPerSlot()
Returns the number of cells per slot.
intgetNumberOfRacks()
Returns the number of racks.
intgetNumberOfShelves()
Returns the number of shelves per rack.
doublegetRackDepth(LengthUnits units)
Returns the rack depth in specified length units.
RackPlacementgetRackPlacement()
Returns rack placement type.
RackTypegetRackType()
Returns the rack type.
AgentgetRandomAgent()
Returns a random agent stored in the storage.
StorageSlotgetRandomAvailableSlot() 
StorageCellgetRandomFreeCell()
Returns the next cell available for reservation in a random slot from the storage.
doublegetRightPassage() 
doublegetRotation()
Returns the rotation of the storage in radians.
doublegetShelfHeight(LengthUnits units)
Returns the z-height of a shelf in specified length units.
ColorgetShelvesColor()
Returns the color of rack shelves.
doublegetShelvesTiltAngle()
Returns shelves tilt angle in radians.
StorageSlotgetSlot(int rack, int bay, int shelf)
Returns slot address.
doublegetSlotDepth() 
RackUnitAggregatorgetStorageSystem()
Returns the storage system this element belongs to.
doublegetUnitHeight() 
doublegetUnitLength() 
doublegetX()
Returns the X coordinate of this storage.
doublegetY()
Returns the Y coordinate of this storage.
doublegetZ()
Returns the Z coordinate of this storage.
booleanhasSpace()
Returns true if the storage has cells available for reservation and false otherwise.
booleanhasSpace(int rack, int bay, int shelf)
Returns true if the specified slot has cells available for reservation and false otherwise.
booleanisFree(int rack, int bay, int shelf, int depth) 
booleanisIgnoreCellAccessibility() 
booleanisInvertedRack(int rack) 
booleanisLoadingDirectionReversed()
Returns value of parameter 'Reverse loading direction'
booleanisObstacle()
Returns true if racks of this storage are considered obstacles by transporters moving in free space mode.
booleanisSimplifiedAgentAnimation()
Returns true if stored agent animation is replaced with cell color indication, otherwise returns false.
booleanisSingleUnitFirst() 
booleanisSpecifiedInslotSpeed()
Returns true if specific in-slot speed was enabled and false otherwise.
booleanisUnitAccessibleFromLeftAdd(int unit) 
booleanisUnitAccessibleFromLeftRemove(int unit) 
booleanisUnitAccessibleFromRightAdd(int unit) 
booleanisUnitAccessibleFromRightRemove(int unit) 
intnFreeCells()
Returns the number of free cells.
intnFreeCells(int rack)
Returns the number of free cells in the specified rack.
intnFreeCells(int rack, int bay)
Returns the number of free cells in the specified bay.
intnFreeCells(int rack, int bay, int shelf)
Returns the number of free cells in the specified slot Can be called only after markup initialization.
intnReservedCells()
Returns the number of reserved (but not occupied) cells.
intnRetrieved()
Returns the total number of retrieved agents.
intnStored()
Returns the total number of stored agents.
voidonAgentRetrieval(Agent agent, StorageCell cell)
Calls the storage's onAgentRetrieval callback code
voidonAgentStorage(Agent agent, StorageCell cell)
Calls the storage's onAgentStorage callback code
List<StorageCell>reservedCells(int rack, int bay)
Returns a list of reserved cells located in the specified bay.
List<StorageCell>reservedCells(int rack, int bay, int shelf)
Returns a list of reserved cells located in the specified slot.
voidresetStats()
Resets statistics: the number of stored agents and the number of retrieved agents.
voidresetSVGState()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Agentretrieve(int rack)
Retrieves and returns the next agent from the specified rack.
Agentretrieve(int rack, int bay)
Retrieves and returns the next agent from the specified bay.
Agentretrieve(int rack, int bay, int shelf)
Retrieves and returns the next agent from the specified slot.
Agentretrieve(Agent agent)
Retrieves and returns the previously stored agent from the storage.
voidsetAccessZone(double zoneWidth, LengthUnits units)
Sets the width of access zone in specified length units.
voidsetAisleWidth(double aisleWidth, LengthUnits units)
Sets the aisle width in specified length units.
voidsetCellWidth(double cellWidth, LengthUnits units)
Sets the cell width in specified length units.
voidsetFrameColor(Color frameColor)
Sets the color of rack frame.
voidsetIgnoreCellAccessibility(boolean ignore) 
voidsetInslotSpeed(double speed, SpeedUnits units)
Sets in-slot speed in specified speed units
voidsetNumberOfBays(int numberOfBays)
Sets the number of bays per rack.
voidsetNumberOfCellsPerSlot(int numberOfCells)
Sets number of cells per slot.
voidsetNumberOfRacks(int numberOfRacks)
Sets the number of racks.
voidsetNumberOfShelves(int numberOfShelves)
Sets number of shelves per rack.
voidsetObstacle(boolean isObstacle)
Sets the racks of this storage as obstacles for transporters moving in free space mode.
voidsetRackDepth(double rackDepth, LengthUnits units)
Sets the rack depth in specified length units.
voidsetRackPlacement(RackPlacement rackPlacement)
Defines rack placement.
voidsetRackType(RackType type)
Sets the rack type.
voidsetReservation(Agent agent, int rack, int bay)
Reserves a cell for the specified agent in the specified bay.
voidsetReservation(Agent agent, int rack, int bay, int shelf)
Reserves a cell for the specified agent in the specified slot.
voidsetReservation(Agent agent, StorageSlot slot)
Reserves a cell for the specified agent in the specified slot.
voidsetReverseLoadingDirection(boolean reversed)
Sets value of parameter 'Reverse loading direction'.
voidsetRotation(double rotation)
Sets the rotation of the storage.
voidsetShelfHeight(double shelfHeight, LengthUnits units)
Sets the z-height of a shelf in specified length units.
voidsetShelvesColor(Color shelvesColor)
Sets the color of rack shelves.
voidsetShelvesTiltAngle(double tiltAngle)
Sets the tilt angle of shelves.
voidsetSimplifiedAgentAnimation(boolean simplifiedAgentAnimation)
Controls the way the stored agents are drawn.
voidsetSpecifiedInslotSpeed(boolean enabled)
Enables specific in-slot speed if the argument is true and disables if the argument is false.
voidsetStorageSystem(RackUnitAggregator rs) 
voidsetX(double x)
Sets the X coordinate of this storage.
voidsetY(double y)
Sets the Y coordinate of this storage.
voidsetZ(double z)
Sets the Z coordinate of this storage.
intsize()
Returns the number of stored agents.
voidstore(Agent agent)
Stores the given agent in the storage.
voidstore(Agent agent, int rack)
Stores the agent in the specified rack.
voidstore(Agent agent, int rack, int bay)
Stores the agent in the specified bay.
voidstore(Agent agent, int rack, int bay, int shelf)
Stores the agent in the specified slot.
voidstore(Agent agent, StorageSlot slot)
Stores the agent in the specified slot.
booleanunitHasAvailableCells(int unit, Agent agent) 
voidupdateColorMap(int unit, int bay, int level, int deepPosition, Color color)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
voidupdateDynamicProperties()
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties.
SVGElementupdateSVGProperties(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.
doubleutilization()
Returns the storage's utilization.

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 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 Details

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,
 boolean flipped,
 RackPlacement rackPlacement,
 int numberOfStorageUnits,
 int numberOfBays,
 int numberOfCellsPerSlot,
 double rightPassageMeter,
 double leftPassageMeter,
 double heightMeter,
 double widthMeter,
 double aisleWidthMeter,
 double slotDepthMeter,
 double cellWidthMeter,
 double rotation,
 double tiltAngle,
 boolean singleUnitFirst,
 Color shelvesColor,
 Color frameColor,
 boolean drawLegs,
 int baysBetweenLegs,
 boolean simplifiedAgentAnimation)

Method Details

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 Color getShelvesColor()
Returns the color of rack shelves. For drive in storage an error will occur.
Returns:
color of rack shelves

getFrameColor

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

setShelvesColor

public void setShelvesColor(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(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 false otherwise.
Returns:
true if specific in-slot speed was enabled and false 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

getShelvesTiltAngle

public double getShelvesTiltAngle()
Returns shelves tilt angle in radians.
Returns:
shelves tilt angle in radians

setShelvesTiltAngle

public void setShelvesTiltAngle(double tiltAngle)
Sets the tilt angle of shelves. Cannot be called after markup initialization. May be zero or positive but less then pi/2 (90 deg).
Parameters:
tiltAngle - finite value in radians inside range [0, PI/2)

isLoadingDirectionReversed

public boolean isLoadingDirectionReversed()
Returns value of parameter 'Reverse loading direction'
Returns:
value of parameter 'Reverse loading direction'

setReverseLoadingDirection

public void setReverseLoadingDirection(boolean reversed)
Sets value of parameter 'Reverse loading direction'. Cannot be called after markup initialization. May be set true only for storage with stand-alone rack placement.

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.

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,
 StorageSlot slot)
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 a cell
slot - - address of the slot

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 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 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

store

public void store(Agent agent,
 StorageSlot slot)
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
slot - - address of the slot

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 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 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

getRandomAvailableSlot

public StorageSlot getRandomAvailableSlot()

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. Note that this method cannot be used with LIFO and FIFO flow storage types.
Returns:
next cell available for reservation in a random slot from the storage

freeCells

public 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 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 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(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,
 Color color)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.

updateDynamicProperties

public void updateDynamicProperties()
Description copied from class: AbstractMarkup
Updates dynamic properties of this shape only (without structural contents, if any) in a given context.
Method should be overridden for shapes with dynamic properties. Note that you should call super.updateDynamicProperties() at the end of overridden method
Overrides:
updateDynamicProperties in class AbstractMarkup