AnyLogic
Expand
Font size

Station

Use the Station space markup element to draw a simple processing station on a conveyor. The installed station doesn’t break the conveyor into two conveyors.

The station can process more than 1 material item at a time. The maximum number of material items it can hold inside simultaneously is defined by the Capacity parameter.

The station has two processing modes:

  • Processing starts when capacity is full. The station accumulates material items until its full capacity is reached and then processes all of them simultaneously.
  • Processing starts when agent enters station. The station starts to process each material item individually as soon as its leading edge enters the station. For each material item the processing will last for the specified time. During processing the material item keeps moving through the station until it reaches the exit where it stops and waits until the processing is completed. Then it leaves the station if another material item doesn’t block its way out. The station can accommodate as many material items as defined by the Capacity parameter, but all of them can be in different stages of processing.

Changing the station's capacity at runtime

Sometimes you need to model a station with capacity that may change at some point of model run. Use the station's setCapacity() function to define a new capacity.

The station will behave in different ways depending on the station's processing mode and when exactly you call the setCapacity() function.

If capacity is set to 0, the station will not accept any new agents. The processing of items on the conveyor will be blocked.

Processing mode I want to decrease capacity I want to increase capacity
Processing starts when capacity is full
  • If the station is currently processing material items, the processing will be finished. Next time the station will accept material items according to the new decreased capacity.
  • If the station holds less material items than the specified old capacity or the processing hasn't finished yet, the station will start processing and AnyLogic will issue a warning message. If at the start of processing the station holds the same number of material items as the specified new capacity, there will be no warning.
  • If the station is currently empty, it will accept the material items according to the new decreased capacity. The "extra" items will wait at the entrance to the station until the next time.
  • If the station holds less material items than the specified new capacity, the station will accept the items until this new capacity is achieved and only then start processing.
  • If the station holds less material items than the specified new capacity and the processing has already started, AnyLogic will issue a warning message, but the processing will be finished. Next time the station will accept material items according to the new increased capacity.
  • If the station is currently empty or the processing hasn't started yet, the station will wait until it achieves the specified new capacity and only then begin the processing.
Processing starts when agent enters station
  • If the station currently holds more unprocessed material items than the specified new capacity, then no other items will be accepted until the number of the unprocessed items meets the new capacity.
  • If the number of unprocessed items inside the station is less than the specified new capacity, the station will accept items until the new capacity is reached.
  • The material items waiting at the entrance to the station will enter the station until the number of unprocessed items inside the station meets the specified new capacity.

Use the Delay parameter to specify the time that the station will spend on processing the material items.

Conveyor expects items of the same type after the station.

To draw a station

  1. Drag the Station element from the Space Markup section of the Material Handling Library palette to the agent diagram containing a conveyor. A station can be drawn only if the conveyor has been previously drawn. When moving the mouse over the agent diagram, you will see that all elements but the conveyor are temporarily hidden.
  2. Place the mouse over the conveyor just where you want to place the element. You will see that the station connects to the conveyor. Move your mouse to properly locate the element and release the mouse button when done You may change its location by dragging it along the conveyor.
  3. You can change the length of the station by dragging the rectangle point located on the element’s end with the mouse or by specifying the Length value in the element’s properties. The width of the station is automatically adjusted once you change the width of the conveyor.

To adjust position of a station

  1. Click the station you need to edit.
  2. Drag the station to the desired position on the current conveyor.
    You cannot drag it to the other conveyor.
    Alternatively, you can change the station position by modifying the Offset from conveyor start parameter in the element’s properties.

Properties

General

Name — The name of this station. The name is used to identify and access the element from code and properties of Material Handling Library blocks.

Ignore — If selected, the station is excluded from the model.

Visible on upper agent — If selected, the station is also visible on the upper agent where this agent lives.

Lock — If selected, the station is locked. Locked shapes do not react to mouse clicks - it is impossible to select them in the graphical editor until you unlock them.

Visible — Here you specify whether the shape is visible on animation at model runtime, or not. Using the control, choose yes or no.

Material item type — The type of the material item that is processed at this station. This type is automatically taken from the conveyor this station is located on. Do not change the material item type since the conveyor expects items of the same type after the station.

Delay type — The type of item release trigger:

  • Specified time — the processing ends when the specified time elapses
  • Until stopProcess() is called — the user should end the processing and release the agent by calling the function stopProcess(). If the station is in the mode, use the stopProcess(Agent agent) function.

Process time — [Visible if Delay type: Specified time] Expression evaluated to obtain the processing time for the agent. The current material item can be accessed as local variable agent.

Capacity — The maximum number of material items that the station can contain simultaneously. You can specify a new capacity in runtime.

Processing — Defines the processing mode of material items inside the station:

  • starts when capacity is full — the station waits until its Capacity is full and processes all material items simultaneously
  • starts when agent enters station — the station begins the processing of each material item individually when its leading edge enters the station

Loading — [Only visible if Processing: starts when capacity is full] Defines the loading mode of new material items to the station:

  • Simultaneous with unloading — Loading of a material item to the station may be performed simultaneously with the unloading of the processed material item from the station
  • Starts when unloading completes — Loading of a new material item will be started when all the processed material items have left the station
Resources
In the Processing starts when agent enters station mode, the resources are used with the whole station and not with individual agents (material items). Therefore, all dynamic parameters and callbacks with agent and allAgents arguments, which are related to the resources, will be called only for those agents (material items) that activate the station from its idle state. If the station is already active, i.e. it is processing the material items, such functions will not be called. In this mode the list passed as the allAgents argument will contain only the first agent that enters the station.

Use resources — Defines if the station uses a set of resource units.

Seize — Here you can choose whether the station requires resource(s) of just one single resource type (units of the same pool), or resources of different types ((alternative) resource sets). For details, refer to the section below.

Resource sets — [Visible if Seize: (alternative) resource sets]Here you define set(s) of resources required to perform the item processing. 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 resource units. For details, refer to the section below.

Resource pool — [Visible if Seize: units of the same pool] Here you specify the ResourcePool block defining the resources requested to perform the item processing. For details, refer to the section below.

Number of units — [Visible if Seize: units of the same pool] Expression evaluated to obtain the required number of resource units for the agent.

Send seized resources — If selected (true), the seized resources will be sent to the specified location. The current material item can be accessed as local variable agent.

Destination is — [Visible if Send seized resources is selected] Defines where the resources will be sent. The resources can be sent to:

  • Network node — the specified network node
  • Attractor — the specified attractor
  • (x, y, z) — the specified coordinates

Customize resource choice — If the option is selected, you can choose some specific resource units for the operation (using the Resource choice condition below). Default value is false.

Resource choice condition — [Visible if Customize resource choice is selected] Here you can specify boolean expression that will be checked to find the specific resource unit(s) that may perform the operation. If none currently available resource unit(s) satisfy the specified condition (the condition returns false), Station will wait for the first resource unit that matches the condition. Usually you define some field inside the agent type (say,myAssistant), store there the reference to the resource unit when it starts working with this agent (agent.myAssistant = unit), and then specify here the condition agent.myAssistant == unit enabling only this particular unit to continue working with this particular agent.


Value type: boolean
Default value: true
Local variables:
T agent — the material item
Agent unit — the unit
List allAgents — the list of material items
Actions

In all the actions, the current material item is accessible as the local variable agent.

On process started — Here you can type Java code executed each time when the station starts processing the item, if the station processes items one by one. If the processing at the station starts when its capacity is full, meaning, multiple items are processed simultaneously, this code will be executed only once: when the processing for the whole batch begins.

On process finished — Here you can type Java code executed each time when the station stops processing the item, if the station processes items one by one. If the processing at the station starts when its capacity is full, meaning, multiple items are processed simultaneously, this code will be executed only once: when the processing for the whole batch has been finished.

On leading edge enter — Here you can type Java code that will be executed when the leading edge of the material item reaches the station on the conveyor.

On trailing edge enter — Here you can type Java code that will be executed when the trailing edge of the material item reaches the station.

On leading edge exit — Here you can type Java code that will be executed when the leading edge of the material item leaves the station.

On trailing edge exit — Here you can type Java code that will be executed when the trailing edge of the material item leaves the station.

On failed — Here you can type Java code that will be executed in case of station failure.

On repaired — Here you can type Java code that will be executed when the station is repaired.

Appearance

Fill color — Shape’s fill color. Choose No color, if you do not want the area to be filled.

Line color — Outline color. Choose No color, if you do not want outline to be drawn.

Position and size

Offset from conveyor start — The distance (in pixels) from the starting point of the conveyor to the ending point of the station, in pixels.

Length — Defines the length of the station in the length units that you choose in the drop-down menu to the right of this field. The default length of the station is 4 meters.

Advanced

Show in — Here you can choose whether you want the shape to be shown both in 2D and 3D animation, or in 2D only, or in 3D only.

Show name — If selected, the shape name is displayed on the graphical diagram.

Functions

State
Function Description
boolean isProcessing() Returns true if the station is processing agents (material items), returns false otherwise.
boolean isProcessing(Agent agent) Returns true if the station is processing the given agent (material item), returns false otherwise (or if the station is broken).

agent — material item
void stopProcess() Stops processing agents inside at the station when called. All these agents leave the station upon the function's call. The conveyor doesn't stop and the processing of new agents that enter the station goes on as usual.
void stopProcess(Agent agent) Stops processing the given agent (material item) at the station. The given agent leaves the station upon the function's call. The conveyor doesn't stop, and the processing of other agents goes on as usual.
This function can only be called when the station is in the Processing starts when agent enters station mode. If the station is in the other processing mode, use the stopProcess() function.

agent — material item
boolean isFailed() Returns true if the station failed (broke down) and is not operating, returns false otherwise.
boolean fail() Initiates station failure. The station stops processing the agents. New agents cannot enter the station and the agents that were inside the station at the moment of failure remain inside until the station is repaired.
boolean repair() Repairs the station, makes it available to agents again. Resumes station processing.
Agent (material item)
Function Description
T getAgent(int index) Returns the agent (material item) with the specified index that is currently located in the station, returns null if none. The index count starts from 0 and is calculated from the exit of the station.

index — the index of the agent (material item)
List<T> getAgents() Returns the list of agents (material items) that are currently located in the station, returns null if none.
boolean contains(Agent agent) Returns true if the given agent (material item) is inside the station, returns false otherwise.
boolean removeAgent(Agent agent) Removes the given agent from the station. The agent will be removed only if it is currently located inside the station. If the agent was removed successfully, returns true, otherwise returns false.

agent — the agent (material item) to be removed from the station
Resources
Function Description
boolean isUseResources() Returns true if the station is using resource units, returns false otherwise.
boolean isSeizeFromOnePool() Returns true if the station is using resource units of the same pool, returns false otherwise.
Object getResourceDestinationType() Returns the type of destination the resources are sent to.

Valid values:
Seize.DestinationType.DEST_NODE — the node the resources are sent to
Seize.DestinationType.DEST_ATTRACTOR — the attractor the resources are sent to
Seize.DestinationType.DEST_XYZ — the coordinates the resources are sent to
Capacity
Function Description
int getCapacity() Returns the maximum number of agents (material items) that may be processed by this station simultaneously.
void setCapacity(int capacity) Sets the number of agents (material items) that may be processed by this station simultaneously. You can call this function at runtime. The station may exhibit different behaviors depending on the station's processing mode and the moment when the function has been called.
If capacity is set to 0, the station will not accept any new agents. The processing of items on the conveyor will be blocked.
capacity — the number of agents (material items)
int size() Returns the current number of agents (material items) inside the station, returns nullif none.
Loading mode
Function Description
void setLoadingMode(ConveyorSimpleStationLoadingMode mode) Defines the loading mode of new material items to the station.


mode
 — new loading mode.
Valid values:
SIMPLE_STATION_LOADING_MODE_SIMULTANEOUS_WITH_UNLOADING — loading of a material item to the station will be performed simultaneously with the unloading of the processed material item from the station
SIMPLE_STATION_LOADING_MODE_AFTER_UNLOADING — loading of a new material item will be started when all the processed material items have left the station
ConveyorSimpleStationLoadingMode getLoadingMode() Returns the loading mode of new material items to the station.

Valid values:
SIMPLE_STATION_LOADING_MODE_SIMULTANEOUS_WITH_UNLOADING — loading of a material item to the station will be performed simultaneously with the unloading of the processed material item from the station
SIMPLE_STATION_LOADING_MODE_AFTER_UNLOADING — loading of a new material item will be started when all the processed material items have left the station
Level
Function Description
Level getLevel() Returns the level where this station is located.
Conveyor and network
Function Description
int getConveyor() Returns the conveyor the station is located on.
double getOffset() Returns the offset from the conveyor’s starting point.
ConveyorNetwork getNetwork() Returns the network the station belongs to.
Visibility
Function Description
boolean isVisible() Returns true if the station is visible; returns false otherwise.
void setVisible(boolean v) Sets the visibility of the station.

v — visibility. If v is true — the station is set to be visible, if it is false — not visible.
Advanced
Function Description
double length(LengthUnits units) Returns the length of the station calculated in 3D space.

units — one of the length unit constants
ConveyorSimpleStationDelayType getDelayType() Returns the station’s delay type.

Valid values:
CONVEYOR_SIMPLE_STATION_DELAY_TYPE_MANUAL — the user ends the processing by calling the Delay block’s function stopProcess()
CONVEYOR_SIMPLE_STATION_DELAY_TYPE_TIMEOUT — the processing ends when the specified time elapses
Removal
Function Description
void remove() Removes the station from the presentation. If the station is not a part of presentation, the function does nothing.
Removal from the presentation does not necessarily mean removing from the model logic, since logical networks and routes may have been created before the removal and survive it.

Using resources

Processing may involve resource usage - in this case you should check the Use resources checkbox, and specify the resource(s) required to perform the processing.

  • If the processing requires resource(s) just of one single type (say, two workers), choose the option units of the same pool in the Seize parameter. Then choose the required ResourcePool block from the Resource pool parameter’s drop-down list (or just select the block in the graphical editor). And finally, specify the number of required resources to complete the operation in the Number of units field below.

  • You may seize any number of different resources to process the material item, e.g. one robot and two controllers. Just choose Seize: (alternative) resource sets, then choose the resources in the list below, and finally specify the number of resource units in the right part of the list:

  • You can even define several alternative resource sets for the operation. When the material item enters the station, the first resource set is checked for availability. If resources are busy, the second resource set is checked for availability, and so on. The first available resource set is chosen to perform the processing.

How can we improve this article?