Vehicular electrification plays a major role in the reduction of toxic greenhouse gas emissions linked to the transportation sector. However, the differential margin between electricity supply and demand is chaotic; and only a production/consumption balance could reconcile both ends. The adaptation of energy flows is therefore necessary to confront the gigantic energy waste related to electricity storage challenges. Consequently, electric vehicle batteries recently emerged as a solution to the actual limitation of storage capability. Indeed, they are used in this study as means of storage and retrieval of energy.Thus, this paper proposes a control and regulation algorithm aimed at reaching a balanced production/consumption system. The balance is acquired through the bidirectional control of the energy flows related to domestic residences, electric vehicles and the grid. Moreover, a multi-objective optimization of vehicular charging and discharging is assessed using the genetic algorithm to attain an optimal fulfillment of the system’s energetic needs. Once the regulation algorithm is set and the optimizations implemented, the algorithm’s simulation is performed using Matlab. Through the developed algorithm, we aim these major findings: 1. Regulate energy flows depending on supply and demand. 2. Optimize charging and discharging modes. 3. Flows merge towards the system’s equilibrium state.