The text describes the optimization task of renewable energy sources distributed to electrical microgrid of fictitious intelligent area that consists of intelligent buildings. Firstly, to solve this task a general optimization heuristic method of simulated annealing will be described. Testing was performed on the analytical functions but those will be only covered marginally. Of the tests on the approximation functions the method of simulated annealing would be the most suitable algorithm for the optimization task. Furthermore, two experiments were introduced. The first lies in the application of cluster analysis on daily diagrams of electricity consumption in intelligent buildings. Because the modeled year history of hourly electricity consumption is represented by multidimensional data this data forms the training set during the adaptive dynamics submitted to a competence model of neural network by days. After the network adaptation process the Kohonen's map during the adaptive dynamics will be drawn, from which required clusters can be read. In the second experiment a sorting design of the resources for typical days of a week is performed in the computer program UniCon.