Agents in MATSim always start on a link, not on nodes. Agents' activities are thus always connected to a link.
In your upper example, where there is only one link, both activities get mapped to the same link. This is the reason why ultimately you don't see anything happen in that example, as it all takes place on the same link.
In your lower example with two links, h
gets mapped to the first link (connecting 1
and 2
), while w
gets mapped to the second link. Thus, the agent has to travel from link 1 to link 2.
In MATSim, an agent always has to travel along a full link. It is not possible for the agent to leave in the middle of a link, independent of the actual activity coordinate (due to technical reasons/implementation details). Agents can enter or leave traffic on a link always at the end of a link in MATSim. Thus, when starting from h
, it will start at the end of link 1, travel along link 2, and then leave at the end of link 2 for w
. This is the reason why you see it only traveling on link 2 in the visualization.