Cooperative communications with optimal harvesting duration for Nakagamifading channels