## 3 The VPP Architecture
Finally, the third-party domain embraces all the entities that are not included in the prosumer and Smart Grid domains. These can be generic entities which provide services to the prosumer (such as weather forecast services) or end-users, such as families in private homes or large residential buildings, PEV owners (who may not belong to the supervised system, i.e., they may be just occasional users), customers of large commercial buildings, or students in a university campus. End-users can interact with the system by sending requests related to the use of energy resources (e.g., PEV charging requests) or feedbacks about the quality of service (e.g., about the perceived comfort), and by receiving information on the acceptance or denial of specific requests, or about the availability of services and resources (e.g., PEV charging stations or smart-plugs), and on the state of the system, with the purpose of improving end-users' awareness about energy savings. Three different types of agent are used in the architecture: physical agents, communication agents, and logical agents. Physical agents are used for the abstraction--in terms of estimation of the state and supervisory control functions--of the physical assets, such as switches, generators, and loads. In particular, each agent, designed according to the service-oriented approach, contains the knowledge base required for the proper virtualization of the related physical component. Physical agents are typically installed in distributed Intelligent Electronic Devices (IEDs), such as gateways or local controllers. Communication agents are used to gather data from the heterogeneous distributed measurement devices installed in the user's domain (that may be physical instruments, i.e., sensor devices, or virtual instruments, such as gateways or other IEDs) and for the exchange of information between all of the agents in the system architecture. Communication agents, for instance, are used for communication between the VPP and the Smart Grid (e.g., for DR requests) or end-users. Logical agents are intended for the intelligent management of the VPP. Their functions are related to the optimal and strategic management of the prosumer's energy assets, including the optimal scheduling of controllable and flexible loads, the control of RES generators and storage units, the active participation in DR schemes, and the monitoring and strategic management of the quality of service towards end-users. Logical agents, for instance, are those in charge for the forecast of day-ahead power profiles of DER units. Finally, three main automated and intelligent systems are considered in the VPP architecture: the Energy Information System (EIS), the Energy Management System (EMS), and the DER Automated Controller (DER-AC). The EIS is the core of the information system of the VPP. It collects data from all the communication agents (system data, users' data, weather forecasts, system logs, DR requests, etc.). It provides communication services to all the agents interacting with the system (either internal or external), and it is also responsible for the time synchronization of distributed measurements. The detailed discussion of the ICT structure of EIS will be provided in Section 4. The EMS is responsible for the management and optimization of the prosumer's energy assets supervised by the VPP. Two main groups of supervised assets are considered in the proposed architecture: controllable loads and DERs. Controllable loads include all the appliances, devices, and systems whose electricity demand can be controlled by the prosumer in terms of power consumption (e.g., PEV charging stations), time or profile of use (e.g., air conditioning systems), and availability (e.g., smart-plugs). Conversely, DERs are all those energy assets intended to balance (at least partially) the electricity demand of loads. DERs typically include RES generators (e.g., PV or wind generators) and ESSs. PEV charging stations offering Vehicle-to-Grid (V2G) services may also be included in this group.