Scheduling in Real-Time Systems Using Hybrid Bees Strategy

. In the last decade, stochastic and meta-heuristic algorithms have been extensively used as intelligent strategies to resolve different combinatorial optimization problems. Honey Bee Mating Optimization is one of these most recent algorithms, which simulate the mating process of the queen of the hive. The scheduling algorithm is of paramount importance in a real-time system to ensure desired and predictable behavior of the system. Within computer science real-time systems are an important while often less known branch. Real-time systems are used in so many ways today that most of us use them more than PCs, yet we do not know or think about it when we use the devices in which they reside. Finding feasible schedules for tasks running in hard, real-time computing systems is generally NP-hard. In this work, we are interested in hybridizing this HBMO algorithm with other metaheuristics: Genetic Algorithms (GA), Greedy Random Adaptive Search Procedure (GRASP), Tabu Search (TS) and Simulated Annealing (SA) to resolve a real-time scheduling problem and obtain the optimal tasks schedule with respecting all temporal contraints. This is a complex problem which is currently the object of research and applications. In this scheduling problem, each task is characterized by temporal, preemptive and static periodicity constraints. The quality of the proposed procedure is tested on a set of instances and yields solutions which remain among the best.


Introduction
Finding feasible schedules for tasks running in hard, real-time computing systems is generally NP-hard [1].A vast amount of work has been done in the area of real-time scheduling by both operations research and computer science communities.The proposed approach is based on an optimization algorithm inspired from the Honey Bees Mating Optimization (HBMO).It combines an HBMO algorithm, Genetic Algorithms (GA), Simulated Annealing (SA), Tabu Search (TS) and the Greedy Randomized Adaptive Search Procedure (GRASP).The scheduling algorithms can be rated based on different parameters like makespan, flowtime, communication cost, reliability cost, and makespan [2].The task duplication scheduling scheme has been utilized to minimize the processor idle time and lessen the mean task response time in [3].In this paper, we aim to obtain a schedule called feasible if both of the following conditions are met 1) No precedence constraints are violated and 2) all temporal constraints are satisfied.In order to realize this goal, we have used a new approach based on the hybridization of several algorithms.Our strategy uses the HBMO as a base algorithm which combines a number of different procedures.Each of them corresponds to a different phase of the mating process of the honey bees.In the next section, we see also that the honey bee mating algorithm has never been applied to resolve real-time tasks scheduling problems.This prompted us to use this strategy and hybridizing it with other metaheuristics in order to see its performance to resolve this kind of problem.Our contribution consists in combining the global search represented by HBMO with some local search metaheuristics for the resolution of realtime task scheduling problems in order to intensify the search in promising zones detected by the HBMO exploration process.This hybridization is realized with methods which have been applied in isolation in the resolution of real-time task scheduling problems: GA, TS, SA and GRASP [4,5] First, we have to select the population of honey bees that will make up the initial hive.In the proposed approach, this population is created by using GA alone, or GRASP alone, or random selection selected.Then a percentage is selected from these three populations using a hybridization of these processes.The best member of each initial population obtained is selected as the queen of the hive.All the other members of each population are the drones.The two local search strategies SA and TS are used as workers for improving the broods.The paper is organized in the following way.The related works are presented in the second section.The presentation and formulation of real-time tasks scheduling problems is described in Section 3. Section 4 presents the proposed Scheduling Approach.The resolution process of the scheduling real-time tasks problem is detailed in Section 5.The sixth section presents the simulation and experimental results arrived at.The paper finishes with the conclusion and recommendations for future research.

Related works
The task scheduling problem is defined as one of the many popular academic NPhard problems.In [6], different aspects in scheduling and issues in various levels of real time systems are discribted.The use of metaheuristic methods shows their efficiency and effectiveness to solve these categories of complex problems [7].In the literature, many metaheuristics have been proposed based on methods and approaches to task scheduling..In [8], E. G. Talbi et al. have hybridized Simulated Annealing (SA) with Genetic Algorithms (GA).The authors in [9] resolve the scheduling task problem through hybridization of Particle Swarm Optimization (PSO) with GA.
The comparison between various scheduling algorithms and simulations results is given in [10].An scheduling algorithm has multiobjective to minimize the total tardness and total number of processors is used in [11].The authors combine Adaptive Weight Approach with genetic algorithm and simulated annealing method.In order to explore the computing power of quantum computation, an approach based on the hybrid Quantum genetic algorithm is used to resolve the real-time scheduling problem in multiprocessor environment In [12].In [13], the authors applied Bee Colony Optimization (BCO) as a heuristic algorithm to solve the problem of static scheduling of independent tasks on identical machines.This strategy is based on the intelligent behavior of honey bees in the foraging process.Koudil et al. adapted the MBO algorithm to solve integrated partitioning/scheduling problems in co-design in [14].This algorithm gives good results in terms of solution quality and execution time.The Fuzzy logic is also used to solve the real time tasks scheduling problem.In [15] , the autors propose a model witch in the input stage consists of three lin-guistic variables i.e.CPU time, deadline and communication overhead.

Partitioning and scheduling
A real-time application is normally composed of multiple tasks with different levels of criticality : Missing deadlines is not desirable.In this context, three categories of realtime applications are defined [2,16]:  Soft real-time applications : The system could still work correctly Although the tasks could miss some deadlines.However, missing some deadlines for soft realtime tasks will lead to paying penalties. Hard real-time applications : The tasks can not miss any deadline, otherwise, undesirable or fatal results will be produced in the system. Firm real-time applications : The tasks, which are such that the sooner they finish their computations before their deadlines, the more rewards they gain.
In this paper, a real-time task   graph is defined by a set of temporal constraints such as { (   ), (   ), 1(   ), (   ) } as well as preemption and static periodicity constraints.The table 1 reports the temporal contraints or parameters description of real-time system to study.
Table 1 Description of the real-time tasks adopted Temporal parameters

𝑠𝑡(𝑡𝑖𝑗 ) )
Start time Time at which a j ieme task of i eme graph starts its execution () Computing time Time necessary for completion of a j eme task of i eme graph i instance () ) Completion time Time at which a j ieme task of i eme graph instance finishes its execution () Deadline time Time by which execution of the j ieme task of i eme graph instance should be completed, after the task is released.τij the period of   The periodic behavior of task, the study be restricted to the.hyperperiod H which is the least common multiple of the periods.
The task model real-time system is usually described by a set of task graphs.The related concepts are defined as follows : System: A real-time system is modeled as a set G = {Gi, i = 1, . .g} of periodic task graph.
Task : A task  is a node of task graph and defined by    denote the processor implementation ( instance of task).The problem consists of three parts : Part 1 : Partitioning P ,which determines the assignement of each task to p u , u ∈ {1, … .p} , processors : Part 2 : Scheduling on processors SC1 u , which associates each task instance assigned on processors {1, … .p} a start time st.
u ∈ {1, … .p} Scheduling in real-time systems requires that the order of execution be stipulated.A schedule is called feasible if both of the following conditions are met : 1) All precedence constraints are respected and 2) All timing constraints are satisfied such as the deadline defined by (   ).
which means the task must be finished before the deadline, otherwise the system will fail.In the multiprocessor system The task scheduling is a mapping process of all tasks to p processors.The goal of the scheduler is to schedule the system's tasks on these p processors, so that every task is completed before the expiration of the deadline (   ).
Here we use the similar cost function as [17].The cost function formulated by equation ( 4) serves to calculate the tardiness scheduling of the real time system.
The Real-time tasks complete their computing time before their deadlines as early as possible.Differents comportments are showed in Figure 1.

Hybrid HBMO for real time scheduling resolution problem
The HBMO algorithm was proposed by Abbass in [17].Since then it has been used on a number of different applications [18][19] [20][21] [22].HBMO was found to outperform some better known algorithms.However, it has not been applied to realtime scheduling problems.A honey-bee colony consists of the queen(s), drones, worker(s) and broods.The Honey-bee Mating Optimization algorithm mimics the natural mating behavior of the queen bee when she leaves the hive to mate with drones in the air.After each mating, the genetic pool of the queen is enhanced by adding sperm to her spermatheca.Before the mating flight begins, the queen is initialized with a certain amount of energy and only ends her mating flight when the energy level drops below a threshold level (which is close to zero) or when her spermatheca is full.The probability of a drone mating with a queen obeys the following annealing function: where (f) is the absolute difference between the fitness of D and the fitness of the queen and Speed(t) is the speed of the queen at a given time t.After each flight, the queen's speed and energy evolve according to the following equations: where factor   (0,1) is the amount of speed and energy reduction after each flight.
The workers are presented as heuristics whose functionality is to improve the broods produced during the mating process.
To diversify the initial HBMO population and select the best solution as the queen, Genetic Algorithms (GA) and GRASP method are used.The former, GA, works very well on mixed (continuous and discrete) combinatorial problems.Genetic Algorithms create a population of solutions and apply genetic operators such as mutation and crossover to improve the solutions in order to find the best one(s) [24].The latter, GRASP, is a multi-start or iterative process, in which each GRASP iteration consists of two phases, a construction phase, in which a feasible solution is produced, and a local search phase, in which a local optimum in the neighborhood of the constructed solution is sought.GRASP has proved its efficiency in research and computer science applications as well as in industrial applications.
To improve the broods produced during the queen's mating, we use two workers based on local search metaheuristics: Tabu Search (TS) and Simulated Annealing (SA).

PRESENTATION OF THE RESOLUTION PROCESS
In this section, we present the approach adapted to resolve the issues addressed.
To start with, a set of parameters must be defined:  The bee population represents the set of scheduling plans of real-time tasks with temporal constraints,  The queen represents the tasks best scheduling plan in the population generated by GA, by GRASP, randomly or hybridization of a percentage from each of the three populations obtained using the three aforementioned procedures and gradually improved by the implementation of the neighborhood generations iterative procedures (crossover in the HBMO) and two workers SA and TS.


The drones make up the remaining task scheduling plans Algorithm 2 describes The HBMO approach for scheduling Algorithm 2. Hybrid HBMO scheduling approach 1. Initialization 2. Generate the initial population of the bees using separately GA, GRASP, Random or through Hybridization of percentages selected from these procedure; A summary of differences and similarities between the HBMO approach applied for the resolution of the real time scheduling problem and the original algorithm are showed in table 1.This part is devoted to the implementation and testing of the algorithmic methods developed above.In order to assess the effectiveness of the approaches under study, we constructed a testbench consisting three task systems, which are randomly generated.The systems were composed of 40, 60 and 80 task graphs.Each task graph had its own temporal characteristics.The parameters of the algorithm have been selected after thorough testing.A number of different values were tested and the ones selected are those that yielded the best results in both solution quality and computational time.The best values for these parameters appear in the table 2 and table 3.In the first time, we generate the initial population of the proposed algorithm randomly and with GA.After 10 runs , The figure 2 illustrate the graphic results obtained through the application of HBMO, GA and GRASP approaches.The best real-time task scheduling approach is to be selected taking into consideration the Cost function criteria.The graphics results show that the HBMO approach converge to the optimal results comparing with the GA and GRASP methods.

Fig. 2. Graphic results obtained through different hybridization processes example of 60 tasks
In order to ameliorate scheduling real-time problem results obtained through the application of basic HBMO (HBMO_ Random) , we have hybridized the HBMO algorithm with other metaheuristics: Genetic algorithms GA, GRASP and hybridization (three sub-populations made up of one percentage from random, one percentage from AG, one percentage from GRASP) in the stage of initial population generation.The figure 3 presents all graphic results obtained through different hybridization processes.The graphics results show that the results given by HBMOhybridization approach were best than the results given by the HBMO with GA and HBMO with GRASP algorithms.We notice also that the results given by the HBMO-GRASP and HBMO-hybridization were nearly the same.(in the iterations number 34, 24, 16 and 9) the values obtained by HBMO_ hybridization and the HBMO_GRASP are the same ).

CONCLUSION
In this paper, an approach is proposed to solve real-time task scheduling problems.This approach is based on the hybridization of several algorithms inspired from nature such as Genetic, HBMO, Tabu Search and Simulated Annealing and GRASP algorithms.In the stage of generating initial solutions, the adopted approach uses Genetic Algorithms alone, random selection alone, GRASP alone, and hybridization of the three processes selecting a percentage of the population from each.In the stage of solution improvement by the workers, HBMO uses Tabu Search and Simulated Annealing algorithms.The proposed approach was tested on three real-time task scheduling instances with 40 tasks, 60 tasks and 80 tasks where each task has its own temporal constraints.The gain coefficient from the optimal solution is used as the standard to evaluate the quality of the solutions obtained.Results confirm the positive impact of using a hybrid strategy with regard to function objective quality and computing time in comparison with the hybridization algorithms object of this paper.The results arrived at show that for real-time scheduling problems (with a number of tasks 80), the best approach is HBMO-Hybridization.In the future works, we will focus our searches to resolve the problem of minimizing the energy consumption in the realtime embedded systems by using the proposed algorithms.

Fig. 1 .
Fig. 1.Comportments of the real time instances of the task

Table 2 .Table 3 .
Parameters and their values for the HBMO approach adopted Parameters and their values for the used approaches
Part 3 : Scheduling on interconnexion system ℎ_2  , Which associates each interprocessors communication a start time st.The communication defined by   is a directed edge, which means task   precedes   .Each communication is associated with a data transmission time on a specific communication channel.It is commonly assumed, in multiprocessor systems research, that communication between tasks assign to the same processor is effectively instantaneous, compared with inter processors communication.

Table 1 .
Differences and similarities between our HBMO-real time scheduling and the original HBMO