With urging problem of energy and pollution, smart grid is becoming ever important. By gradually changing the actual power grid system, smart grid may evovle into different systems by means of size, elements and strategies, but its fundamental requirements and objectives will not change such as optimizing production, transmission and consumption. Studying the smart grid through modeling and simulation provides us with valuable results which can not be obtained in real world due to time and cost related constraints. However, due to the complexity of the smart grid, achieving optimization is not an easy task, even using computer models. In this paper, we propose an complex system based approach to the smart grid modeling, accentuating on the optimization by combining game theoretical and classical methods in different levels. Thanks to this combination, the optimization can be achieved with flexibility and scalability, while keeping its generality.