Suppose an energy source has n quanta of energy in storage, all of which are available now (t=0) until t = T, at which time the energy source disappears (or is no longer available). Suppose there are two types of request for energy quanta: one yields value 1 and the other yields value v > 1. These types arrive according to a Poisson process with arrival rates a1 and a2 respectively, and they can be differentiated.
Suppose a low-value request arrives at time t with time T-t > 0 remaining and n quanta of energy remaining in storage. Assuming the objective is to obtain the maximum expected value of requests served, should the low-value request be accepted and served, or should it be rejected and instead wait for a high-value request? Let T(n) > 0 be the threshold time remaining, such that if a low-value request arrives with T(n) or less time remaining, it is optimal to accept and service the request; else reject the low-value request. Intuitively, T(n) should be increasing in n, since the more time remaining, the greater the probability of servicing high-value jobs.
Does this problem have a name, and has it been solved?