Machine hours allocation and profit optimization