To direct pedestrians to a certain location, you should use the PedGoTo block of the Pedestrian Library and set the pedestrian target location (it is done typically with the help of the Target line markup tool).
Sometimes you might need to specify how exactly pedestrians are following the defined path. Let us say, we are modeling a passage at the subway transfer station. The two pedestrian flows moving in the opposite directions usually share the corridor space. Pedestrians of each flow try to keep to the left side of the corridor while moving, avoiding in such a way flows intersection.
Each flow is moving along its path. However, the borders of the path can be crossed (e.g. we should consider the pedestrians moving faster than the flow. They cross the supposed border to outrun the slow-moving pedestrians of this flow).
Now, it is obvious that we face a task of separating the counterflows within the same space. This separation must not be achieved by means of walls. We must be able to specify the movement direction, the desirable corridor that the pedestrians must move along, but at the same time we must allow certain pedestrians to cross the borders of this corridor.
For this specific task, AnyLogic provides a special Pathway markup element. The figure below shows how two pathway elements are used to define paths for two counterflows in the subway entrance hall model.