RackStore


RackStore puts agent into a cell of a given pallet rack, or RackSystem. The agent is moved from its current location in the network to the cell location, optionally with the help of moving resources. Optionally, a delay may be associated with putting an agent into a cell; the delay may depend on the cell coordinates, e.g. on its level.

The cell may be specified explicitly as (row, position, level) or chosen automatically. In the latter case RackStore uses the function getFreeCell() of the storage or storage zone.

If resources are used to move the agent, RackStore seizes them, brings to the agent location, attaches to the agent, moves the agent to the cell, executes (an optional) delay, and then releases the resources. Alternatively you can seize and release resources outside the RackStore block, or not use them at all.

You can choose whether the agent (possibly, with the attached resources) moves smoothly all the way along the aisle and then from the aisle to the cell, or moves just along the aisle and then jumps to the cell. The latter case may be useful when animating automated storages.

RackStore exposes a number of extension points to insert your custom actions at different stages of the process.

When the agent exits the RackStore block it is stored in a storage cell. If this is a final point of your agent-related process, i.e. if there is no direct continuation from here, you can put a “blank” Exit block after RackStore, but you should not leave its out port unconnected. Putting Sink instead of Exit would not be correct, as the agent remains in the system.

Parameters

Pallet rack / Rack system [dynamic]
Pallet rack, or storage zone (defined by block RackSystem), where the agent should be put.
Local variable: agent - the agent
The cell is
Defines, whether the cell for the agent is Chosen automatically, or the cell should be Specified explicitly by the user.
Syntax: boolean autoChooseCell
Local variable: agent - the agent
Default value: Chosen automatically (true)
Choose cell closest to
[Visible if The cell is Chosen automatically] Defines, whether the cell is chosen closest to Front of storage/zone, or - to Back of storage/zone.
Syntax: boolean closeToFront
Default value: Front of storage/zone  (true)
Row [dynamic]
[Visible if The cell is Specified explicitly] The row of the cell.
Value type: int
Local variable: agent - the agent
Position [dynamic]
[Visible if The cell is Specified explicitly] The position of the cell.
Value type: int
Local variable: agent - the agent
Level [dynamic]
[Visible if The cell is Specified explicitly] The level of the cell.
Value type: int
Local variable: agent - the agent
For two-aisle racks [dynamic]
[Visible if The cell is Specified explicitly] Choose how you want to store agents in the two-aisled pallet rack:
Put from left aisle
Put from right aisle
Value type: boolean
Default value: Put from left aisle (true)
Local variables: agent - the agent
                         PalletRackAccess<T> rackSystem - the rack system
Move agent to
Moves the agent to the defined destination: Cell (with elevation), Cell base level, or Aisle.
Get value: movementDestination
Default value: Cell (with elevation) (RackStore.DEST_CELL_LEVEL)
Elevation time per level [dynamic]
[Visible if Move agent to is defined by Cell (with elevation)]
Value type: double
Default value: 10 seconds
Local variable: agent - the agent
Use delay
If the checkbox is selected (true), the delay is executed after the agent arrives to the cell and before it is actually put there
Syntax:
  boolean useDelay
Default value: false
Delay time [dynamic]
[Visible if Use delay is selected] Expression evaluated to obtain the delay time for the agent. 
Value type:  double
Local variables: agent - the agent
             PalletRackAccess storage - the storage or storage zone where the agent is put
             int row - the row of the cell
             int position - the position of the cell
             int level -  the level of the cell
Agent location (queue)
Space markup shape for queue.
Name: entityLocationQueue
Resources
Use resources to move
IIf the checkbox is selected (true), the specified moving resources are used to move the agent.
Syntax:  boolean useResources
Default value: false
Resource sets (alternatives) [dynamic]
[Visible if Use resources to move is selected] Here you define set(s) of the required resources. You can define several alternative resource sets (add new list by clicking the Add list button). The resource set is chosen based on the availability of units. 
Local variable: agent - the agent
Move at the speed of resource
[Visible if Use resources to move is selected] If selected (true), the agent moves with the specified moving resources speed.
Syntax: boolean moveWithSpeedOfResourceUnit
Default value: false
Moving resource [dynamic]
[Visible if Move at the speed of resource is selected] If true, the specified moving resources are used to move the agent. 
Value type: ResourcePool
Local variable: agent - the agent
Task priority [dynamic]
[Visible if Use resources to move is selected] The priority of the task for the incoming agent (the larger the higher).
Value type: double
Default value: 0
Local variable: agent - the agent
Task may preempt [dynamic]
[Visible if Use resources to move is selected] If selected, task may preempt the currently performed task (if allowed in the task properties & the task priority is lower).
Value type: boolean
Default value: true
Local variable: agent - the agent
Task preemption policy [dynamic]
[Visible if Use resources to move is selected] Defines the task preemption policy:
No preemption - the current task continues executing.
Wait for original resource - the task is interrupted and waits for the same resource unit to finish it.
Terminate serving - the task is interrupted and never continued.
Seize any resource - the task is interrupted and tries to seize any resource of the specified type.
Continue without resource - the task is finished without resources assistance.
Default value: No preemption
Valid values: RackStore.PP_NO_PREEMPTION
                      RackStore.PP_WAIT_FOR_ORIGINAL_RESOURCE
                      RackStore.PP_TERMINATE_SERVING
                      RackStore.PP_SEIZE_ANY_RESOURCE
                      RackStore.PP_CONTINUE_WITHOUT_RESOURCE
Local variable: agent - the agent
Auto suspend/resume agents
[Visible if Task preemption policy is to Wait for original resource or to Seize any resource] This parameter defines whether the agent whose task is suspended should be automatically suspended in its current flowchart block and automatically resumed at the time there are available resources.
Syntax: boolean suspendResumeEntities
Default value: true
Enter for terminated agents [dynamic]
[Visible if Task preemption policy is to Terminate serving] Enter block for agents which lose all units obtained in this Seize block because of Terminate serving preemption policy, when one of units in the resource set (defined in this Seize) gets grabbed by another task with higher priority.
Local variables: agent - the agent
                          Agent unit - the resource unit which has originated termination
After release resources
[Visible if Use resources to move is selected] Defines whether resources should Return to home location (if they are not immediately seized by another agent) or Stay where they are after being released.
Syntax: boolean resourcesGoHome
Default value: Return to home location (true)
Return home [dynamic]
[Visible, if After release resources: Return to home location]
Here you select in what case resource units will return home after performing the "put agent into a pallet rack cell" task.
There are three alternative options:
each time - resource unit will return in its home location each time this resource unit finishes the task and is released by the agent. 
if no other tasks - resource unit returns in its home location only if there are no other tasks currently waiting for this resource unit.
custom- if you select this option, you can define the priority and preemption policy for "return home" task using the parameters below. In this case the priority of the "return home" task will be compared with priorities of other incoming tasks, and the specified preemption policy will be used to select the next task for this particular resource unit. 
Local variables: agent - the agent
                          Agent unit - the resource unit 
'Wrap-up' priority [dynamic]
[Visible, if Return home: custom] Here you can set up the priority of the "return home" task for the resource unit. 
Value type: double
Local variables: agent - the agent
                          Agent unit - the resource unit 
'Wrap-up' preeemption policy [dynamic]
[Visible, if Return home: custom] Specifies the policy of the "return home" task for the resource unit. 
No preemption - "return home" task cannot be preempted
Terminate - "return home" task may be preempted and will be terminated
Local variables: agent - the agent
                          Agent unit - the resource unit 
Customize resource choice
[Visible if Use resources to move is selected] If the option is selected, you can choose some specific resource unit to perform the "store agent in a pallet rack cell" operation (using the Resource choice condition below.) 
Syntax: boolean customizeResourceChoice
Default value: false
Resource choice condition [dynamic]
[Visible if Customize resource choice is selected] Here you can specify boolean expression that will be checked to find the specific resource unit that may perform the "store agent in a pallet rack cell" operation. If none currently available resource units satisfy the specified condition (the condition returns false), RackStore will wait for the first resource unit that matches the condition.
Usually you define some field inside the agent type (say, worker), store there the reference to the resource unit when it starts working with this agent (agent.worker=unit), and then specify here the condition agent.worker==unit enabling only this particular unit to continue working with this particular agent.
Value type: boolean
Default value: true
Local variables: agent - the agent
                          Agent unit - the resource unit
                          ResourcePool pool - the resource pool
Resource selection [dynamic]
Here you can choose which resource units may be selected for the given agent.
Off (chooses some matching unit)
- no special preference for the selection.
Nearest to the agent - the resource unit which is the closest to the current agent.
The most preferred - the resource unit is selected by comparing resources to each other. The comparison algorithm (or its call) is placed in the field "unit1 is preferred to unit2".
Unit with top rating - the resource unit with the highest rating is selected. The rating (or the algorithm that calculates it) is specified by the user in the Unit rating field.
Default value: Off (chooses some matching unit)
Valid values: RackStore.RESOURCE_SELECTION_SOME_UNIT
                      RackStore.RESOURCE_SELECTION_NEAREST
                      RackStore.RESOURCE_SELECTION_BASED_ON_COMPARISON
                      RackStore.RESOURCE_SELECTION_BASED_ON_RATING_VALUE
Local variable: agent - the agent
                         ResourcePool pool - the resource pool
"unit1 is preferred to unit2" [dynamic]
[Visible if Resource selection is The most preferred] The comparison algorithm (or its call) that is used for choosing a resource for the given agent. The algorithm compares resources to each other. It should return true if the resource unit1 has higher preference than the resource unit2 (and false otherwise, including the case of choice equality). The algorithm should provide transitiveness.
Value type: boolean
Default value: false
Local variables: Agent unit1 - the first resource unit to be compared
                          Agent unit2 - the second resource unit to be compared
                          T agent - the current agent
Unit rating [dynamic]
[Visible if Resource selection is Unit with top rating] The rating value of this unit. The rating is used to choose a unit for the given agent (the larger the higher, unit with the top rating value will be chosen).
Usually an algorithm or a function call is placed here to calculate the rating with the help of the available local variables.
Value type: double
Local variable: agent - the agent
                         Agent unit - the resource unit
Actions
On enter [code]
Code executed when the agent enters this flowchart block.
Local variable: agent - the agent
On resources arrived [code]
[Visible if Use resources to move is selected] Code executed when the resources arrive to the agent current location.
Local variable: agent - the agent
On delay starts [code]
[Visible if Use delay is selected] Code executed when the delay associated with putting the agent starts.
Local variables: agent - the agent
             double delayTime - the delay time
             PalletRackAccess storage - the storage or storage zone where the agent is put
             int row - the row of the cell.
             int position - the position of the cell.
             int level - the level of the cell.
On delay ends [code]
[Visible if Use delay is selected] Code executed when the delay associated with putting the agent ends.
Local variable: agent - the agent
On exit [code]
Code executed when the agent exits the block.
Local variables: agent - the agent
             PalletRackAccess storage - the storage or storage zone where the agent is put
             int row - the row of the cell.
             int position - the position of the cell.
             int level - the level of the cell.
On task suspended [code]
[Visible if Task preemption policy is set to Wait for original resource or Seize any resource] Code executed when agent task is suspended because of Wait for original resource and Seize any resource preemption policy, when its unit gets grabbed by another task with higher priority. 
Local variables: agent - the agent
                          Agent unit - the unit
On task resumed [code]
[Visible if Task preemption policy is set to Wait for original resource or Seize any resource] Code executed when agent resumes processing after it has been suspended because of Seize any resource and Wait for original resource preemption policy.
Local variables: agent - the agent
                          Agent unit - the resource unit
On task terminated [code]
[Visible if Task preemption policy is set to Terminate serving] Code executed when agent loses all units obtained in this RackStore block because of Terminate serving preemption policy, when one of units in the resource set (defined in this RackStore) gets grabbed by another task with higher priority.
Local variables: agent - the agent
                          Agent unit - the resource unit which has originated termination

Functions

int queueSize()Returns the size of the queue of agents waiting for the resource.

recalculateResourceChoiceConditions(Agent agent) - Recalculates choice conditions for the given agent which is currently waiting in the queue of this block. You can use this function when some resource units that previously weren't available for seizure by a particular agent may have become seizable due to changed conditions.

recalculateResourceChoiceConditions() - Recalculates choice conditions for all agents currently waiting in the queue of this block. You can use this function when some resource units that previously weren't available for seizure may have become seizable due to changed conditions.

Ports

in
The input port.
out
The output port.