There are (at least) two versions:
- One approach, put forward by Christoph Dobler, which takes existing agents with plans and modifies future parts of their plans.
- Another approach, put forward by Kai Nagel and Michael Zilske, which re-programms the agent from the inside out.
In the end, each approach will be able to emulate the other one, so it may come down to a matter of taste.
For general conceptual material see
If any of these links are not working, check for packages with "withinDay" in their name in the tutorial section of the matsim javadoc or the matsim code.
Reference for the first variant:
Some links to related material: