Dynamic resource allocation in manufacturing and service industries