AnyLogic 9
Expand
Font size

Target line

A Target line is used to graphically define the following things in pedestrian models:

  • a location where pedestrians appear in the simulated space (referenced by PedSource or PedEnter),
  • the destination of the pedestrian movement (referenced by PedGoTo),
  • a location where pedestrians are waiting (referenced by PedWait),
  • when modeling how pedestrians move from one level to another, you draw two target lines: one representing for the place where pedestrians leave the current level, and another representing the place where pedestrians enter the new level. You specify both target lines in the PedChangeLevel flowchart block.

To draw a straight target line

  1. Drag the  Target Line element from the  Space Markup palette to the graphical diagram.

To draw a target line of complex form

  1. Click the  Target Line element in the Space Markup section of the  Pedestrian Library palette.
    The drawing mode is activated. You can now draw the target line in the graphical editor point by point.
  2. Click in the graphical editor to place the first point of the target line. Click again to add additional points.
  3. Double-click to place the last point of the target line.

Properties

General

Name — The name of the target line. The name is used to identify the target line.

Show name — If selected, the name of the target line is displayed on the graphical diagram.

Lock — If selected, the target line is locked. Locked elements do not respond to mouse clicks, and they cannot be selected in the graphical editor until you unlock them. This is often needed when you want to prevent the element from being edited while other elements are placed over it.

Ignore — If selected, the target line is excluded from the model.

Appearance

Line color — The color of the target line. Select No color, if you do not want the target line to be drawn.

Position and size

Level — The Level to which this target line belongs.

X — The X-coordinate of the target line (its starting point).

Y — The Y-coordinate of the target line (its start point).

Points

The table located in the Points property section allows you to view and set the coordinates of the target line’s turning points.

The coordinates are relative, not absolute. The first point always has coordinates (0, 0, 0) that cannot be changed.

Other rows of the table define relative coordinates of the successive points. The coordinates of each point are actually offsets of the corresponding point from the start point along the X, Y (and optionally Z) axes correspondingly.

Visibility and presentation

Visible — If selected, the target line is visible during animation at model runtime.

Show in — Select whether the shape is displayed in both 2D and 3D animation, 2D only, or 3D only.

Agent presentation — If selected, the target line is also visible on the upper-level agent that hosts the agent containing this target line.

Functions

You can dynamically modify the target line properties at model runtime using the API.

Position
Function Description
double getX() Returns the X coordinate of the target line.
double getY() Returns the Y coordinate of the target line.
void setPos(double x, double y) Sets new coordinates for the target line.

x — the new value of the X coordinate.
y — the new value of the Y coordinate.
Length, points
Function Description
double length() Returns the length of the target line (in pixels).
int getNPoints() Returns the number of salient points of the target line.
double getPointDx( int i ) Returns the X-coordinate of the particular point of the target line relative to its start point.

i — the index of the point (starting from 0)
double getPointDy( int i ) Returns the Y-coordinate of the particular point of the target line relative to its start point.

i — the index of the point (starting from 0)
Visibility
Function Description
boolean isVisible() Returns true if the target line is visible; returns false otherwise.
void setVisible(boolean v) Sets the visibility of the target line.

v — visibility. If v is true — the target line is set to be visible, if it is false  — not visible.
Color
Function Description
Color getColor() Returns the color of the target line, or null if the target line has no color.
void setColor(Color color) Sets the color of the target line.

color — the new color
Level
Function Description
Level getLevel() Returns the level where this target line is located.
Removal
Function Description
void remove() Removes the target line from the presentation. If the target line is not a part of presentation, the function does nothing. Note, that 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.
How can we improve this article?