In this paper the author studies the problem of constructing an optimal, generalized or not, Banach function space containing a given cone K_0 of nonnegative, decreasing functions 0leq h downarrow in the weighted space L_{p,u}(0,T) = left{ fin M : |f|_{L_{p,u}(0,T)}= left(int_0^T |f|^p u dtright)^{1/p}< infty right}, where M is the set of all measurable functions and u is a positive and measurable function. The main result is the following theorem: par Theorem. Let K_0 be a cone and define U(t)=int_0^t u dtau. Then the optimal generalized Banach function space X_0 containing the cone K_0 has the norm |f|_{X_0(0,T)}= bigg(int_0^T |f|^p_{L_infty}(t,T) u(t) dtbigg)^{1/p} quad {rm for} quad 1leq p < infty, and |f|_{X_0(0,T)}= int_0^T |f|_{L_infty}(t,T) widetilde{u}(t) dt quad text{ for} quad 0