Distributed power generation is a small-scale power generation technology that provides electric power at a site closer to customers than the central generating stations. The Distributed Generation (DG) has been created a challenge and an opportunity for developing various novel technologies in power generation. The proposed work discusses the primary factors that have lead to an increasing interest in DG. DG reduces line losses, increases system voltage profile and hence improves power quality. The proposed work finds out the optimal generation dispatch of the DG by artificial neural network. This ANN has been trained by optimal values of power generation by each DG at different status of network. In order to get over the insufficiency of back-propagation (BP) algorithm, after analyses of particle swarm optimization (PSO) a continuous version of PSO algorithm is proposed. The objective function of PSO algorithm is a combination of cost of loss and cost of power generation by each DG with considering different load state. The feasibility of the proposed method is demonstrated for typical distribution network, and it is compared with the other researches.