Towards a Real-time Mitigation of High Temperature while Drilling using a Multi-agent System Yazan Mualla1 , Amro Najjar2 , Robin Vanet3 , Olivier Boissier4 , and Stéphane Galland1 1 LE2I, Univ. Bourgogne Franche-Comté, UTBM, F-90010 Belfort, France {yazan.mualla, stephane.galland}@utbm.fr 2 Computer Science Department, Umea University, Umea Sweden najjar@cs.umu.fr 3 Univ. Lyon, IMT Mines Saint-Étienne, F-42023 Saint-Étienne, France robin.vanet@telecom-st-etienne.fr 4 Univ. Lyon, IMT Mines Saint-Étienne, CNRS, Laboratoire Hubert Curien UMR 5516, F-42023 Saint-Étienne, France olivier.boissier@emse.fr Abstract. In oilfield wells, while drilling for several kilometers below surface, high temperature damages the drilling tools. This costs money and time for tripping operations to change the damaged tool. Existing temperature mitigation techniques have several drawbacks including a long response time, analogue signal issues and human intervention. In this work, we empower the down-hole tools with a coordination mech- anism to mitigate high temperature in soft real time by controlling a down-hole actuator through a voting process. The tools are represented by agents that control the sensors and actuators embedded in these tools. To implement the proposed system properly, a model of the drilling do- main is constructed with all drilling mechanics and parameters, along with the well trajectory and temperature equations taken into consider- ation. The proposed model is implemented and tested using AgentOil, a multi-agent-based simulation tool, and the results are evaluated. Fur- thermore, the requirements of a real-time temperature mitigation system for Oil&Gas drilling operations are identified and the constraints of such systems are analyzed. Keywords: cyber-physical system · multi-agent-based simulation · high temperature drilling wells · oil and gas drilling process 1 Introduction According to the Oil&Gas UK economic report for 2017, Britain oilfields produce each year about 76 million tonnes of oil equivalent. This provides 76% of the UK’s total primary energy [25]. In oilfield wells, a drilling rig is used to drill a bore- hole in the earth’s sub-surface with a Bottom Hole Assembly (BHA), which is a composition of several drilling tools with various functionalities, searching for natural resources. Once found, they will be produced and refined for public use. While drilling, temperature increases with depth in a specific rate. High tem- perature damages the tools, which costs time for tripping operations to change the damaged tool apart from the cost of the damaged tool itself. When these tripping operations are not planned, the time spent is called Non-Productive Time (NPT). With the intention to monitor the status of tools, sensors are at- tached to them in order to read temperature, in which the use of Cyber Physical Systems (CPS) concepts is important. Moreover, investing in technologies to manage and mitigate high temperature showed to be cheaper than investing in a technology to withstand high temperature. In most of the existing systems, temperature mitigation is executed by the field engineer up-hole (several kilometers above the down-hole tools) after data about high temperature is sent from the down-hole tools. This mitigation relies on mud cooler to cool the drilling mud, the latter will be in contact with down- hole tools. However, this process suffers from the following three flaws: First, existing wells rely on analogue telemetry to undertake the communi- cation between tools down-hole and field engineer up-hole. However, analogue telemetry has the following couple of drawbacks: (i) Long response time: the time for data to be sent up-hole, and for the impact of the cooled mud to reach the tools down-hole. In deep wells (more than 1km), analogue telemetry bandwidth will be low (less than 1bit/second), as mud pulse speed is 1kilometer/second [27]. (ii) Signal issues: the analogue signal is unreliable in extreme drilling conditions like high temperature, as it maybe become noisy and sometimes even lost. Second, the effectiveness of the up-hole actuator (mud cooler) in high temper- ature conditions may become inefficient (even in maximum power). Third, in existing operations, the monitoring, problem detection, and decision making are undertaken by humans. This makes the process error-prone, unresponsive, and fault-tolerant. To overcome these flaws, we propose a Multi-Agent System (MAS) empow- ering the down-hole tools with a coordination mechanism to mitigate high tem- perature autonomously in soft real time by controlling a down-hole actuator through a voting process. The system allows to convert the drilling process into an automatic CPS using MAS. In this system, the agents represent the down- hole drilling tools, and each agent is aware of the temperature specifications of its tool and it controls the sensors and actuators embedded in its tool. Moreover, the agents react to data read by sensors attached to them, by triggering a voting cycle to send commands a down-hole actuator (bit controller) aiming at miti- gating high temperature. Thus, the proposed system allows down-hole tools to handle the situation and take actions without the intervention of up-hole entities when the field agent is not aware of the situation down-hole. Drilling mechan- ics along with the well trajectory and temperature equations needed in drilling operations are modeled in the system as the environment where the agents in- teract. A tool agent votes to start the actuator in a specific power level as per its temperature specifications and the current temperature, and an overall single decision is aggregated as per the votes of all tools. We have implemented several known voting rules to aggregate the votes. One of the challenges in oilfield automated applications according to [1] is that there is a huge complexity associated with managing an asset operating in the Oil&Gas industry. Simulation environments provide a convenient alternative to test such applications. Therefore, the proposed model is implemented and tested using AgentOil, a multi-agent-based simulation tool of the drilling process in oilfields [18], and the results are evaluated, discussed and validated. They show that the down-hole tools agents are capable of autonomously mitigating high temperature down-hole. This increases the life cycle of down-hole tools allowing them to drill deeper as shown in the results. This work is organized as follows: Section 2 investigates the state-of-the-art about the MAS and CPS applications in Oil&Gas industry and about voting systems with a short background knowledge about the drilling tools and tech- nologies. Section 3 discusses the proposed system. Section 4 evaluates the pro- posed system and discusses the results. Section 5 presents a real-time analysis for drilling agents. Section 6 draws conclusions and states the future work. 2 Background Since this work proposes a system for controlling drilling tools, Section 2.1 intro- duces a short background knowledge about the drilling tools and technologies. Next, Section 2.2 discusses the literature of CPS and MAS in the Oil&Gas indus- try. Later, Social choice theory, and particularly voting systems as coordination mechanisms, are studied in Section 2.3. Finally, a discussion about the real-time compliance for MAS and CPS is provided in Section 2.4. 2.1 Drilling Tools and Technologies The Bore-hole Assembly (BHA) is a set of drilling tools with embedded elec- tronics used to drill the well (or bore-hole). Following are the main components from bottom to top of the BHA (Figure 1): – Bit: It is used to crush and cut rocks, hence drill; – Rotary Steerable System (RSS): It is designed to direct the drilling process with continuous Rotation per Minute (RPM) of the bit. In addition, it reacts to the steerable conditions and adjusts the position of the BHA; – Logging While Drilling (LWD): It measures in real time -while drilling- the formation characteristics. Formation & evaluation sensors are embedded in these tools that measure data and give logs related to the drilled formation; – Measurements While Drilling (MWD): It embeds steering & direction sensors that read data to determine the position and direction of the tool compared to the Earth magnetic and gravity fields. Additionally, it includes the modulator responsible for transmitting collected data from all tools in the BHA. Data transmission methods may vary from drilling company to another, but the main method involves transmitting data to the surface as pressure pulses in the mud system (analogue signal) which may witnesses significant delay to reach the surface up-hole. Moreover, successful data de- coding up-hole is highly dependent on the signal-to-noise ratio. All tools are powered by two sources: 1. From the MWD, as it includes a turbine that generates power from the flow of drilling mud. 2. From a battery in the tool itself, when the flow of mud is stopped to add a new drilling tool to the BHA. All tools have repair & maintenance embedded sensors in them, which give the status of the tool and measure the temperature that our system is mitigating. Finally, all tools have electronic boards that enable programming them up-hole as per the needed requirements of measurements, and hence, the proposed model can be programmed in these boards. Fig. 1. The BHA components 2.2 CPS and MAS in Oil&Gas The role of CPS in the industrial domain has been discussed thoroughly in the literature [2]. It has been stated that there is a need for new models, designs and applications [11]. Recent research works proposed to increase the interac- tion among artifacts of the system since the existing systems are not enough [13]. In particular, they discussed the principles of predictive manufacturing sys- tem as a strategy to allow manufacturing industry to increase competitiveness through a highly transparent manufacturing process. However, they just stated the principles of what the model should be without implementation. Other research works discussed how, by utilizing advanced information an- alytics, networked machines will be able to perform more efficiently, collabo- ratively and resiliently in soft real time. They specifically proposed a unified 5-level architecture as a guideline for the implementation of CPS [14]. However, the proposed architecture did not consider the fact that entities in the system may have different concerns and specifications even though they are concerned with the overall goal of the system. Most of the work in the MAS domain in Oil&Gas industry is still theoretical and conceptual. However, there are rare concrete applications. For instance, in [16], the authors discuss the scalability of oilfield production configurations, and present a novel application of multi-agent systems to facilitate intelligent multi objective control for maturing Oil&Gas fields. Moreover, most of the work has concentrated on the supply chain and management aspects [16] [15]. They overlooked the role of engineering in the drilling and production process of oilfield wells. For instance, the potential of tools or equipments failing if being run out of their specifications. 2.3 Voting Rules In the domain of MAS, voting systems are an active area of research that enables decentralized decisions [12]. Agents are likely to represent different stakeholders with their own aims and objectives. This means that the most plausible design strategy for an agent is to maximize its individual utility [26]. When different agents have different preferences within a MAS, it is desirable to have a mecha- nism enabling the agents within the system to make a collective decision. Often, agents are competitive and have independent goals or perspectives. Nevertheless, they need to be reconciled and to come to a consensus [20]. Each agent expresses its preferences of the possible decisions, and a voting system aggregates these preferences to determine the collective decision [21]. Therefore, a voting sys- tem provides an efficient way to make a socially collective decision while taking individual preferences into account [3]. Voting rules are defined to handle the voting process considering some proper- ties like Anonymity (votes do not disclose the voters), Neutrality (each candidate is treated the same) [21]. Voting rules vary in types and processes, hence in what follows, we present the most used rules in the MAS literature: 1. Plurality: Voters cast a single vote, and the candidate with most votes wins. 2. Borda count: Each voter ranks the candidates in order as per her pref- erence. This ordering contributes points to each candidate based on the position that she is ranked by the voter. In other words, if there are m can- didates, it contributes m − 1 points to the candidate ranked first, m − 2 points to the second, and so on. Accordingly, the winner is the one with the highest points [24]. 3. Single Transferable Vote (STV): This rule requires up to m − 1 rounds. In each round, the candidate with the lowest plurality score is eliminated and votes for that candidate will be transferred to the remaining candidates in the next round [8]. Due to the rounds, it takes significant time. Therefore, it is not suitable for real-time applications, such as the one under study. 4. Condorcet: This rule elects, if applicable, the candidate that would win a majority of the vote in all of the head-to-head voting against each of the other candidates, whenever there is such a candidate, it is called the Condorcet winner. 2.4 Real-time Compliance For MAS and CPS Real-time compliance has been identified as a key feature for MAS [10] and CPS [6]. In particular, in [4], the authors showed that, while MAS demonstrated useful capabilities in regulating interactions among CPS components, most of the existing MAS architectures employ negotiation protocols lacking real-time compliance. Therefore, the authors conclude that existing negotiation protocols are not ready to face the strong real-time constraints which characterize the CPS. In a later contribution [5], the authors show that most of the existing MAS environments in the literature rely on traditional general-purpose scheduling algorithms. This makes them unable to enforce the compliance with strict timing constraints. Thus, it is not possible to provide any guarantees about the system behavior in the worst-case scenario. This section presented the related work in the domains of MAS and CPS as an application in Oil&Gas industry, and it discussed the real-time compliance for MAS and CPS. Additionally, a survey of the most used voting systems in such applications are presented. Next section will discuss the proposed system. 3 Contribution This work proposes that tools down-hole mitigate high temperature autonomously in soft real time with a decentralized collective decision. Notably, it takes ad- vantage of the current infrastructure allowing for communication between these tools, as they all send measured/logged data to the MWD in order to send them up-hole. Additionally, there is one actuator down-hole in the RSS, which is the bit controller. It is responsible for controlling the bit rotation, that affects the speed. Reducing the speed means delaying the time to reach higher temperature. Although this leads to slower drilling, it mitigates the temperature raise, thereby save the tools from failure allowing them to drill deeper. Section 3.1 analyzes the drilling mechanics and parameters. Section 3.2 discuses the multi-agent and voting architecture of the system. In addition, the proposed voting system is presented and explained. 3.1 Drilling Mechanics Model In the literature of Oil&Gas domain, there is no concrete model of the drilling process and operations. Such model should include the drilling and temperature equations needed to implement and evaluate the system properly. In this section, concepts from the drilling terminology discussed in our model are introduced. Measured Depth and True Vertical Depth Measured Depth (MD) is the length of the well-bore, while True Vertical Depth (TVD) is the vertical distance from the surface until the bit. TVD is par- ticularly important in determining the down-hole temperature. Measured with accelerometers in MWD, inclination is the deviation from vertical, irrespective of compass direction, expressed in degrees. It is relating MD with TVD using the Pythagorean equation. TVD calculation equation using average angle method is shown in Equation 1. I1 + I2 ∆T V D = ∆M D ∗ cos (1) 2 Where: ∆M D = measured depth between two readings in different depths; I1 = inclination at upper reading; I2 = inclination at lower reading. Assuming the Azimuth direction is not changing, T V Dnew will be calculated as: T V Dnew = T V Dold + ∆T V D. Temperature Gradient The rate of increase in temperature per unit depth in Earth is called Temper- ature Gradient, a.k.a. Geothermal Gradient. Although it is location dependent, it averages at 30 C◦ /kilometer [15 F◦ /kilofeet] [9]. It increases drastically around volcanic areas or with the presence of radioactive materials in the formation [22]. The most accurate way to get the down-hole tool temperature is by measuring it with a temperature sensor. Alternatively, it can be estimated by adding the surface temperature to the product of the depth and the geothermal gradient as shown in Equation 2. DownHoleT emp = Surf aceT emp + T V D ∗ GeothermalGradient (2) Drilling parameters Set by the field engineer, drilling parameters are used to control the drilling process. Mainly, we focus in our model on three essential parameters: – Force: represented by Weight-on-Bit (WOB) applied to the drill-string, and it is only controlled up-hole. – Rotation: represented by Revolutions-per-Minute (RPM) of the drill-string, and it is controlled up-hole but can also be altered down-hole in our system. – Flow rate: which is the mud flaw rate circulating inside the drill-string to cool down the tools and carry cuttings resulted from the drilling process. Other conditions affecting the drilling process are bit type (roller cones, diamond, etc.), bit characteristics (cutting structure, dullness on drilling rate, rate of tooth wear and bearing life, etc.) and the size of the hole. However, they do not change through out the drilling run, hence we did not consider them in our model. The speed of drilling process or the Rate of Penetration (ROP) as a function of several parameters is shown in (Equation 3) [19]. K W OB ROP = K r (3) ap Where K: Formation factor, is a constant related to formation hardness; W OB: function of WOB; r: function of RPM; aP : function of flow rate and bit characteristics (for detailed information, c.f. [19]). 3.2 The Multi-Agent and Cyber-Physical Architecture Based on the BHA components (Section 2.1) in existing oilfield wells, we propose in our model the use of MAS in Oil&Gas drilling operations (Figure 2), with the intention to convert it to a CPS application. Consequently, this will include using intelligent agents instead of humans. In Figure 2 down-hole, we represent each programmable down-hole tool in the BHA (MWD, LWD and RSS) with an agent. This agent is responsible for the sensors and actuators embedded in the tool. Each tool has different sensors that are used to measure three different kinds of data: Steering & direction data, repair & maintenance data, and formation evaluation data. Only the MWD agent controls the modulator which is responsible for the communication with field engineer up-hole. Likewise, only the RSS agent controls the bit controller that changes the rotation of bit, which is the actuator concerned by the voting down-hole. In Figure 2 up-hole, the field agent is replacing the field engineer. This agent is responsible for controlling the drilling process by changing drilling parameters when needed to drill ahead and reach the total depth. Additionally, it controls the up-hole actuator (mud cooler) that is responsible for cooling the mud, which will be in contact with all tools. Even though controlling the rotation speed is not implemented yet down-hole, we argue that, the infrastructure to do so is present in the RSS. The benefit of decreasing the rotation of bit is to slow down drilling and delay reaching a high temperature zone. All voting rules that use several rounds to determine the winner are not suitable in this real-time application since they take time to conclude a result. Therefore, we implemented in our system those that use only one round. How- ever, these voting rules have the drawback of not supporting the Condorcet consistency criterion. Therefore, we also included the implementation of the Condorcet rule. The decision to activate the bit controller as well as to choose the needed power level is based on the achieved efficiency in mitigating high temperature with a lower cost, i.e. if the bit controller power level 40% is enough, then there is no need to choose the 100% power level. The current temperature of the tool is read by a sensor attached to the tool. It will be compared with the temperature specification level, and if it reaches this level, the tool reacts by initiating a voting cycle to start the bit controller. The vote represents the desired bit controller power level which is determined as per the temperature specification levels of each tool. The vote has to be from Fig. 2. The proposed system architecture a discrete set of candidates of bit controller power levels, which is {0, 20, 40, 60, 80, 100}. 4 Evaluation and Results AgentOil [18], a multi-agent-based simulation tool of the drilling process in oil- fields, was used to evaluate the proposed system. AgentOil is implemented using RePast simphony [7], a multi-agent simulation environment, as it has signifi- cant operational and executional features [17]. The evaluation is performed as follows. First, Section 4.2 assesses the effectiveness of the proposed system by comparing the results obtained when the proposed system enabled with results obtained when the system is disabled. Second, Section 4.3 analyzes in detail the behavior of our system throughout the whole run in soft real time. Before listing the experiments performed, Section 4.1 states the initial parameters of these experiments. 4.1 Initialization and Parameters We have used a laptop with the following features to conduct experiments with the simulation: Processor: Intel Core i5-2520M; CPU: 2.50GHz; RAM: 8GB; OS: Windows 7 Ultimate 64-bit. The simulation runs for one drilling run, and all parameters have initial values that the user can change if needed before the simulation starts. Once the simulation starts, all tool agents and actuators (down-hole and up-hole) are created and set accordingly in the environment. We set a simulation tick to be corresponding to one minute. Thus, the results will be normalized as speed is given in meter/minute. Every tick, drilling mechanics and parameters are updated to calculate the ROP (Equation 3). The agents measure M D, and compute their T V D from it (Equation 1). Then, they calculate the current temperature as per the TVD, geothermal gradient, and surface temperature (Equation 2). Once they have their temperatures, the decision model in each tool is considered, and requests for starting actuators are sent accordingly to mitigate high temperature either to start the mud cooler up-hole when reaching the danger level of the tool, or to start the bit controller when reaching the critical level. A simulation run can end either successfully (reaching total depth) or un- successfully (with a tool failure). On the one hand, if both mitigation measures up-hole and down-hole were insufficient, a tool fails and a tripping operation is needed to change the BHA. This means NPT for the whole system. Conse- quently, the simulation ends with a message saying which tool failed and with what temperature along with the corresponding depth. On the other hand, if no failure happens, and the RSS reaches the total depth, the simulation ends and a message is displayed explaining how much time it took to drill the well. Each experiment has been conducted tens of times and an average has been concluded. In each experiment, we have used a fixed number of agents to nor- malize the results, as follows: Up-hole: one field agent and one up-hole actuator agent; Down-hole: one MWD agent, three LWD agents, one RSS agent and one down-hole actuator agent. 4.2 The Effectiveness of the Proposed System Figure 3 shows the results in terms of time and depth of running the simulation with the proposed system (colored curves) and without it (gray curve). We have averaged the results for different values of fixed WOB (the x-axis). Figure 3 (left) illustrates the time elapsed before failure (in other words, how much time the tools survived in high temperature environment). Correspondingly, Figure 3 (right) plots the depth before failure (in other words, how much depth was drilled before failure), which is the main goal of drilling a well. In both figures, three voting rules were examined: Condorcet (in green), Plurality (in red), Borda count (in blue). From Figure 3 (left), it can be noticed that all colored curves are above the gray curve, which means that all runs of the proposed system (with different voting rules) are better than simulation runs without enabling the proposed system. This result should be taken relatively, as more time means a longer delay before reaching the goal, and hence more money spent. Therefore, it should not be considered alone without the impact on depth before failure. Figure 3 (right) shows that the colored curves are below the gray curve (significantly with high WOB). For example the green curve (Condorcet rule) has drilled with 30k lbf WOB till approximately 4356 m which is 16 m more than what the gray curve (without enabling the proposed system) has drilled. Even though this difference in depth drilled may seem insignificant, it is vital in extreme drilling conditions because drilling 16 m at a deep depth takes hours in such conditions, and each hour a large amount of money is being spent to operate the drilling rig and pay for various services. Fig. 3. Gain in time and depth with the proposed system 4.3 The Analysis of a Single Simulation Run In this experiment, we investigate the behavior of the proposed system in sim- ulation ticks to analyze the impact in mitigating high temperature in soft real time. All runs are done with fixed WOB: 10k lbf. In this experiment, a chart of temperature of one of the tools throughout the simulation is presented. In which, the x-axis represents time (simulation ticks), and the left y-axis repre- sents temperature in degC. As seen from Figure 4, for this drilling run, the starting position was 3000 m, and the temperature corresponding for this depth was 99 degC. This explains the beginning of the left y-axis. The blue curve represents the actual temperature mitigated by the system, while the red curve represents the temperature if no mitigation is done, hence, the temperature increases linearly in time while drilling with fixed WOB. We can easily notice that, compared with the red curve, the blue curve witnesses considerable drops throughout the simulation run. 5 Discussion The aim of the CPS proposed in this article is to make a step forward towards a real-time temperature mitigation system for Oil&Gas drilling applications. However, as been shown in recent studies in the literature, real-time compliance is one of the most difficult challenges confronting the application of MAS in CPS. Fig. 4. Temperature increase in time with and without the proposed system In particular, Calvaresi et al. [6] ascribed the absence of real-time compliance in MAS systems to some of the fundamental elements of these systems such as agent internal scheduler, and the communication and negotiation protocols. Therefore, upgrading these elements individually is not sufficient to achieve real- time compliance. To overcome these limitations, the authors in [10] sketch a blue-print for a solution allowing for real-time compliance of MAS. In time-critical environments such as Oil&Gas drilling operations, real-time compliance is a primordial element. However, since this work has been imple- mented in Repast, it cannot overcome the limitations imposed by this multi- agent simulation environment. That being said, within the aforementioned limi- tations, this works tries to address the real-time compliance by relying on a vot- ing system with a single-round voting rule. This choice is explained as follows. First, typically, decentralized decision making problems can be solved with tech- niques like Distributed Constraint Satisfaction Problems (DisCSP) [28], these solutions are time-consuming and cannot comply to a time-critical application such as Oil&Gas drilling. Second, voting systems are very efficient when it comes to small preference aggregation of choosing between a discrete set of candidates. Yet, this paper presents a work-in-progress. Other real-time compliance as- pects will be addressed such as requirement to initiate a voting, the voting time window, and the delay before the actuators are activated will be studied and addressed. Furthermore, the communication delay is another considerable factor that should be taken into account in order to enhance the real-time compliance. Existing technologies in materials engineering are currently being tested for drilling in the temperature of 200 degC. Several materials are used for these tests from plastic-encapsulated electronics on a plastic board, to ceramic-encapsulated electronics on a plastic board, to ceramic and metal components (no plastics) [23]. Yet, beyond this temperature, there is a need for a mitigation process to handle the temperature instead of a material to withstand the temperature. Figure 5 illustrates an example of the requirements of the real-time system we plan to build. In this example, there are 4 agents: one MWD, two LWDs, one RSS, and one actuator (bit controller). The temperature that damages the tools is 200 degC, and the RSS reaches the critical temperature of 195 degC. Although any tool can reach the critical temperature, there are two worst case scenarios when either the MWD or the RSS faces high temperature, as the communication time between down-hole tools in these cases will be maximized to send the requests to other tools, due the fact that the tools are connected in sequence. Therefore, in this example, we chose one of these two worst case scenarios. The time window in which the system should react to mitigate the temperature is T imeW indow = t(DamageT emp) − t(CriticalT emp) = 5 to 10 minutes where t(x) represents the time when the tool reaches the temperature x. Figure 5 plots the sequence of the process start the down-hole actuator after a voting process done by the tools agents. RSS sends voting requests R2 , R3 , R4 to LWD2, LWD1, MWD respectability when it reaches 195 degC, where R2 < R3 < R4 due to the physical distance between the tools. The time for each tool agent to choose a vote is similar for all tools (V = V1 = V2 = V3 = V4 ). After each tool agent chooses the vote as per its own tool specifications, votes (S2 , S3 , S4 ) are sent to the RSS (as it is the only tools that can control the bit), where S2 < S3 < S4 due to the physical distance between the tools. V T , the voting time is the time needed for all the requests to be sent, the agents to vote, and the results to be sent to the RSS. As the agents are working in parallel, we need to calculate the time of the processes with the maximum duration. In this example, V T = R3 + V + S3 . V T in general equals to 3n seconds in worst case scenarios where n is the number of tools. DT represents the time for the RSS to aggregate the results of the voting process, and is equal to 3 seconds in general. A1 represents the time for the RSS to start the bit and as this process includes starting some mechanics, it lasts for almost 60 seconds in general. A2 represents the time for the effect to take place, and it varies according to the formation but equals to 300 seconds in general. Although, the times in this example are chosen hypothetically, there are some facts: A1 > DT and A2 > A1 . In conclusion, the time of the whole mitigation process is defined as follows: M itigationT ime = V T + DT + A1 + A2 , and any real-time system should guarantee that M itigationT ime < T imeW indow. 6 Conclusion and Future Work While drilling, high temperature damages the down-hole tools, and the exist- ing mitigation process is insufficient, due to the physical distance and the fact that the communication is analogue between the down-hole tools and the field engineer up-hole that controls the existing mitigation process. Most of the ex- citing works proposing to use MAS in Oil&Gas are conceptual, with no concrete application of MAS in the engineering aspect. In the proposed system, The tools agents react to high temperature and socialize to mitigate this high temperature autonomously down-hole and in soft real time. Voting rules have different pros and cons, so we have implemented several voting rules in our voting system (Plurality, Borda count and Condorcet). MWD V4 R4 S4 LWD V3 1 R3 S3 LWD 2 V2 R2 S2 RSS V1 DT A1 A2 Bit Voting Time Decision Apply Action Time for the effect to Time Time (start actuator) take place Legend Tool Agent Process Actuator Fig. 5. Real-time system requirements The results of the performed experiments show that the system mitigates high temperature by delaying the damage and allowing the tools to drill deeper. Finally, we discussed the requirements of a real-time temperature mitigation system for Oil&Gas drilling operations, and we have analyzed the constraints of such system. Starting the actuator slows down the drilling, which means more time to reach the target, i.e. higher cost for the whole drilling process. On the other hand, not starting the actuator in case of high temperature damages the tools, i.e. NPT due to tripping operations to change the BHA. Therefore, there will be a need to update the tool agent decision model with a utility function to accommodate the trade-off. Acknowledgements: This work is partially supported by the Wallenberg AI, Au- tonomous Systems and Software Program (WASP) funded by the Knut and Alice Wallenberg Foundation. This work is partially supported by the Région Bourgogne Franche-Comté (RBFC, France) project UrbanFly 20174-06234/06242. References 1. Al Meshabi, O.O., Khazindar, M.M., Orenstein, H., et al.: Attitude of collabora- tion, real-time decision making in operated asset management. In: SPE Intelligent Energy Conference and Exhibition. Society of Petroleum Engineers (2010) 2. Baheti, R., Gill, H.: Cyber-physical systems. The impact of control technology 12, 161–166 (2011) 3. Brandt, F., Conitzer, V., Endriss, U.: Computational social choice. Multiagent systems pp. 213–283 (2012) 4. Calvaresi, D., Appoggetti, K., Lustrissimi, L., Marinoni, M., Sernani, P., Drag- oni, A.F., Schumacher, M.: Multi-agent systems’ negotiation protocols for cyber- physical systems: Results from a systematic literature review. In: Proceedings of the 10th International Conference on Agents and Artificial Intelligence, ICAART 2018, Volume 1, Funchal, Madeira, Portugal, January 16-18, 2018. pp. 224–235 (2018). https://doi.org/10.5220/0006594802240235, https://doi.org/10.5220/ 0006594802240235 5. Calvaresi, D., Marinoni, M., Lustrissimini, L., Appoggetti, K., Sernani, P., Drag- oni, A.F., Schumacher, M., Buttazzo, G.: Local scheduling in multi-agent systems: getting ready for safety-critical scenarios. In: 15th European Conference on Multi- Agent Systems (EUMAS) 6. Calvaresi, D., Marinoni, M., Sturm, A., Schumacher, M., Buttazzo, G.: The chal- lenge of real-time multi-agent systems for enabling iot and cps. In: Proceedings of the International Conference on Web Intelligence. pp. 356–364. ACM (2017) 7. Collier, N.: Repast: An extensible framework for agent simulation. The University of Chicago’s Social Science Research 36, 2003 (2003) 8. Conitzer, V., Sandholm, T.: Common voting rules as maximum likelihood estima- tors. arXiv preprint arXiv:1207.1368 (2012) 9. Jellison, M.J., Hall, D.R., Howard, D.C., Hall Jr, H.T., Long, R.C., Chandler, R.B., Pixton, D.S., et al.: Telemetry drill pipe: enabling technology for the downhole internet. In: SPE/IADC drilling conference. Society of Petroleum Engineers (2003) 10. Julian, V., Botti, V.: Developing real-time multi-agent systems. Integrated Computer-Aided Engineering 11(2), 135–149 (2004) 11. Krogh, B.H.: Cyber physical systems: the need for new models and design paradigms. Presentation Report (2008) 12. Lang, J.: Logical preference representation and combinatorial vote. Annals of Mathematics and Artificial Intelligence 42(1), 37–71 (2004) 13. Lee, J., Lapira, E.: Predictive factories: the next transformation. Manufacturing Leadership Journal 20(1), 13–24 (2013) 14. Lee, J., Bagheri, B., Kao, H.A.: A cyber-physical systems architecture for industry 4.0-based manufacturing systems. Manufacturing Letters 3, 18–23 (2015) 15. Marcellino, F., Sichman, J.: Oil industry supply chain management as a holonic agent based distributed constraint optimization problem. In: Proc. International Workshop on Artificial Intelli-gence and Logistics AILog@ ECAI. pp. 19–24 (2010) 16. Mikkelsen, L.L., Jørgensen, B.N.: Application of multi-agent systems in offshore oil and gas production. In: Proceedings of IADIS Multi Conference on Computer Science and Information Systems. pp. 158–163 (2012) 17. Mualla, Y., Bai, W., Galland, S., Nicolle, C.: Comparison of agent-based simulation frameworks for unmanned aerial transportation applications. In: 7th International Workshop on Agent-based Mobility, Traffic and Transportation Models, Method- ologies and Applications. Procedia Computer Science, Elsevier (2018) 18. Mualla, Y., Vanet, R., Najjar, A., Boissier, O., Galland, S.: AgentOil: a multi- agent-based simulation of the drilling process in oilfields. In: 16th International Conference on Practical Applications of Agents and Multi-Agent Systems. Springer (2018) 19. Osgouei, R.E., Özbayoğlu, M.: Rate of penetration estimation model for directional and horizontal wells. In: 16th International Petroleum and Natural Gas Congress and Exhibition of Turkey (2007) 20. Rosenschein, J., Procaccia, A.: Voting in cooperative information agent scenarios: use and abuse. Cooperative Information Agents X pp. 33–50 (2006) 21. Rossi, F., Venable, K.B., Walsh, T.: A short introduction to preferences: between artificial intelligence and social choice. Synthesis Lectures on Artificial Intelligence and Machine Learning 5(4), 1–102 (2011) 22. Sanders, R.: Radioactive potassium may be major heat source in earth’s core. UC Berkeley News. Retrieved pp. 02–28 (2007) 23. Schlumberger: High temperature drilling operations. Tech. rep., Schlumberger: Oil- field Services (2015) 24. Shoham, Y., Leyton-Brown, K.: Multiagent systems: Algorithmic, game-theoretic, and logical foundations. Cambridge University Press (2008) 25. The UK Oil & Gas industry association: Oil & Gas UK Economic Report 2017, ISBN: 1903004942. Tech. rep., OIL&GASUK (2017) 26. Von Neumann, J., Morgenstern, O.: Theory of games and economic behavior. Princeton university press (2007) 27. Xiushan, L., Shushan, H., Zhengchao, Z.: Hydrodynamic equations model mud- pulse telemetry transmissions. Oil & gas journal 101(3), 47O49 (2003) 28. Yokoo, M.: Distributed constraint satisfaction: foundations of cooperation in multi- agent systems. Springer Science & Business Media (2012)