A Dynamic Programming Algorithm for Optimization of Lodgepole Pine Management