Modeling Social Behavior on Energy Consumption

Modeling Social Behavior on Energy Consumption


A major problem that building owners or managers face is how to motivate people to conserve energy, while at the same time influencing them to encourage others to do the same. In other words, how can they implement behavioral influencing strategies to improve efficiency in commercial and educational buildings.


An agent-based model was created in AnyLogic to solve this problem. Noorjax Consulting applied a data model during a simulation runtime in order to change the behavior of a system based on that data model. The researcher chose a university as the building to be simulated, and to simplify it, only one floor of that building.

Two hypotheses were developed:

A socio-technical framework was built in order to understand the problem in a more structured way.

Socio-technical framework

Socio-technical framework of the model (click to enlarge)

The agent-based predictive model was built using subjective data from a sample survey. There were 140 individuals in the survey and about 40 questions. Using the replies from the survey, answers to two more questions could be predicted, which could then be used to make further predictions about individual behavior. To predict the values for these two questions, a Python model was built using a variant of multivariate regression. The two questions were:

  1. Do I consciously turn off lights and appliances when I do not need them no matter where I am?
  2. In a normal situation, do I prefer to take the stairs or use elevators to get to my destination?

The answers can be predicted based on the independent values from the survey. Demographic information will not change in the short-term, but views about climate change and energy conservation could change through influence, education, or rewards. After these changes, the predictive model could then predict new behavior on energy savings in the building by an individual.

Pypeline is a connector library for AnyLogic, and it allowed the easy and smooth creation of an interface between AnyLogic and Python. The most popular machine learning library for Python, scikit-learn, was used. In this scikit-learn library, there are regression methods available, and they were used to make the predictive model that was needed. This static predictive model was created to understand how an individual would behave in terms of energy savings based on the demographics of that person. The simulation then made the model dynamic.

For example, during a meeting between staff and students on climate change there could be a set of three abstract independent discrete variables – the questions in this case, valued 1 to 5. Then there could also be a dependent variable – the incentive for someone to conserve energy, in this case, known as behavior S, also valued 1 to 5.

During the meeting someone could be convinced about the topic, A or B, or C, etc. If the person was influenced and changed their answer to question A from 2 to 3, for example, the Python model would predict the new value of S. This is illustrated in the model below.

Influence and predictive model

Influence and predictive model showing a change in thinking and a new behavior

The building manager in the university could then understand how to push forward on education and information in order to fulfill the energy-saving agenda by using the predictive model. This predictive model is enough to make decisions because it illustrates which variables have more weight in the prediction of a dependent variable.


The prediction model helped during the simulation runtime to change the characteristics of individuals who belonged to the system.

After running multiple simulations there was a 6-8 percent reduction in energy utilization based only on education and influence. Interventions such as money or discounts should give a similar level of improvement.

Results of the simulation

Results of the simulation showing the energy saving percentage

There was also a secondary effect of this study which was not illustrated. This was an improvement in the general health of the population who visited the building because they used more calories when taking the stairs instead of the elevator.

The results, however, are not as important as the general concept portrayed in this case study. This project is not completed yet and further elements and scenarios will be added in the future.

The use case was designed to inspire AnyLogic users or team leaders to apply this idea to their own models. It was also supposed to inspire users to think about the possibility of using machine learning models or statistical models in their simulation.

The case study was presented by Felipe Haro, of Noorjax Consulting, at the AnyLogic Conference 2021.

The slides are available as a PDF.

Похожие проекты

Другие истории успеха

Сборник историй успеха от пользователей AnyLogic