Dynamic management of water transfer between two interconnected river basins