Attractors in pedestrian areas

Five north-oriented attractors inside an area

In pedestrian simulation, Attractor allows controlling pedestrians location inside an area.

Waiting positions (seats) defined with attractors

Demo model: Pedestrian Attractors

You can add attractors one by one, however, if attractors form a regular structure, it makes sense to add several attrcators once using attractor creation wizard.

Attractors may be put only inside a pedestrian area.

To add one attractor inside an area

  1. Drag the Attractor element from the Space Markup section of the Pedestrian library palette into an area on the graphical diagram.

To add several attractors

  1. You can add attractors using the drawing mode. Double-click Attractor in the palette. Its icon will turn into . Now you can add attractors by clicking inside of nodes.

  1. You add one attractor each time you click inside the node. All new attractors have the default orientation as shown in the figure above. However, you can change attractor's orientation while drawing it: do not release the mouse button after the click, but move it around until you get the orientation you need.

  1. To exit the drawing mode, click any empty spot in the graphical editor outside the node.
  2. After you finish drawing, all added attractors will be selected with their properties open. You may find this useful for defining attractors's orientation for several of them at once:

To add several attractors using the wizard

  1. Click a rectangular or polygonal area in the graphical diagram.
  2. In the area's properties, click Attractors... button. You will see Attractors... dialog box.
  3. In the dialog, specify how many attractors you want to create. You may do this by expliclitly specifying the Number of attractors, or filling the whole area with attractors, preserving the specified Space between attractors, or placing them in a Grid with cells of specified width and height.

  1. If you need to restructure attractors, select the option Delete all existing attractors and also define creation mode before you click OK. If you wish to clear all attractors from the area without creating new ones there, select this option and specify 0 in creation mode Number of attractors, then click OK.

Attractors selection order

When you add attractors (either manually or using the wizard), their creation order also defines the sequence of the pedestrians' movement destinations. You can verify the creation order by looking at the names of the attractors (attractor1, attractor2, ...). Pedestrians will select attractors one by one according to this order. In case you need to change the order, you should change the positions of the corresponding attractors but not their names.



Name – The name of the attractor. The name is used to identify and access the attractor from code.

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

Visible on upper agent – If selected, the attractor is visible on the upper agent where this agent lives.


X – X-coordinate of the attractor.

Y – Y-coordinate of the attractor.

Orientation – Here you can choose where pedestrians should be directed when reaching/waiting at the attractor.


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



double getX()

double getY()

double getZ()

Returns the X (Y, Z) absolute coordinate of the attractor.

The Z coordinate is defined by the corresponding coordinate of the node / area.

double getRelativeX()

double getRelativeY()

Returns the X (Y) coordinate of the attractor relative to the node / area.




double getOrientation()

Returns the attractor's orientation in radians (in the clockwise direction).

Related topics

Markup for pedestrian simulation

Service with area

API reference: Attractor class