This paper considers the use of energy harvesters, instead of conventional
time-invariant energy sources, in wireless cooperative communication. For the
purpose of exposition, we study the classic three-node Gaussian relay channel
with decode-and-forward (DF) relaying, in which the source and relay nodes
transmit with power drawn from energy-harvesting (EH) sources. Assuming a
deterministic EH model under which the energy arrival time and the harvested
amount are known prior to transmission, the throughput maximization problem
over a finite horizon of $N$ transmission blocks is investigated. In
particular, two types of data traffic with different delay constraints are
considered: delay-constrained (DC) traffic (for which only one-block decoding
delay is allowed at the destination) and no-delay-constrained (NDC) traffic
(for which arbitrary decoding delay up to $N$ blocks is allowed). For the DC
case, we show that the joint source and relay power allocation over time is
necessary to achieve the maximum throughput, and propose an efficient algorithm
to compute the optimal power profiles. For the NDC case, although the
throughput maximization problem is non-convex, we prove the optimality of a
separation principle for the source and relay power allocation problems, based
upon which a two-stage power allocation algorithm is developed to obtain the
optimal source and relay power profiles separately. Furthermore, we compare the
DC and NDC cases, and obtain the sufficient and necessary conditions under
which the NDC case performs strictly better than the DC case. It is shown that
NDC transmission is able to exploit a new form of diversity arising from the
independent source and relay energy availability over time in cooperative
communication, termed "energy diversity", even with time-invariant channels.