Distributed real-time scheduling for flexible manufacturing