Package com.anylogic.engine.markup
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup
- Methods inherited from class com.anylogic.engine.markup.MarkupShape
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkup
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Methods inherited from interface com.anylogic.engine.markup.RackUnitAggregator
- Constructor Details
- Method Details
- setStorageSystem
- getStorageSystem
- isObstacle
- setObstacle
- isSimplifiedAgentAnimation
- setSimplifiedAgentAnimation
- getShelvesColor
- getFrameColor
- setShelvesColor
- setFrameColor
- getLibraryDescriptor
- isUnitAccessibleFromLeftAdd
- isUnitAccessibleFromRightAdd
- isUnitAccessibleFromLeftRemove
- isUnitAccessibleFromRightRemove
- getNumberOfRacks
- setNumberOfRacks
- getX
- setX
- getY
- setY
- getZ
- setZ
- getNumberOfBays
- setNumberOfBays
- getNumberOfCellsPerSlot
- setNumberOfCellsPerSlot
- getSlotDepth
- getRackDepth
- setRackDepth
- getNumberOfShelves
- setNumberOfShelves
- isSpecifiedInslotSpeed
- setSpecifiedInslotSpeed
- getInslotSpeed
- setInslotSpeed
- getCellHeight
- getShelfHeight
- setShelfHeight
- getAisleWidth
- getAisleWidth
- setAisleWidth
- getCellDepth
- getCellDepth
- getUnitLength
- getUnitHeight
- getAccessZone
- setAccessZone
- getLeftPassage
- getRightPassage
- getCellWidth
- getCellWidth
- setCellWidth
- unitHasAvailableCells
- getRotation
- setRotation
- getShelvesTiltAngle
- setShelvesTiltAngle
- isLoadingDirectionReversed
- setReverseLoadingDirection
- getRackType
- setRackType
- getRackPlacement
- setRackPlacement
- contains
- getBoundingRectangle
- getCorners
- getNumberOfAisles
- getFullWidth
- getFullHeight
- capacity
- nStored
- nRetrieved
- utilization
- resetStats
- setReservation
- setReservation
- setReservation
- cancelReservation
- retrieve
- retrieve
- retrieve
- retrieve
- deactivateCells
- deactivateCells
- deactivateCells
- nReservedCells
- hasSpace
- hasSpace
- reservedCells
- reservedCells
- store
- store
- store
- store
- store
- getAgentInCell
- getAgents
- getCell
- getCell
- getSlot
- getCells
- getRandomAgent
- contains
- size
- getRandomAvailableSlot
- getRandomFreeCell
- freeCells
- freeCells
- freeCells
- isFree
- nFreeCells
- nFreeCells
- nFreeCells
- nFreeCells
- enableDebugAnimator
- enableGeometryAnimator
- setIgnoreCellAccessibility
- isIgnoreCellAccessibility
- isSingleUnitFirst
- onAgentStorage
- onAgentRetrieval
- updateSVGProperties
- resetSVGState
- findSVGElement
- isInvertedRack
- updateColorMap
- updateDynamicProperties
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkup
- com.anylogic.engine.markup.MarkupShape
- com.anylogic.engine.markup.AbstractLevelMarkup
- com.anylogic.engine.markup.Storage
- All Implemented Interfaces:
AggregatableAnimationElement
,HasLevel
,LevelElement
,LevelMarkup
,RackUnitAggregator
,SVGElement
,Serializable
public class Storage extends AbstractLevelMarkup implements RackUnitAggregator
- See Also:
- Serialized Form
Constructor | Description |
---|---|
Storage() |
Creates a new Storage with default parameters.
|
Storage |
Modifier and Type | Method | Description |
---|---|---|
void | cancelReservation |
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 |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
boolean | contains |
Returns
true if the specified agent is stored in the storage and false otherwise. |
void | deactivateCells | |
void | deactivateCells | |
void | deactivateCells | |
void | enableDebugAnimator | |
void | enableGeometryAnimator() | |
SVGElement | findSVGElement |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
List<StorageCell> | freeCells |
Returns a list of all free cells in the specified rack.
|
List<StorageCell> | freeCells |
Returns a list of all free cells in the specified bay.
|
List<StorageCell> | freeCells |
Returns a list of all free cells in the specified slot
Can be called only after markup initialization.
|
double | getAccessZone |
Returns the width of access zone in specified length units.
|
Agent | getAgentInCell |
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.
|
double | getAisleWidth() | |
double | getAisleWidth |
Returns the aisle width in specified length units.
|
BoundingRectangle | getBoundingRectangle() | |
StorageCell | getCell |
Returns the specified cell.
|
StorageCell | getCell |
Returns the cell that contains the specified agent.
|
double | getCellDepth() | |
double | getCellDepth | |
double | getCellHeight() | |
List<StorageCell> | getCells() |
Returns a list of cells ordered according to rack type.
|
double | getCellWidth() | |
double | getCellWidth |
Returns the cell width in specified length units.
|
Point[] | getCorners() | |
Color | getFrameColor() |
Returns the color of rack frame.
|
double | getFullHeight() | |
double | getFullWidth() | |
double | getInslotSpeed |
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 |
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.
|
StorageSlot | getRandomAvailableSlot() | |
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 |
Returns the z-height of a shelf in specified length units.
|
Color | getShelvesColor() |
Returns the color of rack shelves.
|
double | getShelvesTiltAngle() |
Returns shelves tilt angle in radians.
|
StorageSlot | getSlot |
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 |
Returns
true if the specified slot has cells available for reservation and false otherwise. |
boolean | isFree | |
boolean | isIgnoreCellAccessibility() | |
boolean | isInvertedRack | |
boolean | isLoadingDirectionReversed() |
Returns value of parameter 'Reverse loading direction'
|
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 false otherwise. |
boolean | isUnitAccessibleFromLeftAdd | |
boolean | isUnitAccessibleFromLeftRemove | |
boolean | isUnitAccessibleFromRightAdd | |
boolean | isUnitAccessibleFromRightRemove | |
int | nFreeCells() |
Returns the number of free cells.
|
int | nFreeCells |
Returns the number of free cells in the specified rack.
|
int | nFreeCells |
Returns the number of free cells in the specified bay.
|
int | nFreeCells |
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 |
Calls the storage's
onAgentRetrieval callback code |
void | onAgentStorage |
Calls the storage's
onAgentStorage callback code |
List<StorageCell> | reservedCells |
Returns a list of reserved cells located in the specified bay.
|
List<StorageCell> | reservedCells |
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 |
Retrieves and returns the next agent from the specified rack.
|
Agent | retrieve |
Retrieves and returns the next agent from the specified bay.
|
Agent | retrieve |
Retrieves and returns the next agent from the specified slot.
|
Agent | retrieve |
Retrieves and returns the previously stored agent from the storage.
|
void | setAccessZone |
Sets the width of access zone in specified length units.
|
void | setAisleWidth |
Sets the aisle width in specified length units.
|
void | setCellWidth |
Sets the cell width in specified length units.
|
void | setFrameColor |
Sets the color of rack frame.
|
void | setIgnoreCellAccessibility | |
void | setInslotSpeed |
Sets in-slot speed in specified speed units
|
void | setNumberOfBays |
Sets the number of bays per rack.
|
void | setNumberOfCellsPerSlot |
Sets number of cells per slot.
|
void | setNumberOfRacks |
Sets the number of racks.
|
void | setNumberOfShelves |
Sets number of shelves per rack.
|
void | setObstacle |
Sets the racks of this storage as obstacles for transporters moving in free space mode.
|
void | setRackDepth |
Sets the rack depth in specified length units.
|
void | setRackPlacement |
Defines rack placement.
|
void | setRackType |
Sets the rack type.
|
void | setReservation |
Reserves a cell for the specified agent in the specified bay.
|
void | setReservation |
Reserves a cell for the specified agent in the specified slot.
|
void | setReservation |
Reserves a cell for the specified agent in the specified slot.
|
void | setReverseLoadingDirection |
Sets value of parameter 'Reverse loading direction'.
|
void | setRotation |
Sets the rotation of the storage.
|
void | setShelfHeight |
Sets the z-height of a shelf in specified length units.
|
void | setShelvesColor |
Sets the color of rack shelves.
|
void | setShelvesTiltAngle |
Sets the tilt angle of shelves.
|
void | setSimplifiedAgentAnimation |
Controls the way the stored agents are drawn.
|
void | setSpecifiedInslotSpeed |
Enables specific in-slot speed if the argument is
true and disables if the argument is false . |
void | setStorageSystem | |
void | setX |
Sets the X coordinate of this storage.
|
void | setY |
Sets the Y coordinate of this storage.
|
void | setZ |
Sets the Z coordinate of this storage.
|
int | size() |
Returns the number of stored agents.
|
void | store |
Stores the given agent in the storage.
|
void | store |
Stores the agent in the specified rack.
|
void | store |
Stores the agent in the specified bay.
|
void | store |
Stores the agent in the specified slot.
|
void | store |
Stores the agent in the specified slot.
|
boolean | unitHasAvailableCells | |
void | updateColorMap |
This method is internal and shouldn't be called by
user.
it may be removed/renamed in future. |
void | updateDynamicProperties() |
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. |
SVGElement | updateSVGProperties |
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.
|
error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner
discardOwner, executeUserAction, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, setVisible, updateDynamicPropertiesStructural
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.@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)
@AnyLogicInternalLibraryAPI public void setStorageSystem(RackUnitAggregator rs)
public RackUnitAggregator getStorageSystem()
Returns the storage system this element belongs to.
- Returns:
- StorageSystem this element belongs to
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, returnsfalse
public void setObstacle(boolean isObstacle)
Sets the racks of this storage as obstacles for transporters moving in free space mode.
- Parameters:
isObstacle
- - iftrue
, the racks are set as obstacles. Otherwise, not.
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 returnsfalse
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
public Color getShelvesColor()
Returns the color of rack shelves. For drive in storage an error will occur.
- Returns:
- color of rack shelves
public Color getFrameColor()
Returns the color of rack frame.
- Returns:
- color of rack frame
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
public void setFrameColor(Color frameColor)
Sets the color of rack frame.
- Parameters:
frameColor
- color of rack frame
@AnyLogicInternalAPI public IStorageDescriptor getLibraryDescriptor()
@AnyLogicInternalLibraryAPI public boolean isUnitAccessibleFromLeftAdd(int unit)
@AnyLogicInternalLibraryAPI public boolean isUnitAccessibleFromRightAdd(int unit)
@AnyLogicInternalLibraryAPI public boolean isUnitAccessibleFromLeftRemove(int unit)
@AnyLogicInternalLibraryAPI public boolean isUnitAccessibleFromRightRemove(int unit)
public int getNumberOfRacks()
Returns the number of racks.
- Returns:
- number of racks
public void setNumberOfRacks(int numberOfRacks)
Sets the number of racks. Cannot be called after markup initialization.
- Parameters:
numberOfRacks
- positive integer value
public double getX()
Returns the X coordinate of this storage.
- Returns:
- the X coordinate of this storage
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
public double getY()
Returns the Y coordinate of this storage.
- Returns:
- the Y coordinate of this storage
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
public double getZ()
Returns the Z coordinate of this storage.
- Returns:
- the Z coordinate of this storage
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
public int getNumberOfBays()
Returns the number of bays per rack.
- Returns:
- number of bays per rack
public void setNumberOfBays(int numberOfBays)
Sets the number of bays per rack. Cannot be called after markup initialization.
- Parameters:
numberOfBays
- positive integer value
public int getNumberOfCellsPerSlot()
Returns the number of cells per slot.
- Returns:
- number of cells per slot
public void setNumberOfCellsPerSlot(int numberOfCells)
Sets number of cells per slot. Cannot be called after markup initialization.
- Parameters:
numberOfCells
- positive integer value
@AnyLogicInternalLibraryAPI public double getSlotDepth()
public double getRackDepth(LengthUnits units)
Returns the rack depth in specified length units.
- Parameters:
units
- - length units- Returns:
- rack depth in specified length units
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 unitsunits
- - length units
public int getNumberOfShelves()
Returns the number of shelves per rack.
- Returns:
- number of shelves per rack
public void setNumberOfShelves(int numberOfShelves)
Sets number of shelves per rack. May not be called after initialization of markup.
- Parameters:
numberOfShelves
- positive integer value
public boolean isSpecifiedInslotSpeed()
Returns
true
if specific in-slot speed was enabled and false
otherwise.- Returns:
true
if specific in-slot speed was enabled andfalse
otherwise
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
public double getInslotSpeed(SpeedUnits units)
Returns in-slot speed in specified speed units.
- Parameters:
units
- - speed units- Returns:
- inslot speed in specified speed units
public void setInslotSpeed(double speed, SpeedUnits units)
Sets in-slot speed in specified speed units
- Parameters:
speed
- - speed valueunits
- - speed units
@AnyLogicInternalLibraryAPI public double getCellHeight()
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
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 unitsunits
- - length units
@AnyLogicInternalLibraryAPI public double 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
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 unitsunits
- length units
@AnyLogicInternalLibraryAPI public double getCellDepth()
@AnyLogicInternalAPI public double getCellDepth(LengthUnits units)
@AnyLogicInternalAPI public double getUnitLength()
@AnyLogicInternalAPI public double getUnitHeight()
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
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 unitsunits
- - length units
@AnyLogicInternalLibraryAPI public double getLeftPassage()
@AnyLogicInternalLibraryAPI public double getRightPassage()
@AnyLogicInternalLibraryAPI public double 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
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 unitsunits
- - length units
@AnyLogicInternalLibraryAPI public boolean unitHasAvailableCells(int unit, Agent agent)
public double getRotation()
Returns the rotation of the storage in radians.
- Returns:
- rotation of the storage in radians
public void setRotation(double rotation)
Sets the rotation of the storage. Cannot be called after markup initialization.
- Parameters:
rotation
- finite value in radians
public double getShelvesTiltAngle()
Returns shelves tilt angle in radians.
- Returns:
- shelves tilt angle in radians
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)
public boolean isLoadingDirectionReversed()
Returns value of parameter 'Reverse loading direction'
- Returns:
- value of parameter 'Reverse loading direction'
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.public RackType getRackType()
Returns the rack type.
- Returns:
- rack type
public void setRackType(RackType type)
Sets the rack type. Cannot be called after markup initialization.
- Parameters:
type
- type of the storage. Cannot be null.
public RackPlacement getRackPlacement()
Returns rack placement type.
- Returns:
- rack placement type
public void setRackPlacement(RackPlacement rackPlacement)
Defines rack placement. Cannot be called after markup initialization.
- Parameters:
rackPlacement
- rack placement type. Cannot be null.
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 classMarkupShape
- Parameters:
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's container- Returns:
true
if the shape contains the point with the given coordinates
public BoundingRectangle getBoundingRectangle()
@AnyLogicInternalAPI public Point[] getCorners()
@AnyLogicInternalAPI public double getNumberOfAisles()
@AnyLogicInternalAPI public double getFullWidth()
@AnyLogicInternalAPI public double getFullHeight()
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
public int nStored()
Returns the total number of stored agents. May be reset via
resetStats()
.- Returns:
- total number of stored agents.
public int nRetrieved()
Returns the total number of retrieved agents. May be reset via
resetStats()
.- Returns:
- total number of retrieved agents.
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
public void resetStats()
Resets statistics: the number of stored agents and the number of retrieved agents.
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 cellrack
- - index of rackbay
- - index of bayshelf
- - index of shelf
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 cellslot
- - address of the slot
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 cellrack
- - index of rackbay
- - index of bay
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
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.
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 rackbay
- - index of bayshelf
- - index of shelf- Returns:
- retrieved agent
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 rackbay
- - index of bay- Returns:
- retrieved agent
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
public void deactivateCells(int rack)
public void deactivateCells(int rack, int bay)
public void deactivateCells(int rack, int bay, int shelf)
public int nReservedCells()
Returns the number of reserved (but not occupied) cells.
- Returns:
- number of reserved (but not occupied) cells
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 rackbay
- - index of bayshelf
- - index of shelf- Returns:
true
if the specified slot has cells available for reservation andfalse
otherwise
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 andfalse
otherwise
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 rackbay
- - index of bayshelf
- - index of shelf- Returns:
- list of reserved cells located in the specified slot.
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 rackbay
- - index of bay- Returns:
- list of reserved cells located in the specified bay.
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
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 nullrack
- - index of rack
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 nullrack
- - index of rackbay
- - index of bay
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 nullrack
- - index of rackbay
- - index of bayshelf
- - index of shelf
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 nullslot
- - address of the slot
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 rackbay
- - index of bayshelf
- - index of shelfdeepPosition
- - index of cell- Returns:
- agent stored in the specified cell.
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.
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
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 rackbay
- - index of bayshelf
- - index of shelfdeepPosition
- - index of cell- Returns:
- the specified cell
public StorageSlot getSlot(int rack, int bay, int shelf)
Returns slot address.
- Parameters:
rack
- index of rackbay
- index of bayshelf
- index of shelf- Returns:
- slot address
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
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
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 andfalse
otherwise
public int size()
Returns the number of stored agents.
Can be called only after markup initialization.
- Returns:
- number of stored agents
public StorageSlot getRandomAvailableSlot()
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
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
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 rackbay
- - index of bay- Returns:
- list of all free cells in the specified bay
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 rackbay
- - index of bayshelf
- - index of shelf- Returns:
- list of all free cells in the specified slot
@AnyLogicInternalAPI public boolean isFree(int rack, int bay, int shelf, int depth)
public int nFreeCells()
Returns the number of free cells.
Can be called only after markup initialization.
- Returns:
- number of free cells
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
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 rackbay
- - index of bay- Returns:
- number of free cells in the specified bay
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 rackbay
- - index of bayshelf
- - index of shelf- Returns:
- number of free cells in the specified slot
@AnyLogicInternalAPI public void enableDebugAnimator(ShapeDrawMode mode)
@AnyLogicInternalAPI public void enableGeometryAnimator()
@AnyLogicInternalAPI public void setIgnoreCellAccessibility(boolean ignore)
@AnyLogicInternalAPI public boolean isIgnoreCellAccessibility()
@AnyLogicInternalAPI public boolean isSingleUnitFirst()
public void onAgentStorage(Agent agent, StorageCell cell)
Calls the storage's
onAgentStorage
callback code- Parameters:
agent
- - the agent that has been stored in storagecell
- - the cell that was occupied by agent
public void onAgentRetrieval(Agent agent, StorageCell cell)
Calls the storage's
onAgentRetrieval
callback code- Parameters:
agent
- - the agent that has been retrieved from storagecell
- - the cell that was released by agent
@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.
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 interfaceSVGElement
- Overrides:
updateSVGProperties
in classAbstractMarkup
- Parameters:
output
- the list of commands to add todrawMode
- TODOpublicOnly
- drawing context: if true, only shapes that are marked as public only are updatedowner
- the SVG element that serves as a container for this elementelbehind
- 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 givenowner
when the svg element is added to a different place (e.g. GIS map).
@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.
it may be removed/renamed in future.
- Specified by:
resetSVGState
in interfaceSVGElement
- Overrides:
resetSVGState
in classAbstractMarkup
@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.
it may be removed/renamed in future.
- Specified by:
findSVGElement
in interfaceSVGElement
- Overrides:
findSVGElement
in classAbstractMarkup
@AnyLogicInternalAPI public boolean isInvertedRack(int rack)
@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.
it may be removed/renamed in future.
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
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 classAbstractMarkup