A smart grid can be considered as an unstructured network of distributed interacting nodes represented by renewable energy sources, storage and loads. The nodes emerge or disappear in a stochastic manner due to the intermittent nature of natural sources such as wind speed and solar irradiation. Prediction and stochastic modelling of electrical energy flow is a critical characteristic in such a network to achieve load balancing and/or peak shaving in order to minimise the fluctuation between off peak and peak demand by power consumers. Before contributing energy to the network, a node acquires information about other nodes in the grid and the state of the grid in order to adjust its power injection to or consumption from the grid. The unpredictable behaviour of nodes in a smart grid is modelled and administered through a scheduling strategy control and learning algorithm using the historical data collected from the system. The stochastic model predicts future power consumption/injection to determine the power required for storage components. In the proposed stochastic model and the deployed learning and adaptation processes, two indicators, based on moving averages of different subsets of the time series are implemented to satisfy two objectives. The first objective is to predict the most efficient state of electrical energy flow between a distribution network and nodes. Whereas the second objective is to minimise the peak demand and off peak consumption of acquiring electrical energy from the main grid by using ant colony search algorithm (ACSA). The performance of the indicators is validated against limited autoregressive integrated moving average (LARIMA) and second order Markov Chain model. It is shown that proposed method outperforms both LARIMA and Markov Chain model.