Refer to image. The objective is to "enable/disable" the yellow path between experiment runs (purpose is to measure time savings if vehicles have the ability to use short-cut).
What is the easiest way to do this programmatically (i.e. not adding/removing the path manually).
If you have Material-handling transporters using the network, you can programmatically call one of these functions to prohibit usage:
If not, you will have to create the network programmatically upfront and either include/exclude the path accordingly.
One trick before going there: You can try to path.setBidirectional(false);
to prohibt travelling against the drawn direction. But obviously, this only helps in some cases.
PS: You can also go all out and take full control of your network by agent-ifying it, see my full workshop here: https://www.benjamin-schumann.com/blog/2022/8/6/taking-control-of-your-network-agent-based-pathfinding