A Hybrid Scheduling Mechanism Based on Agent Cooperation Mechanism and Fair Emergency First in Smart Factory

Smart factory also known as smart manufacturing is an emerging field with the revolution of industry 4.0. With the help of all these concepts, the smart factory integrates the manufacturing assets and represents industrial networks. In this paper, we focus on integrated solutions for smart factory concerns; by proposing an efficient task management mechanism based on an efficient and resource-aware scheduling scheme named as ACM-FEF. The scheduling algorithm used for the efficient task management is hybrid of the two scheduling approaches as agent cooperation mechanism (ACM) and fair emergency first (FEF) scheduling scheme. ACM is a decentralized scheduling approach which focuses on the production maximization goals per machine, and also pays attention to the production goals of all the machine networks involved in the smart factory. FEF scheduling scheme focuses on minimizing the tasks starvation rate and maximizing the machine utilization by efficiently using the machine slots. The proposed hybrid mechanism aims to efficiently plan tasks execution, maximize machines’ resource utilization, maximize productivity, minimize production delays, efficiently handle exceptions and efficiently control smart factory actuators.


I. INTRODUCTION
Technology has vastly changed with the changes witnessed by the industrial revolutions. Till today, the world has observed four industry revolutions where first industrial revolution started in 1784 with the introduction of mechanization based on steam and water power. The second industrial revolution came in 1923 with the introduction of mass production and electricity. The third industrial revolution came in 1969 with the introduction of electronics and IT systems along with introduction of automation. The fourth industrial revolution came in 2014 with the introduction of cyber physical system (CPS) based on smart machines, sensors, automated control of actuators, and inter-connectivity between the physical world and the virtual world [1]. The 4th industrial revolution resulted in the introduction of smart manufacturing and smart factory. The Industry 4.0 can be The associate editor coordinating the review of this manuscript and approving it for publication was Xuxun Liu . defined as: smart factories with connected machines and intelligent robots based on the CPS.
The underlying technology of smart factory is internet of things (IoT) which has smart sensing technologies, smart machines connected to network, intelligent and automated control with self-awareness, self-prediction, selfoptimization, self-configuration and self-diagnosis. Such systems are enabled with the help of CPS concept. The integration of IoT and CPS into factory creates a virtual twin of the physical world with each physical object having its virtual representation. In a smart factory, all the objects are connected using the IoT networks and the operations are operated by CPS. The basic goal of IoT is to connect the real-world objects while the aim of CPS is to connect the physical world with the virtual world [2] (Fig. 1).
The virtual objects are contained in a virtual network which replicates the physical representation, dependencies and context of the physical world objects. The IoT enabled smart factory solutions help in achieving the real-time production visualization with the identification of manufacturing objects [3]. The technologies such as radio frequency identification (RFID), a type of tracking system that uses bar code to identify items, have made real-time traceability, visibility and interoperability of items an easy task for manufacturing systems in smart factory [4]. The development of such system facilitates in the smart factory production process, intelligent decision making and automated control process, and other operations.
The smart machines participate in generating huge volumes of data known as big data. Big data can be used and analyzed to aid the smart factory production. Artificial intelligence (AI) and machine learning mechanisms are used to interpret the big data into useful information to be applicable. The right use of big data can help smart factory to optimize the production by maximizing the production output, maximizing the machine utilization, minimizing the energy consumption, minimizing the production cost, and minimizing the production time. The application of AI and machine learning into big data can result into application scenarios such as predictive maintenance, fault detection, product's quality detection, production cost predictions etc.
Smart factory consists of multiple machine networks. Existing works mostly focus on optimizing the factory machines' output but do not pay attention to the multiple machine networks' goal optimization with respect to the global production optimization. The proposed study aims to optimize the local goals as well as global goals of a smart factory using the hybrid of two techniques: ACM (agent cooperation mechanism) and FEF (fair emergency first) scheduling mechanism. Also, in contrast to the existing works on smart factory, our work focuses on the integrated solution for smart factory including: dynamic scheduling to adapt to various tasks', machines', and networks' requirements; optimized scheduling for optimal utilization of resources; distributed scheduling for machine networks; machine load balancing; and learning based scheduling which minimizes tasks starvation based on learnings from former decisions.
The rest of the paper is divided as followings. Section 2 presents the related works; section 3 presents the proposed scheduling mechanism. In section 4, we provide the tasks modeling simulation of the proposed system. Results analysis is presented in section 5; section 6 concludes the paper with discussions.

II. RELATED WORKS A. SMART FACTORY AND IoT
Internet of Things (IoT) is one of the key essences of smart factory. IoT can be simply defined as integration of internet into things or objects. The IoT networks consist of embedded devices such as sensors and actuators which are connected to form sensor networks and actuator networks. The integration of IoT into factory enables the smart manufacturing process. Smart manufacturing has real-time data sharing and interaction among the smart devices, machine and objects [5], [6]. IoT elements which are widely used in smart factory include RFID technology, smart tags, sensing technologies, location tracking, real-time actuators' control etc., [7]. Smart factory uses the combination of IoT technologies and industry technologies consisting of sensors, actuators, network connectivity, smart computing, predictive analytics and optimized control [8]. The digital revolution for smart factories started after 1970s and continues till today, with rapid increase in automation and smart control of industry manufacturing by integrating first IT (Information Technology) and now IoT based technologies, models, frameworks and solutions. The complete integration of IoT technologies in factory environment is termed as the fourth industry revolution [9]- [12].

B. SMART FACTORY SCHEDULING
The scheduling in smart factory involves the scheduling of tasks, processes and jobs in smart manufacturing. Also, the scheduling of smart manufacturing resources such as the sensing tasks from installed sensors, the control tasks for the smart machines and robots. The aim of scheduling in a smart factory is to optimize the production in every possible way. Scheduling mechanism is vital for the effective and optimal production of customized products in smart factory. Effective and optimal production is one which balances all involved parameters such as quality, cost, productivity, time and other system resources [13].
The smart factory solution requires a real-time scheduling approach for ordering the tasks and jobs arriving at the machines. The real-time scheduling aims to increase the factory productivity and machine utilization [14], [15]. Real-time smart factory task management is achieved with the flexible event-driven reactions to the periodic/non-periodic happenings at the smart factory.
A mechanism for dynamic scheduling of services is presented for smart factory [16]. The solution of scheduling the services of CPS is based on structure dynamics control. The adaptive scheduling and automated control are considered very crucial to the smart manufacturing based on the CPS production [17], [18].
The machine learning scheduling mechanism is more suitable for real-time systems. The machine learning based mechanism requires building a knowledge base first, by running simulations based on training examples. The building phase of enough knowledge base is a time taking task. Once the knowledge base is built, it helps the simulations to acquire the results in a more robust and efficient manner. The knowledge base aids in making real-time decisions based on smart manufacturing operational constraints and parameters [19].
An optimized and decentralized scheduling mechanism is proposed based on agents such as order agent, product agent and resource agent [20]. The order agent generates process execution knowledge, product agent generates production knowledge, and resource agent generates process knowledge. The agent has three main functions; time budget utility function (TBU), pair compatibility utility function (PCU) and network utility function (NCU). TBU aims to maximize the chance of executing a task before its deadline. PCU aims to enhance the utilization of a machine pair ordered together for jobs execution. NCU aims to maximize the network utilization based on pairs ordering and jobs allocations. The resource agent executes the instances using genetic algorithm for optimization process to ensure the maximization of system goals.
An efficient scheduling scheme is presented, for energy aware load balancing and optimal scheduling in smart factory [21]. An optimal scheduling mechanism based on dynamic model, considering both machine structure and job assignments, is proposed as a solution to mitigate challenges faced by short term supply chain scheduling [22]. A two-priority queuing model is presented for machine load balancing and optimal scheduling of industrial IoT data; where two-priority model consists of high priority requests and low priority requests. The high priority requests are of urgent nature and need to be executed rapidly [23]. Reinforcement learning based optimal scheduling mechanism is proposed for real-time scheduling in smart factory [24]. A smart intra-factory optimized and dynamic scheduling solution is proposed for material supply operations [25]. A multi-agent system architecture based on dynamic and self-learning scheduling is aimed to deal with job shop scheduling problem in smart manufacturing [26]. A cloud based optimized integrated processes planning and distributed scheduling scheme is presented for smart factory [27]. An optimized cross-network fusion and dynamic scheduling solution is proposed for heterogeneous networks in smart factory [28]. A mixed integer programming model is designed to investigate a flow shop scheduling problem in smart factory. The proposed scheduling mechanism includes multi-objective optimization along with self-learning of the machines [29]. Flexible job-shop scheduling includes dynamic and multi-objective scheduling scheme. To accomplish this purpose, a job dispatching algorithm is proposed focusing on machine performance optimization and dynamic scheduling [30].
In table 1, we present comparison analysis and summary of mentioned scheduling related works. We can clearly observe from the table the existing solutions cover different sub topics in an attempt to cater smart scheduling requirements. In our opinion, a smart scheduling solution for smart factory should take into consideration all the factors of machine load balancing, optimizing machine goals, adaptive/dynamic scheduling, distributed scheduling, minimizing number of starving tasks, and learning based scheduling. Hence, in this work, we propose a smart scheduling solution which focuses on all these factors and provide an integrated scheduling mechanism.

III. PROPOSED ACM-FEF SCHEDULING MECHANISM
In this section, we present the hybrid scheduling mechanism of ACM-FEF. The scheduling mechanism is a hybrid of two scheduling schemes, ACM and FEF.
The smart factory is considered to have N machine networks, where machine networks have local and global agents following ACM mechanism. The purpose of ACM mechanism is to allocate the tasks to machine networks with an aim to maintain the maximum machine utilization among the machine networks. The tasks allocated to machine networks are further allocated to the existing machines, where each machine has varying task load with varying priorities. The task load scheduling at each machine level is done by following the FEF scheduling.
The ACM sub-module is inspired by the scheduling mechanism presented in a related study [20]. In smart factory environment, we consider multiple manufacturing machine networks. Each machine network is assigned an agent to manage the task allocation process. The goal of the agent is to allocate tasks to machines in such a way that overall productivity of the manufacturing process is increased. The system has one global agent; the task of the global agent is to maximize the machine utility among all machine networks. Fig. 2 presents the main concept of ACM with N machine networks; each network having a local agent to maximize the machine utilization at its own network and a global agent to maximize the overall system's productivity. The global agent has two main functions; machine pairing and computing utilization. The global agent has complete knowledge of the system such as number of machine networks, number of machines per network, and each machine's current load and capacity. Now, we present the learning to optimization mechanism for scheduling in smart factory. First, we make the smart factory environment assumptions. The list of parameter assumptions for the smart factory environment is given in table 2.  There are N numbers of machines, X number of machine pairs and K number of tasks coming at each machine.
The finish time is computed by adding the execution time to the start time. Time budget is the difference between latest finish time and the finish time.

A. OPTIMIZATION OBJECTIVE FUNCTION
In this subsection, we present the objective function to be optimized for scheduling. The optimization module aims to increase the machines utilization with the help of three functions; TBU, PCU, and NCU [20].
The TBU function aims to maximize the tasks possibility of execution before its deadline. The PCU function makes sure that jobs involved in a task are assigned to machine pairs with maximum utilization. The NCU function looks for the overall networks utilization, making sure that tasks are being assigned to all the machines in a network, in such an order to increase network utilization.
Equations flow below presents the development of the three functions for TBU, PCU and NCU.
where, α, β, and γ are the weights of the functions TBU, PCU, and NCU. The value range for each α, β, and γ is [0.0, 1.0]. The objective function aims to maximize α, β, and γ values to optimize tasks execution, machine utilization and network utilization. The weights of α, β, and γ are adjusted based on current scheduling loads and scenarios at the system. The sum of all three weights is 1. In an ideal scenario where all three factors are mutually increasing, the weights would be equally divided else adjusted to prioritize factors based on given scenarios. The tradeoff scenarios for optimization algorithm can be as following. To adjust weights between number of tasks being executed on time and its relation to machine's total utilization i.e. if machine's free slots are being well utilized or not. In case of increasing rate in high priority tasks execution on a machine; recurring free slots can be still affordable. Whereas in case of machine low utilization with only low priority tasks execution on time; more weightage to increasing machine utilization would be given. In a scenario where a current machine pairing might increase the machine utilization but decrease the overall network utilization; then optimization scheme has to prioritize the solution with minimum overall loss.
The optimization module aims to pair machine combinations for task execution with maximum machine utilization. Extract all possible pairs. Calculate Utilization factor for each extracted pair. Allocate tasks to pair with maximum utilization. The optimization algorithm used is PSO (Particle Swarm Optimization) [31]. Fig. 3 shows the optimized scheduling mechanism based on PSO algorithm. At first the PSO population is defined and initialized. The aim of PSO particles is to find positions where machine utilization weights are at maximum for each machine and overall network. The fitness function is defined as the machine utilization function based on number of machines in a smart factory scenario at a given time. Once the global best values are found, the module returns the maximum machine utilization weights to tune the machine utilizations settings accordingly.

B. FEF SCHEDULING SCHEME IN SMART FACTORY
We present the basics of FEF scheduling algorithm [32]. The FEF scheduling algorithm is designed to maximize the machine resources and minimize the tasks' starvation rate.
The FEF scheduling algorithm considers the input tasks first divided into two main types; event driven tasks and periodic tasks. The event driven tasks are further divided into two subtypes; urgent event driven tasks (UET) and normal event driven tasks (NET). The periodic tasks are further divided into two main types; priority periodic tasks (PPT) and normal periodic tasks (NPT). The event driven tasks are given high priority, as they might be emergency triggered and one-time tasks. The UET are considered to be of high priority, followed by NET, next priority is given to PPT followed by NPT. These priorities are not static, and the proposed algorithm allows flexible options to define and alter task priorities based on the scheduling scenarios.
The primary focus of FEF algorithm is to meet the tasks deadlines based on their priorities; in parallel, saving the starving tasks by rightly utilizing any free resources. The starving tasks can be defined as any tasks which are in waiting state for a long period, due to system priorities, load or unexpected events. The flowchart for FEF algorithm is shown in Fig. 4.
First the scheduler extracts the tasks arriving at the system based on arrival times. If the current task is UET, it is executed right away. If the task is NET, then urgency measure (UM) is checked to see whether the machine slot can be used for any low priority starving tasks or not. If not, then current task is executed else starving task is given the slot. Next, PPT is checked, where failure measure (FM) is checked to see if the PPTs can wait and slot can be allocated to the starving low priority task or not.
UM and FM are two learning modules in the intelligent FEF scheduler. UM is computed to decide whether at the current state the system can allocate the machine resources to a starving task, given that the current event driven task can wait to execute without damage. FM is computed to decide whether at the current state the system can allocate the machine resources to the starving task, if current periodic task can wait to execute without damage. UM and FM are the two learning factors, which make respected decisions using ANN learning algorithm based on history decisions data.

IV. INPUT TASKS MODELING AND SIMULATION FOR SMART FACTORY
In this section we present our data set of smart factory and the simulation setup.

A. CANDY BOX FACTORY
In this section we build a scenario for smart factory modeling. We have assumed a use case scenario of candy box assembling and packaging in a smart factory. We have built the candy box use case scenario based on the candy packaging application case study presented in [33]. To our assumption, the candy smart factory manufactures N types of candies, and makes custom candy combination boxes based on the user orders.
In this use case, we do not consider the manufacturing process of candies. We consider a scenario where the N types of candies have been manufactured and the task now is to get the customized orders from the users, assemble customized candy boxes based on the user orders and forward them to pack the boxes to get ready to be delivered.
In our built scenario we have three sensors, four actuators and eight smart manufacturing machines. The sensors are of two types; ambient sensors and on-machine sensors. The ambient sensors are temperature sensor and humidity sensor. The on-machine sensor is occupancy sensor. The involved sensors in the candy production scenario are shown in table 3. The actuators involved are heater, chiller, humidifier, and dehumidifier.
The execution time for sensing tasks is set to be 20 ms (milliseconds) and the priority is set to be NPTs. The execution time for system tasks is set to be 300 ms and the priority for order placement task is set to be UET and the priority for the inference rule execution task is set to be PPT. The execution times for all the control tasks are set to be 520 ms and the priorities for environmental conditions control actuator (heater, chiller, humidifier, and dehumidifier) are set to be UET. The priorities for control tasks of manufacturing machines (AM1, AM2, AM3, AM4, PM1, PM2, PM3, and PM4) are set based on the priority set at customers' order time and deadline. It can be either NET or UET.
Our first step is dataset collection and dataset generation. Our dataset includes the collected history data for training in learning processes. The history data include tasks' data such as task arrival time, execution time, deadline, finish time, time budget, allocated machine, allocated machines' load, and capacity requirements of the machine. The tasks completion status and machine utilization history data are also collected in order to train the prediction module for future predictions. The history data is collected by simulation iterations of tasks generation and scheduling. In Fig. 5, we present 30 instances of the history tasks' data. In Fig. 6, we present the history data collection sample for tasks completion status and in Fig. 7, we show the history data collection sample for machine utilization rate.
Next, we simulate the temperature and humidity data for the training purposes. The simulated temperature data varies  mostly between the valid temperature ranges with randomly inserted out of range fluctuations so that rule engine can detect and control the anomaly sensing values for the temperature.
Similarly, for the humidity we have followed the same mechanism of simulating the data between the valid ranges with some randomly inserted out of range fluctuations so that rule engine can detect and control the anomaly sensing values for the humidity. In Fig. 8, we present the simulated data sample instances for temperature sensing data and the simulated data sample instances for humidity sensing data.

1) EVENT DRIVEN TASKS SIMULATION FLOW
In this subsection, we present the simulation flow for the event-driven tasks generation in the given scenario of candy box factory (Fig. 9).
The tasks flow is initiated with an event driven task of candy order placement (T-1, Table 1, Fig.9). The order placement task is a system task generated when users' place candy box order. Once the order placement task is triggered, the system generates candy box order response task (T-2, Table 2, Fig. 9). Candy box order response task is also a system task  which has two jobs; assembly candy box and pack candy box (J-1 and J-2, Table 3, Fig.9). Table 4 in Fig. 9, shows the job execution details. Where, J-1 can be executed on any of the four assembly machines AM1, AM2, AM3, and AM4; and J-2 can be executed on any of the packaging machines from PM1, PM2, PM3, and PM4. The machine selection, for executing J-1 in the assembly machine network and executing J-2 in the packaging machine network, will be done based on each machines' current status and load.

2) PERIODIC TASKS SIMULATION FLOW
In this subsection, we present the simulation flow for the periodic tasks' generation in the given scenario of candy box factory.
The periodic tasks flow initiates three sensing tasks; temperature sensing task, humidity sensing task and occupancy sensing task (Table 1, Fig. 10). The sensing task's period defines the set interval, after which sensing data is to be collected from sensors installed in the candy box factory. Next, in response to sensing data values of humidity, temperature and occupancy, inference rule execution task is generated (T-1, Table 2, Fig, 10). Inference rule execution task generates when given data values map to the set thresholds; and controls or alerts are to be triggered in response. In response to inference rule execution task for machine occupancy data, the next task that might get generated is machine idle alert (T-2, Table 2, Fig. 10). The control tasks executed in response to temperature value's inference rule execution task are chiller control and heater control (T-1 and T-2, Table 3, Fig. 10). The control tasks executed in response to humidity value's inference rule execution task are humidifier control and dehumidifier control (T-3 and T-4, Table 3, Fig. 10).

B. SIMULATED TASKS DATASET
In this subsection, we present the input tasks modeling for simulated tasks dataset. The input tasks for simulated tasks' dataset are randomly generated based on user inputs and system thresholds, so as to generate tasks that are to be simulated. The tasks generated have initial parameters such as tasks ID, execution time, and deadline and machine ID.
Next the system computes the tasks parameters such as start time, finish time, and time budget based on initially generated parameters. The list of tasks parameters generated for the tasks are shown in table 4.
At first, the number of tasks to be generated is taken as input from the user. Next the tasks generation interval is  taken as input from the user. The generated tasks are sensing tasks with different sensing intervals such as 5 seconds, 10 seconds, 15 seconds, 20 seconds, 30 seconds, 40 seconds and 60 seconds. For each task, Task ID is generated, Arrival Time is set at which task is scheduled to arrive at system, the Execution Time is randomly generated between a given range, Task Deadline is generated between a given range with threshold of being greater than the time required to execute the task, Machine ID is initialized as zero and later set to the scheduled machine, Start Time is set to the scheduled start time at machine, Finish Time is set to the scheduled finish time at machine.
In the first step for tasks generation, the sensing tasks are generated based on the initial parameters for task id, execution time, and deadline and machine id. In the next step  the tasks parameter values generation function for start times assignment, finish time assignment and time budget assignment are called where these parameters are initialized. Using these parameters, the tasks are ready to run at the scheduler at their scheduled time following scheduling mechanism. In parallel to tasks scheduling at the scheduler, the scheduler keeps maintaining the history logs with tasks detailed parameters and additional parameters of task completion status, total number tasks at each machine with machine id, processing capacity of each machine with machine id, total processing capacity required by each machine based on current load.

C. MACHINE CLUSTER TASKS DATASET
In this section, we have used google cloud task scheduling dataset [34] for the simulations and performance evaluations of our system. The dataset compromises of 500 sets of tasks instances executed at multiple machines. The data size is given in table 5.
The dataset has two main data; Machine Data and Tasks  Data (table 6).
Machine Data has two main data tables such as machine events table and machine attributes table. The machine events  table contains timestamp, machine ID, event type, platform ID, machine processing capacity and machine memory capacity. Machine attributes table contains timestamp, machine ID, and attribute name, value and deletion status.
The tasks data has tasks events table, tasks constraints table  and jobs events table. The jobs events table contains time stamp, missing information, job ID, event type, user name, scheduling class and job name. The tasks event table contains timestamp, missing information, job ID, task index for job, machine ID, event type, scheduling class, priority, resources for CPU, RAM and memory, and machine constraints. The tasks constraints table contains timestamp job ID, task index, attribute name and value.

V. IMPLEMENTATION ENVIRONMENT AND SIMULATION VISUALIZATION
We have used python for implementing the core programming logic of the task scheduling algorithms. Python is widely used for developing desktop based and web based applications. In order to develop our inference engine, we have used Drools libraries. It provides a core Business Rules Engine (BRE). The development environment for the system is shown in table 7 below and in the simulation and testing phase.

VI. PERFORMANCE ANALYSIS
In this section, we present the simulation and performance analysis. In the comparisons section, we analyze the previously published intelligent FEF (referred as learned predictive FEF scheduling) scheme with the proposed hybrid of ACM-FEF (referred as learned predictive hybrid scheduling) scheme.
The goal of optimal settings of parameters of time budget, machine pair compatibility and the machine network compatibility is to increase machine utilization by increasing the tasks' response time and decreasing the tasks' missing rate and tasks' starvation rate in the smart factory. Hence, we have selected tasks' response time, tasks' missing rate and tasks' starvation rate as our performance metrics for smart factory scheduling.
The results for each scheme include the processing time for the optimization process (PSO) and reaching the optimal values.

A. SIMULATIONS AND PERFORMANCE ANALYSIS OF CANDY FACTORY
In Fig. 11, we present the comparisons among FEF scheduling and hybrid scheduling. The graph shows the tasks average response times at y-axis and test iterations at x-axis. The hybrid scheduling mechanism is the combination of ACM and FEF scheduling approach. The hybrid mechanism improves the overall task allocation to machine pairs and hence also improves the response time as seen in the results. The average response time for tasks set using FEF scheduling is 1954.13 milliseconds and the average response time for tasks set using hybrid scheduling is 1769.69 milliseconds. Fig. 12 shows the comparisons analysis for average response time taken for learned FEF scheduling and hybrid scheduling.  We can observe from the comparisons that with the change in scheduling algorithm from FEF to hybrid approach, the performance gets better and noticeable decrease is observed in the response time. The average response time for tasks set using FEF scheduling is 820.34 milliseconds and using hybrid scheduling is 797.59 milliseconds. Fig. 13 shows the average instances missed rate for the FEF scheduling and hybrid scheduling. The average instances missing rate for tasks set using FEF scheduling is 19% and using hybrid scheduling is 10%. In the results shown, we can observe that the least number of tasks missing rate is at hybrid scheduling, as it includes the learning modules and has the maximum machine utilization rate. Fig. 14 shows the average tasks starvation rate for the FEF scheduling and hybrid. The average instances starvation rate for tasks set using FEF scheduling is 11% and using hybrid scheduling is 6%. In the results shown, we can observe that the least number of tasks starvation rate is at hybrid scheduling, as it includes the learning modules and has the maximum machine utilization rate.

C. SIMULATIONS AND PERFORMANCE ANALYSIS OF MACHINE CLUSTER TASKS DATASET
In Fig. 15, we present the comparisons learned predictive hybrid scheduling and learned predictive FEF scheduling.
The x-axis shows the average response time of machine for tasks and y-axis shows the test iterations. The results reflect the difference in mechanisms based on replacing the FEF scheduling algorithm with the hybrid ACM-FEF scheduling algorithm. We can clearly observe that hybrid approach brings an improvement in the performance by reducing the response time. The average response time for tasks set using learned predictive FEF scheduling is 1416.99 milliseconds while using learned predictive hybrid scheduling is 1310.85 milliseconds.

VII. CONCLUSION
Efficient real-time tasks scheduling based on analytics and optimized techniques is vital for smart factory systems. In this work, we have proposed an integrated solution for efficient task management, in smart factory, based on a hybrid scheduling scheme. The proposal provides integrated task management solution based on predictive learning and optimization techniques. The scheduling algorithm used for the efficient task management is hybrid of the two scheduling approaches; ACM and FEF scheduling scheme. ACM is a decentralized scheduling approach which focuses on the production maximization goals per machine and also centers the production goals of all the machine networks involved in the smart factory. FEF scheduling scheme focuses on minimizing the tasks starvation rate and maximizing the machine utilization by efficiently using the machine slots. In FEF scheduling scheme, two learning based factors are used to improve the scheduling performance; UM (Urgency Measure) and FM (Failure Measure). The hybrid proposal of ACM-FEF results in timely predictions from history decisions, efficient machine pairing for task execution, and wise allocation of free machine slots. The aim is to increase machine utilization without risking timely execution of any high priority task.
The proposed task scheduling mechanism is evaluated based on multiple scenario simulations and performance analysis. We use three task modeling scenarios as candy box factory tasks dataset; user input based simulated tasks dataset and machine cluster tasks dataset. The performances analysis metrics considered are tasks instances missing rate, tasks starvation rate, machine utilization rate and machine response time. The comparison analysis shows that proposed task scheduling scheme, referred also as and learned predictive hybrid scheduling scheme in the results analysis, significantly improves the machine utilization rate and drastically drops the tasks instances missing rate and tasks starvation rate. Hence, we can conclude that proposed hybrid approach enhances the optimization results and also increase the machine utilization and scheduling results.