Scheduling batches with time constraints in wafer fabrication