An Optimal Power Distribution on Decentralized Energy Networks with Battery Degradation Control