A Preventive Multi-agent based Policy for Distributed Hardware Resource Balancing

The success of a business, especially a multi-site extended enterprise, depends on the good management of all its distributed resources. It is difficult for a company to be successful if it does not have a reliable and optimal management of resources by avoiding overstocking of certain resources on a site Sitem ∈ E, and at the same time, the sub-storing of the same resources on another site Sitep ∈ E. In both cases, there is a lack of profit. In this paper, we will try to resolve this situation, by the proposal of an architecture based on the cooperative multi-agent systems paradigm combined with the Contract-Net protocol. We bring in an intelligent agent whose role is to warn in advance and for each item itemi ∈ Sitem, the coming of breakdowns and stock excesses by balancing the level of inter-site availability by a flow of resources of the same itemi by calling on the other E sites whose levels are in over-storage or under-storage. Keywords-resource-balancing; multi-agent; flux-resource management


INTRODUCTION
In the management of distributed material resources in a multi-site enterprise, always non-optimization issues arise, which generate losses and waste of resources. In the past, this situation was tolerable because the use of the networks was not so vast and communication and interaction means were not in the level they are today. Nowadays, the use of solutions on network platforms, that may optimize the management of these distributed resources, is more than necessary. In this sense the provision of an academic solution is proposed in this paper, based on the multi-agent systems (MASs) paradigm. As an application, a mapping of this proposal on a concrete example of distributed hardware resources was made. This example can be applied to any type of resources [1]. In other words, this paper offers a software solution that can ensure the balancing of various resources of a multi-site enterprise E whose sites are linked by a computer network on which a solution based on middleware such as Java-RMI, Dcom, ORB/Corba or SOAP/WebServices was deployed through Web. Thus, the optimal solution that can bring added value [1,2] can be found. The sites share their resources according to a cooperation model, therefore, they must interact with each other, and consequently, the implementation of our solution must use one of the previously mentioned middleware.
In the remainder of this article, the generic term item instead of resource is used.
II. THE PROBLEM Let's suppose a company composed of several websites Site m , m=1, nbS. These sites are interconnected by a computer network that may be a LAN, Internet or a VPN. The software means providing the middleware can be Corba, RMI, DCOM or WebServices if corporate sites are connected through the Internet. Let's suppose further, that each site Site m has a set of N items locally managed. We consider the class C items (see III-A) because they are very numerous. We must find a MAS paradigm based solution which can ensure the balancing of items between the different company sites, in other words, a solution that avoids having items in overstocking or in substorage in order to prevent and avoid abnormal storage situations. Figure 1 illustrates this situation. On the site Site 1 , quantitatively ܲ ଵ is over-stocking, while on the Site 3 , ܲ ଷ is understaffed storage for the same item k. For another item j, there is an approximate balance between the two quantities of items ܲ ଵ and ܲ ଷ on the sites Site 1 and Site 3 . We make the same observation between the situations of the two sites Site 2 and Site 4 concerning items j and k. By extending this observation to the sites (Site k , k=1, nbS) with ‫ܫܾ݊‬ on each site, the proposed solution consists of watching dynamically at every moment T c the stock levels of all items on all the system's sites, to alert policymakers and managers of an overstocking or sub stocking situation, and provide a solution that helps correcting this imbalance.

III. RESOURCE MANAGEMENT IN MULTI-SITE ENVIRONMENT
In this paper, we discuss items that are storable in a multisite environment. These items exist within the company, and are intended to be sold or reserved for internal use, such as, for example, spare parts, pharmaceuticals, consumables (paper, cartridges, etc.). The modeling and automation of such items on a local site is currently a very easy task. Many dedicated solutions, marketed and even free, have been currently proposed. However, solutions for multi-site companies are stock-keeping applications only, and not stock management applications, because item inventory management for a company whose sites are interconnected via a local network or Internet, requires the study, modelling, and validation of other criteria (communication, interaction, cooperation, negotiation, etc.). The "zero inventory" is a wrong approach because stock is necessary but it should not exceed a limit, because it negatively affects the business by including unnecessary costs (insurance, local, security, aging, etc.). On the other hand, substorage too can lead to out of stock situations. Stock shortage can, in some cases, cause the production chain alteration by stopping the production machine. Good management means managing the stock of these items, in sufficient quantity, but above all in an optimal way, to meet the needs for the proper functioning of the company. This is equivalent to finding an optimal stock S * for the entire multi-site enterprise, in the sense of cost and availability over a period T, so as not to expose it to an abnormal situation. In order to correct this way of storing, locally and statically, the current trend is to make "an item flow management" between different sites and to ensure an intra-site and inter-site balancing of these items in order to avoid over or under-storages.

A. Item Classification
An item is specific to the class to which it belongs, and this strongly influences the adopted replenishment policy. On the basis of this classification we can answer to questions such as: • What to resupply?
• How much to resupply?
• And above all, what partner site to resupply, in the case of deficit. And, which site, surplus items must be passed on?
We will adapt this classification to item management: • Class A: is the class of slow-rotating or slow-moving items.
• Class B: is the class of medium-rotating items.
• Class C: is the class of fast-rotating or fast-moving items.

B. The Extended Enterprise Case
Cited replenishment policies show the strategy with regard to each item, after having previously studied the demand, the cost, the necessary time, etc., which they can be applied especially to an autonomous site. A multi-site enterprise's replenishment policy depends on the needs of all the interconnected sites. The class C items, for instance, can be found in all sites, but items supposed to belong to B and A may be available in specific sites deemed important by the extended enterprise managers. The management principle in this case is to maintain a balancing: first, in terms of availability, and second, in terms of cost. This balancing must be between all sites and for all items that are needed by each of these sites. To achieve this, we must design and implement appropriate solutions, to prevent and eventually avoid an availability imbalance of these items in a distributed multi-site environment with the constraint that each site supplies and demands different items. We know that, each item follows different criteria of cost, importance in the case of failure, etc.

C. Distribution of Items
In this paper, focus is given on class C items, because even if they are not expensive, their lack can cause system shutdown. The item classification is dynamic, a Class i item may end up in another class Class j , lower or higher. This will depend on this item consumption rate, and its importance.
IV. RELATED WORKS There are not many works dealing with this issue as a "balancing of material resources" in a distributed environment, but they exist, as "load balancing". A load is the set of processes (Unix process, threads), running on a processor, on a machine or on a server at a time T. Many algorithms have been proposed and implemented on load balancing. But the projection of this work on the distributed management of material resources is limited. The problem came up with bigdata, high availability in cloud-computing [1,[4][5][6][7][8] and in distributed systems in general because disk quotas distributed in clusters hosting data can be considered as well and optimally managed hardware resources [9,10]. The problem of material resource balancing was initiated in [2,3], within the framework of the European project PROTEUS, with application to the distributed management of the spare part in a multi-site environment, which can avoid over-storage in a ܵ site, to the detriment of an under-storage at another ܵ site. In our opinion, the management of material resources in a multi-site platform is at the intersection of the following three issues : • The projection of algorithms developed in the load balancing field.
• Inventory management across an extended enterprise.
• Distributed management of information flows in a multisite cooperative platform.

A. Mathematical Formulation
The consumption law of an ‫݉݁ݐ݅‬ on a ‫ݐ∆‬ = ܶ − ܶ interval with ܶ = 0, on a ‫݁ݐ݅ܵ‬ , is defined by : where ܲ is the consumption of the ‫݉݁ݐ݅‬ at time ܶ .
The law (1) obeys many criteria, item types (A, B or C), etc. For our part, we recall that we focus on the class C items with very high consumption. This class of items obeys a consumption law, approximated by a least squares line. But if this consumption law changes, the conceptual proposition that we present in this paper will remain valid. We wish to approximate the real consumption, by a consumption law at the moment ܶ , in order to be able later to detect stock shortages, at the moment ܶ ௦ , before the next replenish at time ܶ .
This should be done automatically for all common and existing items on each site. To do this, we use least squares to find the coefficients ܽ and ܾ . It is sufficient then to solve the system: For a single item k , there are nbS systems of linear equations, with unknowns ܽ and ܾ to be solved. By considering: This is equivalent to solving ‫ܣܾ݊‬ * ܾ݊ܵ systems, similar to the system in (4). Note that the number of units n available by item k can vary on the same Site m or on different sites. The solution for ‫݉݁ݐ݅‬ on a ‫݁ݐ݅ܵ‬ is therefore immediate: Knowing ܽ and ܾ , the stock shift for the item k at the moment ܶ ௦ on a Site m will occur at : Applying the Sm and Sp sites, stock-outs will occur at: and if the condition (8) is satisfied: A balancing for item k between sites S m and S p is necessary, because there will be a stock shortage in the Site m and a useless stock in the Site p (see Figure 1), which is a shortfall for the company.

B. Transfer Mechanism
The transfer mechanism ( Figure 3) that we are going to use is essentially based on the role of a software agent called prevention agent AGP k (see VII1), associated with each site site k . AGP k allows controlling the items by managing their state before, concretely, making their transfer (Figure 3).

A. Agent, MAS and Cooperation
We consider that the agent paradigm and MAS is known now. However, it should be remembered that there is no unified definition of the term "agent" in MAS community. However, everyone agrees that the autonomy concept is central to the issue of agents. For our part, we consider the consistent academic definition of this notion given in [11,12]. For our case study, we define an agent as a software entity, located in an environment, with an autonomous behavior enabling it to reach, by interacting with this cooperative environment, the objectives assigned to it during its creation. Cooperation is the form of coordination between non-antagonistic agents. Conversely, negotiation corresponds to coordination in competitive universes or between "selfish" or competitive agents. Typically, to successfully cooperate, each agent must maintain a model of other agents, and also develop a model of future interactions (planning). The fact that a Site m agrees to troubleshoot another Site k is a form of cooperation. This can be done, of course, after a negotiation phase between the sites while maintaining their respective interests. Moreover, a MAS is a set of agents that respond to the architecture of a system and its dynamics, based on an organizational model and on a model of interaction between the agents of this system. These agents are activated for the emergence of the desired solution. In this paper, we take note of the keywords: organization, autonomy, interaction, cooperation, and objective which, in our view, constitute the principal characteristics that the agent-MAS pair must have, and which constitute the reason for the dynamics of the system in order to fulfil the desired objective. Unlike the top-down approach, known as static conventional approach, modeling the functioning of a complex problem using MAS is starting from simple distributed tasks with local objectives in order to bring out the overall solution of the posed problem. In our case, the local objective is the optimal availability of items in quantity (neither under-storage nor over-storage) and cost. The goal of the entire system is the balancing of these items across all the enterprise's sites. Using MAS in modeling is also to look for an adequate organization model that must be associated with an interaction model in order to respond as much as possible to the proper functioning and dynamics of the system. We consider that there is not yet a generic model that can satisfy all the criteria of organization and functioning of any problem.

B. Agent-oriented Architecture Model
The agent architecture is the product of the transition from the objective component to the projective component. Indeed, in the case of oriented object programming, the object is essentially a passive component offering services and using other objects to realize its functionalities. The object architecture is therefore an extension of the architecture in calls and returns. The agent, on the other hand, intelligently uses other agents to achieve his objectives. It performs this by establishing dialogues, negotiating and exchanging information with them. We involve the following five agents (Figure 4): • AGI, Information AGent.
• CAG, Coordinator of the Group Acquaintances.
• CIG, Inter-Group Coordinator. Agent-oriented architecture VII. DEPLOYMENT SCENARIO Before describing the roles and behaviors of the software agents deployed to make the balancing in quantity of our system different items, we first briefly describe the process of interaction between these agents ( Figure 4): • On each site (Site m ,m=1, nbS), there is an agent AGP m associated with it, which watches periodically. After evaluation of the state of each item i , i=1, nbI it alerts AGS m in case of under-storage or over-storage.
• AGS m informs the CAG for items that are in under or over storage.
• The CAG launches a call for tenders to sites k which are in under storage for an item j which is overstocked at site m (m≠k). If the answer is negative, an alert is sent to the CIG.
• If there is a positive answer from the AGS p , a negotiation starts between the AGS m and the AGS p on quantities, deadlines, etc.
• If there is confirmation of the incoming or outgoing, the AGS m , AGS p orders respectively the AGI m , AGI p to update the respective items information systems.
VIII. ROLES OF SYSTEM AGENTS The roles of the agents involved in our architecture are:

A. Prevention Agent (AGP)
AGP is an intelligent agent that has an intelligence capacity that allows it to take decisions based on its Knowledge Base (BC). It is based on algorithms that calculate previous consumption and other availability criteria. This agent has the ability to predict cases of sub or over-stock of item quantities, based on the T prev prevention times calculated for each item. It sends emergency messages to the supervising agent indicating, for a type of item, whether there will be an over or understorage. This agent therefore consults the database in a continuous and periodic manner and looks for cases that may cause abnormal situations, in order to prevent and send alert messages to the supervisor. Our study gives more importance to the prevention aspect, and thus to the script of the agent dedicated to this role, because it ensures an optimal management of the items in a cooperative framework between all the sites of the extended enterprise. Our study gives more importance to the prevention aspect and consequently to the script of the agent dedicated to this role, because it ensures an optimal management of the items in a cooperative framework between all the sites of the extended enterprise. The script of this agent is presented in Figure 5. AGS is the supervising agent. It is the master agent associated with a site, its role is to manage and control the system operation. It describes the overall objectives of the system and observes its state. The supervising agent communicates the incoming and outgoing quantities of items. It also launches requests for item acquisition or offering. It receives/sends messages from/to other sites. With this approach, it acts as an interface relative to other sites. Its script is can be seen in Figure 6.

C. Information Agent (AGI)
AGI is a reactive agent that has no intelligence, its role is stock management, in the traditional sense, with actions such as creating, consulting, and updating item database. This agent receives the order from the AGS before any operation. Fig. 6.
Script of AGSm D. Coordinator of the Group Acquaintances Agent (CAG) CAG's role is associated with a group of sites Site k , k=1, Gs and Gs subset E on the basis of a criterion, e.g. the geographical one. The CAG ensures the coordination and reception of the needs, in quantity of items, of the different sites of the group. It classifies the needs of the sites concerned by items that are under or over storaged, optimizes these costs, according to the auction algorithm and communicates these needs to the appropriate AGS k , k=1, nbS. Its behavior is described by the script in Figure 7. case where an item i belonging to Site m is in global state of under or over-storage. In this case, it is necessary to negotiate with a Site k outside the group. As a result, the behavior of the CIG is identical to that of the CAG but in intergroup coordination.
We notice that the agent-oriented architecture we propose has cognitive agents and reactive agents. The prevention agent is a cognitive agent, having the ability to reason on the basis of its past, regarding past consumption and all other information in its knowledge base. Agents belonging to the same agent group recognize each other through their intercommunicating supervisors.

IX. ORGANIZATION MODEL
The problem as it stands does not obey an already existing organizational model. We have developed our own model, based on our needs, called AGIRAT (Figure 4, Figure 8) which is based on the following: 1) The agent is the basic conceptual entity of our organization. Each moment a site is represented, in its environment, by the supervising agent. And the site itself can have a MAS or another internal structuring. As a result, an agent is : • Autonomous.
• In intra-site interaction with the prevention and inventory management agents and in extra-site interaction with the other supervisory agents of the system. Knowing that the agents are cooperative, they must communicate in asynchronous connected mode with answer times ∆ t which must be determined by this same supervisor.
• Has a goal.
• Our prevention agent is a cognitive agent because it has a form of intelligence, which allows it to predict its future and act in the present on the basis of its past.
2) Group: represents the organization of agents in a group according to a specific criterion. As a result, an agent can belong to several groups ( Figure 8).
3) Interaction: The whole system is based on the interaction of one entity with the others. Without interaction, the system is static.

4) Role
: Each agent has a role in relation to its existence, but performs one or more tasks at the time T current . 5) Authority (or privilege): authority is the rules governing the organization and the interest of the group. On this basis, a holistic strategy can be applied.
6) The task which is the subdivision of the role into task sequences (sequentially or in parallel) is the atomic element in relation to the conceptual MASs. At implementation, a task can represent a script running on one or more processes in the IT sense (Thread or Unix Process) The results of item km and item kp consumption, respectively on the sites S m and S p , yielded the following results: 3) Balancing between item jm and item kp : By comparing the results of (12) and (16), we notice that the T remainder relative to item km is very close, while To kp on item kp is very far (Figure 9). In addition, item km is in under-storage and item kp is in over-storage, i.e. P kp >> P km . These quantities of under and over-storage are easily evaluable before the next replenish at T r = 80: Therefore, the Site p in over-storage, can offer the Site m which is in under-storage situation, at least the deficit that is in this case easily quantifiable. This will be done in the same way for item j on Site m and Site p . The Site m can offer the Site p the quantity it needs ( Figure 10).

XI. GENERALIZATION TO N SITES
By generalizing this process to other items and other sites, and using scripts in Figures 5-7, we are able to perform decision-making followed by the transfer via the network platform, (Figure 4) using a software middleware, a global balancing of the system emerges and is maintained over time by determining the successive differences, i.e. the scales at each time period balP at T os and balP at T r , between the same item i between two different sites ( Figure 11). Interactions between the system agents are done by the quoted middleware ( Figure 4). Messages sent between these agents and generating these interactions are characterized by the requests send() and receive() such as in the scripts in Figures 5 and 7. The subscript negociate() ( Figure 6) is in fact a succession of asynchronous bi-directional messages between each two interlocutors AGS m and AGS p , but these messages are synchronous with other system interlocutors. This must be done in order to agree on how to make this contract work. But the last word comes from human decision-makers that are helped by these two facilitating agents installed on sites Site m and Site p . The system is balanced because it is generalized for all the system item s(item k , k=1, nbI m ) and on each site (Site m ,M=1, nbS).

XII. COMPARISON AND DISCUSSION
As noted above, resource management in a multi-site environment depends on many research axes (load-balancing, material resource management with all the supply chain issues, management of information flows in an e-environment, etc.). In this work, a material resource can be a spare part to be acquired at the right time for preventive maintenance purposes, or a quota on disk in a multi-user system or even a virtual disk in cloud-computing on a data-center, and particularly in IaaS (Infrastructure as a Service).
Compared to the cited works, our contribution defines this notion of distributed material resources and provides a "quantifiable and preventive" solution to this situation in a distributed multi-site environment. This point was not taken into account in the related work.  XIII. CONCLUSION In this paper, an interaction model, dedicated Multi-Agent System (MAS) was proposed, which responds to an organizational model based on the AGIRAT (Agent, Group, Interaction, Authority and Task) principles, and was applied to the management of material resources in a cooperative framework. A MAS architecture was established, which is internal to the site, and which provides, among other things, a dedicated cognitive agent, whose role is to guard, and even prevent, possible cases of under or over-storage of items, based on past consumption. The global MAS architecture of all the sites composing the system interacts with the internal MAS of a site via a facilitating agent, in this same cooperative framework, ensuring the emergence of a "resource balancing", and allowing quantification the of the availability of items. This solution prevents sites from exceeding the storage threshold. The implementation of the proposed architecture, requires the use of a dedicated middleware software. Our approach has been validated in a distributed environment and has yielded satisfactory results.