AnyLogic
Expand
Font size

StorageSystem

Used to represent a number of storages as a single block with multiple racks and aisles and serves as a central access and management point for them.

To create a storage system, first you need to configure each individual storage separately. The storages do not need to be identical: they can have different capacities and dimensions; neither do they need to be graphically aligned. After the configuration is done, you simply provide the list of storages to the Storages parameter of the StorageSystem.

Starting with version 8.9.5, AnyLogic supports storages with initial stock. You can set the storage system to be initially filled with agents (material items) on model startup fully or partially, according to the specified properties.

Properties

Storages
The list of storages that should be included in the system.
Syntax: Storage[] storages

Initial stock

Storage system

Determines whether the agents (material items) should be created at the start of the model so that the storage system is initially filled with them. The available options are:

is initially empty — agents (material items) are not generated, and all the storages of the storage system are initially empty.
contains a given number of items — the storages are partially filled with agents (material items) according to the properties located below.
is fully filled — the storage system is completely filled with agents (material items).
Syntax: InitialFillingPolicy initialFillingPolicy
Set new value at runtime: set_initialFillingPolicy(new value)
Default value: are initially empty
Valid values:
StorageSystem.INITIAL_EMPTY — is initially empty
StorageSystem.INITIAL_PARTIAL — contains a given number of items
StorageSystem.INITIAL_FULL — is fully filled
New agent
[Visible if the Storage system option is not set to is initially empty]
The type of agent (material item) generated by the block. In this article, it is referred as T. Typically, you simply select the agent type name from the list. In rare cases (for example, when you need to parameterize agents with different attribute values), you can switch to the dynamic value editor and specify the agent type constructor there. If you need to define a new custom material item type and fill the storage system with items of this type on startup, click the create a custom type link below.
Default value: Agent
Change dimensions
[Visible if the Storage system option is not set to is initially empty]
If this option is selected (true), you can change the dimensions of the agent (material item) generated by this block on startup by specifying the new values in the Length, Width, and Height edit boxes.
Value type: boolean
Local variable: T agent — the agent (material item)
Length
[Visible if Change dimensions option is selected]
The length of the generated agent (material item).
Value type: double
Local variable: T agent — the agent (material item)
Width
[Visible if Change dimensions option is selected]
The width of the generated agent (material item).
Value type: double
Local variable: T agent — the agent (material item)
Height
[Visible if Change dimensions option is selected]
The height of the generated agent (material item).
Value type: double
Local variable: T agent — the agent (material item)
Used capacity is defined
[Visible if Storage system: contains a given number of items]

Determines how the number of initially occupied cells of the storage system is defined. The available options are:

by percentage — agents (material items) initially occupy the specified percentage of the total number of storage system's cells.
by exact number of items — storages are initially filled with a certain number of agents (material items) defined in the Number of items property below.
Syntax: CapacityDefinition capacityDefinition
Set new value at runtime: set_capacityDefinition(new value)
Default value: by percentage
Valid values:
StorageSystem.CAPACITY_PERCENT — by percentage
StorageSystem.CAPACITY_NUMBER — by exact number of items
Percentage, %
[Visible if Used capacity is defined: by percentage]
The percentage (value from 0 to 100) of the total number of storage system's cells that is occupied with agents (material items) initially.
Syntax: double capacityPercent
Set new value at runtime: set_capacityPercent(new value)
Default value: 50
Number of items
[Visible if Used capacity is defined: by exact number of items]
The number of cells of the storage system that is initially filled with agents (material items).
Syntax: int capacityNumber
Set new value at runtime: set_capacityNumber(new value)
Default value: 10
Slotting policy
[Visible if Storage system: contains a given number of items]
Slotting policy applied to the initially created agents (material items). The available options are:

according to storage — storages of the storage system are filled sequentially, according to the rules determined by their type.
random — randomly chosen cells of the storages are filled.
Value type: StorageSlottingPolicy
Local variable: T agent — the agent (material item)
Default value: according to storage
Valid values:
StorageSlottingPolicy.ACCORDING_TO_STORAGE — according to storage
StorageSlottingPolicy.RANDOM — random
Add agents to
Specifies whether the agents (material items) created by this block will be stored in the default population of the top-level agent of the model, or in a custom population (specified in the Population property). The default population (a Java collection of the AgentList type) contained in the top-level agent can be accessed with the getDefaultPopulation() function.
Syntax: boolean addToCustomPopulation
Set new value at runtime: set_addToCustomPopulation(new value)
Default value: false — default population
Population
[Visible if Add agents to: custom population]
The name of the agent population in which the agents (material items) created by this block will be stored.
Name: AgentList
Local variable: T agent — agent (material item)

Advanced

Occupied cells animation

Choose how the stored agents are drawn during model run. The available options are:

according to storage — each Storage element aggregated in this storage system uses its own setting specified in the element's Occupied cells animation parameter.
color indication (fast) — individual agent animation is hidden, and the cell is filled with the agent color or a blend of vertically stored agents' colors: this allows for a more informing view of multi-level racks and has much better performance for large-scale warehouses. You can set the agent's color by calling agent.setColor() function. If you choose this option, it will override individual storage settings of the same parameter.
agent animation — individual agent animation is placed in the center of the cell. If you choose this option, it will override individual storage settings of the same parameter.
Syntax: OccupiedCellAnimation drawMode
Set new value at runtime: set_drawMode(new value)
Valid values:
StorageSystem.ACCORDING_TO_STORAGE
StorageSystem.COLOR_INDICATION
StorageSystem.AGENT_ANIMATION

Actions

The actions of StorageSystem do not override the corresponding actions of individual storages and are executed after them.

On agent storage
Here you can place the Java code that will be executed when the agent is placed inside the storage. It is not executed when the storages are initially filled with agents according to the storage system settings.
Local variables:
T agent — agent (material item)
StorageCell cell — storage cell
On agent retrieval
Here you can place the Java code that will be executed when the agent leaves the storage.
Local variables:
T agent — agent (material item)
StorageCell cell — storage cell

Functions

Statistics
Function Description
int capacity() Returns the total capacity of all storages of the storage system.
double utilization() Returns the utilization of the storage system. Utilization is a double value in the [0, 1] range that is calculated as a ratio of occupied cells to the capacity of the storage system.
void resetStats() Resets the statistics of the storage: the number of stored agents and the number of retrieved agents.
int nStored() Returns the total number of stored agents since the model start. The statistics may be reset by calling resetStats() function.
int nRetrieved() Returns the total number of retrieved agents since the model start. The statistics may be reset by calling resetStats() function.
Storages
Function Description
int getNumberOfStorages() Returns the total number of storages in the storage system.
Storage getStorage(int index) Returns the storage with the specified index.

index — index of the storage in the storage system
List<Storage> getStorages() Returns a list of all storages in the storage system.
void addStorage(Storage storage) Adds the given storage to the storage system.

storage — the storage to be added to the storage system
void removeStorage(Storage storage) Removes the given storage from the storage system.

storage — the storage to be removed from the storage system
boolean containsStorage(Storage storage) Returns true if this storage system contains the specified storage.

storage — the storage
Agents

All functions listed here can be called only after space markup initialization.

Function Description
int size() Returns the total number of agents currently stored in the storage system.
List<Agent> getAgents() Returns a list of agents currently stored in the storage system.
Agent getRandomAgent() Returns a random agent stored in the storage system. If the storage system is empty, returns null.
Storage getStorage(T agent) Returns the storage containing the specified agent. If the agent is not stored in this storage, returns null.

agent — the agent (material item)
boolean contains(Agent agent) Returns true if the given agent is stored in the storage and false otherwise.
In FIFO flow and LIFO flow storages, this function doesn’t consider the agents still moving through the shelf to their target cells.

agent — the agent (material item)
Agent getRandomAccessibleAgent() Returns a random agent that is stored in the storage system and can be retrieved (considering the type of the storage). If the storage system is empty, returns null.
Storing and retrieving agents

All functions listed here can be called only after markup initialization.

Function Description
void store(Agent agent) Stores the specified agent in a storage of this storage system that has free cells. The On agent storage callback of both the storage system and the corresponding storage is executed. If there are no free cells, an error will occur.

agent — agent (material item)
Agent retrieve(T agent) Retrieves and returns the previously stored agent from the storage. The On agent retrieval callback of both the storage system and the corresponding storage is executed. In FIFO flow and LIFO flow storages, the agent can be retrieved only from the cell adjacent to the aisle (on the retrieval side in the case of FIFO flow storages). Upon an attempt to retrieve an agent from other cells, an error occurs.

agent — the agent (material item)
void cancelReservation(T agent) Cancels the reservation for the specified agent in the storage system. If there is no reservation for the specified agent, an error occurs. Should not be used with FIFO flow and LIFO flow storages.

agent — the agent (material item)
int nReserved() Returns the total number of reserved (but not occupied) cells in all storages of the storage system. In FIFO flow and LIFO flow storages, this function also considers the cells the moving agents are trying to reach and the cells the agents move through, upon the function call.
boolean hasSpace() Returns true if the storage system has cells available for reservation and false otherwise. Deactivated cells are considered as unavailable for reservation.
Cells

All functions listed here can be called only after space markup initialization.

All functions returning the free cells do not account for deactivated cells.
Function Description
StorageCell getCell(T agent) Returns the cell that contains the specified agent.

agent — the agent (material item)
List<StorageCell> getCells() Returns a list of all cells of the storage system.
StorageCell getRandomFreeCell() Returns a random free cell available for reservation/storing the agent (material item). If there are no available cells, or they cannot be accessed currently because the cells in front of them are occupied, an error occurs.
Doesn’t work with FIFO flow and LIFO flow storages, in this case you should use storage system’s API for slots instead.
List<StorageCell> freeCells() Returns a list of all free cells in the storage system, excluding deactivated cells.
int nFreeCells() Returns the total number of free cells in the storage system, excluding deactivated cells.
Slots

All functions listed here can be called only after space markup initialization.

Function Description
StorageSlot getSlot(Storage storage, int rack, int bay, int shelf) Returns the storage slot with the specified coordinates.

storage — the storage
rack — index of the rack
bay — index of the bay
shelf — index of the shelf
StorageSlot getRandomAvailableSlot() Returns a random available slot of a random storage containing free cells. If there are no free cells, or they cannot be accessed currently because the cells in front of them are occupied, an error occurs.
Position in aisle

All functions listed here return the Position object with the horizontal rotation set towards the cell containing the agent and vertical rotation set to zero.

Function Description
Position getPositionInAisle(T agent) Returns the position in the aisle located in front of the specified agent. If this agent is not stored in the storage system, an error occurs. For FIFO flow storages, use the getPositionInAisle(T agent, boolean loadingSide) function, enabling to specify the side of the rack.

agent — the agent (material item)
Position getPositionInAisle(T agent, boolean loadingSide) Returns the position in the aisle located in front of the given agent. If this agent is not stored in the storage system, an error occurs. In case of FIFO flow storages, the loadingSide argument defines the side of the rack, for other storages it is ignored.

agent — the agent (material item)
loadingSide — the side of the rack, true means loading side, false means retrieval side
Position getPositionInAisle(Storage storage, int rack, int bay) Returns the position in the aisle located in front of the specified slot of the given storage (on the side of the rack used for loading).

storage — the storage
rack — index of the rack
bay — index of the bay
Position getPositionInAisle(Storage storage, int rack, int bay, boolean loadingSide) Returns the position in the aisle located in front of the specified slot of the given storage. In case of FIFO flow storages, the loadingSide argument defines the side of the rack, for other storages it is ignored.

storage — the storage
rack — index of the rack
bay — index of the bay
loadingSide — the side of the rack, true means loading side, false means retrieval side
Animation
Function Description
boolean isSimplifiedAnimation(Storage storage) Returns true if the agents inside the specified storage are animated in the simplified mode (primitive shapes instead of actual agent animation shapes), false otherwise.

storage — the storage
How can we improve this article?