Deadlock Detection and Recovery in Flexible Production Systems with Multiple Capacity Resources