You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/concepts/routing.rst
+42-38Lines changed: 42 additions & 38 deletions
Original file line number
Diff line number
Diff line change
@@ -30,32 +30,32 @@ The illustration of such a network can be seen below:
30
30
:alt:A graphical representation of a directed graph.
31
31
32
32
Graphical representation of the underlying routing network of a more complex simulation.
33
-
Each circle represents a intermediate stage, and the arrows the corresponding connections.
33
+
Each circle represents an intermediate stage, while the arrows the corresponding connections.
34
34
35
35
In the following sections, we will explain how to set-up such routing networks in *JuPedSim*.
36
36
37
37
Stages
38
38
------
39
39
40
-
A stage in *JuPedSim* is an intermediate target the agent wants to reach.
40
+
In *JuPedSim*, a stage refers to an interim target that the agent aims to reach.
41
41
When a stage is reached, the agent will wait for its completion and then continue to the next stage.
42
42
A stage may already count as completed when the stage is reached or when some condition is fulfilled.
43
-
These different kind of stages will be explained below.
43
+
The various types of stages will be explained below.
44
44
45
45
Waypoint
46
46
^^^^^^^^
47
47
48
-
The most fundamental kind of stage is a :class:`Waypoint <jupedsim.stages.WaypointStage>`, it represents a target the agent need to reach.
48
+
The most fundamental kind of stage is a :class:`Waypoint <jupedsim.stages.WaypointStage>`. It represents a target the agent needs to reach.
49
49
For the way finding, the agent always targets the Waypoint directly.
50
-
A Waypoint counts as completed when the agents reach a specified distance from the defined Waypoint.
51
-
The figure belows shows how a Waypoint is used in the simulation, here the center (orange) is the Waypoint and the blue area marks which an agent needs to reach to complete the stage.
50
+
A Waypoint is considered completed once agents arrive within a designated distance from the defined Waypoint.
51
+
The figure below shows how a Waypoint is used in the simulation. Here the center (colored orange) represents the Waypoint, and the surrounding blue area indicates the zone an agent must enter to complete the stage.
52
52
53
53
.. figure:: /_static/stages/waypoint.svg
54
54
:width:20%
55
55
:align:center
56
56
:alt:A dot representing the Waypoint, with an circle around it, depicting the area an agent needs to enter to complete the stage.
57
57
58
-
Representation of a :class:`Waypoint <jupedsim.stages.WaypointStage>` (orange) with the given distance (orange line).
58
+
Representation of a :class:`Waypoint <jupedsim.stages.WaypointStage>` (colored orange) with the given distance (orange line).
59
59
60
60
A Waypoint at :math:`(0.6, -1.4)` with an accepted distance of 2m can be added to the simulation via:
61
61
@@ -66,8 +66,8 @@ A Waypoint at :math:`(0.6, -1.4)` with an accepted distance of 2m can be added t
66
66
Exit
67
67
^^^^
68
68
69
-
An other stage is an:class:`Exit <jupedsim.stages.ExitStage>`, which as the name describe, model exits of the simulation.
70
-
It marks an area, at which agents will be marked for removal from the simulation when they reach it.
69
+
An other stage type is the:class:`Exit <jupedsim.stages.ExitStage>`. As the name suggests, this stage models the exits within the simulation.
70
+
The `ExitStage` designates an area where agents are marked for removal from the simulation upon their arrival.
71
71
The removal itself is done at the beginning of the next iteration step.
72
72
As a target the agents will aim for the center of the exit polygon.
73
73
@@ -80,7 +80,7 @@ As a target the agents will aim for the center of the exit polygon.
80
80
:align:center
81
81
:alt:A polygon representing the exit area is shown in blue, with the center highlighted in orange.
82
82
83
-
Representation of an :class:`Exit <jupedsim.stages.ExitStage>` (blue). The agents will aim for the center (orange).
83
+
Representation of an :class:`Exit <jupedsim.stages.ExitStage>` (colored blue). The agents will aim for the center (colored orange).
84
84
85
85
An exit located in the polygon :math:`(-0.2, -1.9), (0.2, -1.9), (0.2, -1.7), (-0.2, -1.7)` can be added to the simulation via:
86
86
@@ -95,29 +95,29 @@ An exit located in the polygon :math:`(-0.2, -1.9), (0.2, -1.9), (0.2, -1.7), (-
95
95
96
96
.. warning::
97
97
98
-
As the pedestrians currently aim for the center of the exit area, defining wide exits may lead to unexpected behavior.
99
-
In some case it might be more suitable to define multiple exits instead one wide one.
98
+
Currently, pedestrians in the simulation are programmed to target the center of the exit area.
99
+
Therefore, creating wide exits could potentially lead to unpredictable behavior.
100
+
In certain situations, it may be more appropriate to establish multiple exits rather than a single wide one.
100
101
101
102
Waiting Queue
102
103
^^^^^^^^^^^^^
103
104
104
105
It is not only possible to steer agents with waypoints, it is also possible to let them wait in queues.
105
106
*JuPedSim* offers :class:`Queues <jupedsim.stages.NotifiableQueueStage>` where the agents will wait at predefined positions.
106
-
The provided positions are ordered by their order of definition, and agents will wait on the first empty spot.
107
+
The positions given are arranged according to the sequence in which they are defined, and agents will wait at the first available spot.
107
108
When agents leave the queue, the other agents will move up in their waiting positions until they reach the front.
108
-
To release agents from the queue, a signal needs to be send to the queue, signaling that the first n agents can leave it.
109
+
In order to allow agents to leave the queue, a signal must be sent to it, indicating that the first `n` agents in the queue are permitted to exit.
109
110
110
111
.. note::
111
112
112
-
When there are more agents arriving at the queue then waiting positions are available, all overflow agents will wait at the last waiting position.
113
-
113
+
If the number of agents arriving at the queue exceeds the available waiting positions, all additional agents beyond capacity will wait at the last designated waiting position.
114
114
115
115
.. figure:: /_static/stages/queue.svg
116
116
:width:80%
117
117
:align:center
118
118
:alt:A series of dots represent the different waiting positions, connected with arrows which show in which direction the agents will move up.
119
119
120
-
Representation of an:class:`Queue <jupedsim.stages.NotifiableQueueStage>` (dots).
120
+
Representation of the:class:`Queue <jupedsim.stages.NotifiableQueueStage>` (dots).
121
121
The first position is marked orange and the last position light-blue.
122
122
The movement of the agents to move up the queue is indicated by the red arrows.
123
123
@@ -157,16 +157,16 @@ If a waiting set is inactive when an agents targets it, the first defined waitin
157
157
158
158
.. note::
159
159
160
-
When more agent target the waiting set, than available waiting spots, the overflow agents will wait at the last entered waiting position.
160
+
When the number of agents targeting the waiting set exceeds the available waiting spots, the agents in excess will wait at the position where the last agent entered the waiting area.
161
161
162
162
163
163
.. figure:: /_static/stages/waiting_set.svg
164
164
:width: 80%
165
165
:align: center
166
166
:alt: A waiting setis represented by a number of unevenly distributed circles. Two circles are highlighted.
167
167
168
-
Representation of an :class:`WaitingSet <jupedsim.stages.WaitingSetStage>`.
169
-
The first (orange) and last defined position (blue) are highlighted.
168
+
Representation of the :class:`WaitingSet <jupedsim.stages.WaitingSetStage>`.
169
+
The first (colored orange) and last defined position (colored blue) are highlighted.
170
170
171
171
In the following, you can see how to add a waiting set to a simulation and how to activate and deactivate it:
172
172
@@ -198,9 +198,9 @@ Journeys
198
198
199
199
Multiple stages can be combined into what in*JuPedSim*is called a Journey.
200
200
201
-
202
201
For creating more complex routes in*JuPedSim* multiple stages can be combined to a so called Journey.
203
-
For
202
+
203
+
For example:
204
204
205
205
.. code-block:: python
206
206
@@ -220,20 +220,22 @@ For
220
220
Transitions
221
221
-----------
222
222
223
-
Now, we have Journey with a set of stages which have no connection to each other.
224
-
But for creating the complete routing set-up we need to define theses connections, the so called Transitions.
225
-
They define, which stage an agents target after its current one is completed.
226
-
*JuPedSim* offers different types of connections directly to model some decision making processes.
223
+
We currently have a Journey composed of various stages that are not interconnected.
224
+
To establish a comprehensive routing setup, we need to define the connections between these stages, known as Transitions.
225
+
226
+
Transitions specify which stage an agent will target next after completing its current stage.
227
+
*JuPedSim* offers different types of connections to directly model certain decision making processes.
227
228
228
229
.. note::
229
230
230
231
When adding the transitions to your journeys make sure, that :ref:`Exits <Exit>` are only added at the end of a trip.
231
-
Otherwise the agents will be removed from the simulation when they reach the exitand will notcontinue to the next stage.
232
+
Otherwise the agents will be removed from the simulation when they reach the exitand will notadvance to the next stage.
232
233
233
234
Fixed transition
234
235
^^^^^^^^^^^^^^^^
235
236
236
-
The simplest kind of transition is to define that the agent will continue its journey with one specific next stage.
237
+
The most basic form of transition is to define that the agent will proceed on its journey with one specific subsequent stage.
238
+
237
239
238
240
.. figure:: /_static/transitions/fixed.svg
239
241
:width: 40%
@@ -252,16 +254,16 @@ Round-robin transition
252
254
253
255
It is also possible to model a decision making process and split the agents at a stage, with a round-robin transition.
254
256
Here, the agents will proceed in a weighted round-robin manner.
255
-
E.g., when defining a roundrobin transition with three outgoing stages and the corresponding weights 10, 5, 1, the first 10 agents to make a choice will continuewith the first given stage.
257
+
E.g., when defining a round-robin transition with three outgoing stages and the corresponding weights 10, 5, 1, the first 10 agents to make a choice will continuewith the first given stage.
256
258
The next4with the second one, and the next agent will continuewith the third stage.
257
-
Then the circle starts again at stage one.
259
+
260
+
After this, the cycle restarts with the first stage.
258
261
259
262
.. figure:: /_static/transitions/round_robin.svg
260
263
:width: 40%
261
264
:align: center
262
265
263
-
How to create such a round-robin transition as described above see here:
264
-
266
+
To create a round-robin transition as described above, you can follow these steps:
265
267
.. code-block:: python
266
268
267
269
journey.set_transition_for_stage(
@@ -286,7 +288,7 @@ When multiple stages have the same number of agent targeting the first defined w
286
288
:width: 40%
287
289
:align: center
288
290
289
-
A leasttargeted transition can be added to a journey with:
291
+
A least-targeted transition can be added to a journey with:
290
292
291
293
.. code-block:: python
292
294
@@ -305,9 +307,11 @@ A least targeted transition can be added to a journey with:
305
307
Way finding
306
308
===========
307
309
308
-
Depending on the principles explained above each agent gets a target assigned, there they head to.
309
-
Now, the route towards this goal needs to be determined.
310
-
For distinguishing the route *JuPedSim* triangulates the geometry and computes the distance between two points through the triangulation.
310
+
Each agent in the simulation is assigned a specific target destination towards which they will head.
311
+
The next crucial step is to determine the route that these agents will take to reach their assigned goals.
312
+
This involves calculating the most efficient or desired paths from their current locations to their targets within the simulation environment.
313
+
314
+
To determine the route, *JuPedSim* triangulates the geometry and computes the distance between two points through the triangulation.
311
315
Here, it will compute the distance between the centers of two neighboring triangles.
312
316
When multiple paths lead to the target, the shortest one will be preferred.
313
317
@@ -320,8 +324,8 @@ How the path is distinguished for different target points, you can see in the an
320
324
.. warning::
321
325
322
326
As the distance is computed along the centers of the triangles, it may happen, that not the shortest-path on the ground is taken.
323
-
This is a known issue of the *JuPedSim*'s routing, it will be fixed in the near future.
324
-
To avoid is behaviour intermediate waypoints can be added to the simulation.
327
+
This is a known issue of the *JuPedSim*'s routing, that will be fixed in the near future.
328
+
To avoid this behaviour intermediate waypoints can be added to the simulation.
0 commit comments