Heuristic algorithms for learning of random neural network and energy distribution of energy packet networks