# An Intelligent Approach to Allocating Resources within an Agent-Based Cloud Computing Platform
## 3 Proposed Intelligent Model
The SSA is also responsible for ensuring the high availability of the service, making sure that there are at least a certain number of nodes working in independent physical teams. The services are deployed on servers, which represent the system's computer resources. Three roles (local monitor, local supervisor and global manager) associated with the sub-organization that provides resources are also deployed here. The local monitor agent (LMA) is in charge of collecting data regarding the state of the local resources of each physical server--including its virtual machines--(\(PR_{i}\)) and transforming these data into adequate information for decision making. The local supervisor agent (LSA) is in charge of the control and distribution of the physical machine's computer resources, and is able to redistribute resources among the instances of execution, launch or shut down of virtual machines. Its objective is, therefore, the efficient management of the individual resources of the physical server between the different nodes it hosts, maximizing its use, but without diminishing the quality of the services being provided; and, ensuring that the physical machine always has the minimum resources to perform the tasks of coordination and control. Its work is carried out in close collaboration with the server's local monitor agent. The SLA and the local monitor have total knowledge of each individual server, but at the same time uncertainty regarding the rest of the infrastructure. The global manager (GMA) is the role in charge of making decisions about how to distribute the computer resources among several nodes of the CC platform, and not only at a local level as in the case of the LSA's role. In order to provide assistance to the decision-making process regarding the means of distributing resources, they use a partial knowledge base (provided by the LMA role) and past experiences stored in the usage history repository, which is achieved by relying on the CBR model [23]. The GMA's role is to determine how and with what characteristics the new service-associated virtual machines will be instantiated. Additionally, it is also responsible for the process of compacting the existing virtual machines into a smaller number of servers, so that it is possible to shut down physical servers and reduce energy consumption. Given that it is possible to stop and start execution nodes, it is also possible that these agents enter and leave the system dynamically, linking their life cycle to that of the server they monitor or control. All these agents have a local knowledge base, but they also store historical information on a centralized nonSQL server, based on MongoDB. When the agents enter the system, they retrieve specific information about the history of the specific service or server where they are located. Concretely, there are three centralized repositories (resources, SLAs and historical), as can be seen in the structural view according to the GORMAS methodology given in Figure 2. This figure also shows the detail of the activity model according to GORMAS for the infrastructure control service. The next section provides a detailed description of the reasoning model designed to allocate computational resources by means of agents within a distributed and heterogeneous environment where the level of uncertainty is high. Figure 1: Distribution of agents on the cloud computing platform.