Polygonal Node

Nodes and paths are space markup elements that define the locations of agents in the space:

Nodes can be connected with paths. Altogether they compose a network. In the network, node defines a place where agents may reside, while paths define the routes that agents may take when moving from one node to another. 

 Polygonal node and  Rectangular node are used when your nodes define some areas (offices, rooms, etc.) where agents may stay inside. Use  Polygonal node when your area has complex form. If your area is rectangular, use  Rectangular node instead. If the node defines a transit transportation node in a network, you can use just  Point Node.

You can define particular waiting points inside a node using attractors

 To add a polygonal node

  1. Double-click the  Polygonal Node element in the  Space Markup palette.
  2. The icon of the element should turn into . It means that the drawing mode is activated and now you can draw a polygonal area in the graphical editor point by point.
  3. Click in the graphical editor to put the first point of the 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 node. The name is used to identify and access the node from code.

Ignore – If selected, the node is excluded from the model.

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

Lock – If selected, the node 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.

Locations layout – Here you can choose the layout inside the node: Random or Arranged.

Attractors... – Click this button to create attractors inside the area. Attractors are the places where the pedestrians will tend to get.

Appearance

Fill color – Shape's fill color. Choose No Fill, if you do not want shape to be filled.

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

Line width – Outline width.

Line style – [Enabled only if the Show in: 3D only checkbox is not selected] Outline style. Choose from the drop-down list, whether you want solid, dashed, or dotted 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.

Z – [Enabled if Show in: 3D only option is selected] Z-coordinate of the area, in meters. The value is relative to the Z-coordinate of the area's ground. 

Points

The table located in the Points property section enables users to view and adjust coordinates of target line 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 node's start point.

double getXMin()

Returns the minimum X coordinate of the node, i.e., the coordinate the upper left corner of its bounding rectangle.

double getXMax()

Returns the maximum X coordinate of the node, i.e., the coordinate the bottom right corner of its bounding rectangle.

double getY()

Returns the Y coordinate of the node's start point.

double getYMin()

Returns the minimum Y coordinate of the node, i.e., the coordinate the upper left corner of its bounding rectangle.

double getYMax()

Returns the maximum Y coordinate of the node, i.e., the coordinate the bottom right corner of its bounding rectangle.

double getZ()

Returns the Z coordinate of the node's start point.

double getZ(double x, double y)

Returns the Z coordinate of the given point.

Parameters:
x - the X coordinate of the point.
y - the Y coordinate of the point.

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

Sets new coordinates for the node. 

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.

Points

Function

Description

int getNPoints()

Returns the number of points in the markup element.

double getPointDx(int i)

Returns the x coordinate of a particular point of the node relative to the start point.

Parameter: i - the index of the point (starting from 0).

double getPointDy(int i)

Returns the y coordinate of a particular point of the node relative to the start point.

Parameter: i - the index of the point (starting from 0).

Visibility

Function

Description

boolean isVisible()

Returns true if the node is visible; returns false otherwise.

void setVisible(boolean v)

Sets the visibility of the node.

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

Fill color

Function

Description

Color getFillColor()

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

Texture getFillTexture()

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

void setFillColor
(Color fillColor)

Sets the fill color of the node.

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

void setFillColor
(Paint fillColor)

Sets the fill color (or Texture) of the node.

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

Outline

Function

Description

Color getLineColor()

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

Texture getLineTexture()

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

void setLineColor(Color lineColor)

Sets the line color of the node.

Parameter: lineColor - the new line color, if null, the node line is not drawn.

void setLineColor(Object lineColor)

Sets the line color (or Texture) of the node.

Parameter: lineColor - the new line color, if null, the node line is not drawn.

double getLineWidth()

Returns the width of the node outline. 

void setLineWidth
(double width)

Sets the width of the node outline; 0 means the thinnest possible outline.

Parameter: width - the new width of the node outline.

int getLineStyle()

Returns the style of the node outline: 

LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED 

void setLineStyle
(int style)

Sets the style of the node outline:
LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED

Line style not applied in 3D animation; the only supported line style in 3D is solid.

Parameter: style - the new style of the node outline.

Attractors

Function

Description

List<Attractor> getAttractors()

Returns a collection of attractors inside the node.

void addAttractor
(Attractor attractor)

Adds an attractor to the node.

Parameter: attractor - the attractor to be added inside the node.

Network

Function

Description

Network getNetwork()

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

int getConnectionsCount()

Returns the number of the node's connections with other nodes.

Path getConnection(int index)

Returns the connection between this node and another node by the provided index.

Parameter: index - the index of required connection in range (0, this.getConnectionsCount() - 1).

Advanced

Function

Description

boolean contains
(double px, double py)

Returns true if the node contains the point with the given coordinates; returns false otherwise.

Parameters:
px - the x coordinate of the point relative to this node's container.
py - the y coordinate of the point relative to this node's container.

double getNearestPoint
(double px, double py, Point output)

Calculates the point in this node nearest to the given (X, Y) point and writes the result into the the output 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:
px - the X coordinate of the point.
py - the Y coordinate of the point.
output - the output point to write result to. Note that output.z is left unchanged.

double getNearestPoint
(double px, double py, double pz, Point output)

Calculates the point in this node nearest to the given (X, Y, Z) point and writes the result into the the output object.

Returns the square of distance to the point.

Parameters:
px - the X coordinate of the point.
py - the Y coordinate of the point.
pz - the Z coordinate of the point.
output - the output point to write result to. Note that output.z is left unchanged.