  In this paper, we consider a time-slotted cognitive radio (CR) setting with
buffered and energy harvesting primary and CR users. At the beginning of each
time slot, the CR user probabilistically chooses the spectrum sensing duration
from a predefined set. If the primary user (PU) is sensed to be inactive, the
CR user accesses the channel immediately. The CR user optimizes the sensing
duration probabilities in order to maximize its mean data service rate with
constraints on the stability of the primary and cognitive queues. The
optimization problem is split into two subproblems. The first is a
linear-fractional program, and the other is a linear program. Both subproblems
can be solved efficiently.
