## 4 Results
### Ad Hoc Solving Method  
The mathematical programming formulation allows us to solve the optimization problem using existing optimization solvers. These solvers come in two main categories: commercial software, such as IBM ILOG CPLEX (version 22.1.1) and GUROBI Optimizer (version 10.0), which are powerful tools known for their reliability and ability to handle large-scale problems; and open-source software (like COIN-OR version 2.1.0 or GLPK version 5.0), which are freely available and offer robust solutions. These solvers leverage the strengths of mixed-integer linear programming (MILP) and implement reliable algorithms. While these algorithms might be time-consuming, they guarantee convergence to either the optimal solution or a good feasible solution. A good feasible solution is one that is close enough to the optimal solution and provides satisfactory results. The quality of such a solution is measured by its proximity to the optimal value or an approximation of that value. Note: The revised text removes unnecessary phrases and focuses on the key points; using existing solvers (commercial and open source) to find optimal or good feasible solutions for the formulated optimization problem. The references are included for those who want to explore specific software options. We validated the formulated optimization problem using two MILP solvers:  
* IBM ILOG CPLEX. This commercial solver utilizes the well-known branch-and-cut method, specifically branch-and-bound with cutting planes. This approach identifies additional constraints that improve the optimization process. For detailed information on these methods, refer to [49]. * GLPK (GNU Linear Programming Kit). This open-source solver uses the \"GNU MathProg\" language, a subset of AMPL [www.ampl.com]. It translates problems defined in this language and offers functionalities for solving linear, integer, and mixed-integer linear programs. This initial validation allowed us to carry out the following:  
1. Analyze and compare feasible solutions in the context of real-world scenarios. 2. Validate the optimization parameters and coefficients in the objective function. 3. Guide the optimization process towards the desired solution. Both solvers successfully found optimal solutions for the simulated problems. However, IBM ILOG CPLEX exhibited significantly higher efficiency, solving problems up to 10 times faster than GLPK. To ensure efficient integration and facilitate interfacing into the B.I. system, the proposed algorithm will be developed by means of the same programming language of the system, i.e., PHP, in an object-oriented fashion. The basic idea is to deploy the code as a library that will provide an algorithmic method to solve the optimization problem. The software will adopt the well-known model-view-controller pattern to ensure separation between the modelling, the presentation and the processing of the data. From this perspective, at each optimization, the steps our code will perform are as follows:  
* Populate the model with the information stored in the database (model). * Process the model according to the logic of the algorithm (controller). * Present the result of the processing to the system (view). After introducing each provided class with details on attributes and data types, we illustrate the class diagrams, and the sequence of operations performed when an event occurs. Finally, the structure of the database which will host the required information is described. Class Descriptions  
The control system will expose the following classes:  
* GenericEvent: the base class for events that trigger a new optimization. * ChargingRequestEvent: triggered by a new charging request. * DSMEvent: triggered by changes in energy tariffs or power availability. * ChargingRequest: represents a charging request made by a user. * PowerInfo: stores information about available power. * EnergyInfo: stores information about the energy tariff. * CSCCPlanner: the main class responsible for launching the optimization process.