A flow network model based on information, and its stability: An application to ecological systems