Custom station

Custom station is the space markup element used in material handling models. It defines a station / working zone where material items are processed. The process is not set up in this element, you should define it on your own (Process Modeling Library and Material Handling Library blocks). 

If the processing can be defined simply as a delay for the specified time, use the Station element instead.  

Custom station is a part of a conveyor network. Custom station can act as a transit point in a conveyor network, any number of conveyors can lead to/from the custom station. It can also be a destination for material items transportation defined by the Convey block.

Custom station is drawn as a polygonal area. The shape and size of the area does not have any logical meaning.

 To add a custom station

  1. Double-click the  Custom Station element in the Space Markup section of the  Material Handling Library palette.
  2. The icon of the element should turn into . It means that the drawing mode is activated and now you can draw a custom station in the graphical editor point by point.
  3. Click in the graphical editor to put the first point of the station area. Do more clicks to add more points. 
  4. Finally put the final point with the double-click. 

Properties

General

Name – The name of the custom station. The name is used to identify and access the custom station from code and Material Handling Library blocks.

Ignore – If selected, the custom station is excluded from the model.

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

Lock – If selected, the custom station shape is locked. Locked shapes do not react to mouse clicks - it is impossible to select them in the graphical editor until you unlock them. It is frequently needed when you want to prevent editing this shape while drawing other shapes over it.

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

Agent location – Here you can choose where agents (material items) should be placed while being inside the custom station. The options are:
Near conveyor - item(s) will be placed near the conveyor they were transported by to this custom station.
Center - item(s) will be placed in the center point of this custom station.
Random - item(s) will be placed in random points inside the station area.

Actions

On enter – Here you can type Java code that will be executed when the agent (material item) enters the custom station. In the action code, the current material item is accessible as the local variable agent

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

X – X-coordinate of the area's start point.

Y – Y-coordinate of the area's start point.

Points

The table located in the Points property section enables users to view and adjust coordinates of the area points.  

Here you define relative coordinates, not the absolute ones. The first point always has coordinates (0,0) that can not be changed.
Other rows of the table define relative coordinates of the successive points. Coordinates of each point are actually offsets of the corresponding point from the start point along X and Y axes correspondingly.

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's name is displayed on the graphical diagram.

Functions

You can dynamically modify shape properties at model runtime using the following API.
Position

Function

Description

double getX()

Returns the X coordinate of the custom station's start point.

double getY()

Returns the Y coordinate of the custom station's start point.

double getZ()

Returns the Z coordinate of the custom station's start point.

void setXYZ
(double x, double y, double z)

Sets new coordinates for the custom station's start point. 

Parameters:
x - the new value of the X coordinate.
y - the new value of the Y coordinate.
z - the new value of the Z coordinate.

Point getCenter()

Returns the point of the shape's center.


Visibility

Function

Description

boolean isVisible()

Returns true if the custom station is visible; returns false otherwise.

void setVisible(boolean v)

Sets the visibility of the custom station.

Parameter: v - visibility. If v is true - the custom station is set to be visible, if it is false - not visible.


Fill color

Function

Description

Color getFillColor()

Returns the fill color of the custom station, or null if the custom station has no fill color or has textured fill (in this case use getFillTexture() to get the custom station's texture).

Texture getFillTexture()

Returns the fill texture of the custom station or null if the custom station has no fill texture or has color fill (in this case use getFillColor() to get the custom station's fill color).

void setFillColor
(Paint fillColor)

Sets the fill color (or Texture) of the custom station.

Parameter: fillColor - the new fill color, if null, the custom station is not filled.


Outline

Function

Description

Color getLineColor()

Returns the color of the custom station's outline, or null if custom station has no outline color or has textured outline (in this case use getLineTexture() to get the outline's texture).

Texture getLineTexture()

Returns the outline texture of the custom station or null if custom station has no outline texture or has colored outline (in this case use getLineColor() to get the outline's color).

void setLineColor(Paint lineColor)

Sets the outline color (or Texture).

Parameter: lineColor - the new outline color, if null, the custom station's outline is not drawn.


Network

Function

Description

ConveyorNetwork getNetwork()

Returns the conveyor network this markup element belongs to or null if this element is not a part of a network.

int getConnectionsCount()

Returns the number of conveyors connected to the custom station.

ConveyorPath getConnection(int index)

Returns the conveyor with the provided index from this node's connections list.

Parameter: index - the zero-based  index of required connection 

List<ConveyorPath> getConnections()

Returns the list of all conveyors connected to this custom station.

List<ConveyorPath> getIncomingPaths()

Returns the list of all incoming conveyors connected to this custom station.

List<ConveyorPath> getOutgoingPaths()

Returns the list of all outgoing conveyors connected to this custom station.


Advanced

Function

Description

boolean contains
(double px, double py)

Returns true if the custom station shape contains the point with the given coordinates; returns false otherwise.

Parameters:
px - the x coordinate of the point relative to this custom station's conveyor (agent).
py - the y coordinate of the point relative to this custom station's conveyor (agent).

Point randomPointInside()

Returns the randomly chosen point inside the area; utilises the default random number generator (the one of the agent containing this shape).

Point randomPointInside(Point out)

Returns the randomly chosen point inside the area; utilises the default random number generator (the one of the agent containing this shape).

Parameter:
out - the output Point object to write the result to. The object may be null.

Point randomPointInside(Random rng)

Returns the randomly chosen point inside the area; utilises the given Random Number Generator.

Parameters:
rng - the random number generator.

Point randomPointInside
(Random rng, Point out)

Returns the randomly chosen point inside the area; utilises the given Random Number Generator.

Parameters:
rng - the random number generator.
out - the output Point object to write the result to. The object may be null.

double getNearestPoint
(Point givenPoint, Point out)

Calculates the point in this custom station nearest to the given point and writes the result into the the out object.

Returns the square of distance to the point (in the XY-projection). All calculations are performed in the horizontal projection (z-coordinates are not used, as if all of the Z coordinates were zero).

Parameters:
givenPoint - the given point to find the nearest point to
out - the output point to write result to. Note that output.z is left unchanged.


Related topics

 Space markup for material handling models

 Conveyor

 Conveyor network

 Material Handling Library

 API reference: ConveyorCustomStation class