Modeling and scheduling an autonomous sorting system using a switching max-plus linear model