Planning the operation scheduling of the microgrid by using optimization heuristic algorithms allows the microgrids to be more efficient. This is possible since a microgrid can work as a power system that has to operate jointly having different aspects namely renewable and traditional power generation, energy storage and controllable loads. The test bed used during the development of this study consists of two aggregators that manage electric vehicles, power generation, photovoltaic, battery bank and two wind turbine generators. This research has three objectives: the first is to formulate an equation that describes the operation cost of the microgrid; the second aims to find such an operating point that the operation cost of the microgrid can be obtained through the DEEPSO (Differential Evolutionary Particle Swarm Optimization), metaheuristic algorithm, in which this value is minimum. Finally, the third objective is to analyze how the most adequate programming for the reduction of costs is affected by the useful life of the electric energy storage. After the development of this research, it was found that in a 24-hour horizon time, the use of energy storage allows the existence of savings or even profits only by using the microgrid, actually. Likewise, it was observed that as the time passes and the storage system gets old, the mentioned system resembles more to the current systems that have a no manageable operating regime (it means that the wind and solar power feed cannot be controlled). Ideally, these systems dispatch all the available renewable energy during that specific time, but without having planned a smart dispatch, for instance, by using the energy surplus stored in the batteries in other periods of time.