Industry 4.0-Based Real-Time Scheduling and Dispatching in Lean Manufacturing Systems

: Lean manufacturing is one of the most popular improvement agents in the pursuit of perfection. However, in today’s complex and dynamic manufacturing environments, lean tools are facing an inevitable death. Industry 4.0 can be integrated with lean tools to avoid their end. Therefore, the primary purpose of this paper is to introduce an Industry 4.0-based lean framework called dynamic value stream mapping (DVSM) to digitalize lean manufacturing through the integration of lean tools and Industry 4.0 technologies. DVSM with its powerful features is proposed to be the smart IT platform that can sustain lean tools and keep them alive and e ﬀ ective. This paper speciﬁcally tackles the scheduling and dispatching in today’s lean manufacturing environments, where the aim of this research is developing a smart lean-based production scheduling and dispatching model to achieve the lean target through optimizing the ﬂow along the VSM and minimizing the manufacturing lead time. The developed model, called the real-time scheduling and dispatching module (RT-SDM), runs on DVSM. The RT-SDM is represented through a mathematical model using mixed integer programming. Part of the testing and veriﬁcation process, a simpliﬁed IT-based software, has been developed and applied on a smart factory lab.


Introduction
Lean manufacturing can be considered one of the most significant contributions in the history of operations management [1,2]. However, since its inception, most of the developments in traditional lean manufacturing tools are almost done independently from using information technology [3]. It was described in [4] that the major time of semi-finished products through the value stream is wasted through waiting for processing. One of the causes behind this problem is the way of scheduling and prioritizing them. This will significantly increase the manufacturing lead time (MLT) [4].
Therefore, scheduling and dispatching strategies are considered the main pillars of lean manufacturing to enhance the pull system and thus minimize the MLT, which plays a critical role in achieving lean targets [5]. In this regard, several research papers have tried to improve scheduling and dispatching levels to tackle the recent and rapid changes in the global markets. However, most of the developed scheduling models are buried in mathematical treatments with unrealistic assumptions [6]. This make them inappropriate and impracticable in production shop floor (PSF).
Despite the significant advancements in Industry 4.0 and real-time data capturing systems like RFID, a few studies [23][24][25] have investigated the possibility of using RFID to improve production scheduling and dispatching levels. For instance, [26] investigated an integrated production scheduling system with intelligent machines, where real-time information for self-optimization, self-training behaviors, and self-assigning can be captured. As a result, a machine-learning algorithm was developed as a monitoring tool for an Industry 4.0 manufacturing system. In this field, a real-time scheduling model in IoT based manufacturing environment was developed by [27]. The proposed real-time scheduling model optimally assigns tasks to machines according to their real-time status. A CPS in production controlling was addressed by [28], who introduced a CPS and big-data machining optimization system, in which the mechanism includes different production controlling aspects, such as scheduling, rescheduling, monitoring, and learning during the production run. Technically, a real-time early warning and anomalous signs detection system for production systems was developed by [29,30]. Such systems help to detect the incidences in advance and try to avoid them. The results of [29] were promising, where the prediction accuracy was near 100%.
It is obvious that none of these studies tackled scheduling and dispatching problems from lean perspectives in a dynamic manufacturing environment.
The significant contribution of this research paper is developing a smart lean-based scheduling and dispatching model in lean manufacturing. It aims to develop an Industry 4.0-based lean framework to digitalize lean manufacturing through the integration between lean tools and Industry 4.0 technologies. The research presented in this paper is organized as follows. In Section 2, the lean-based Industry 4.0 system (DVSM) is discussed. Section 3 provides an overview of the real-time scheduling and dispatching model. Next, the real-time dispatching priority generator model developed in this research is presented in Section 4. Section 5 discusses the main findings of the study. Finally, in Section 6, conclusions and opportunities for future research are presented.

Lean-Based Industry 4.0 System-DVSM
In today's high dynamic manufacturing system, lean tools will die without continuous care, since lean was originally designed for stable manufacturing environments. Typically, value stream mapping (VSM) is considered the best lean practice to achieve lean in different manufacturing companies. However, based on much of the literature, [4] listed 14 weakness points in the conventional VSM that make it incapable of achieving and sustaining lean strategies in today's dynamic manufacturing environments. For example, some of these weakness points are highlighted: firstly, the static features and the offline mode of the VSM make it hard to see or map the flow in real-time and capture the dynamic aspects of the manufacturing system; secondly, VSM is unable to track the actual process parameters and the performance measures of the manufacturing system; thirdly, VSM is unable to track and present the current status of the used resources as well as the work in process (WIP) inventory level in front of each process; fourthly, VSM lacks the "what-if" analysis required to optimize the production processes; finally, VSM is unable to map multiple products' flow and analyze the movement of products using shared process resources. VSM is just a snapshot from PSF and cannot dynamically interact with the current situation on the PSF in real-time. This cannot help lean practitioners in sustaining lean tools and save them from an inevitable death or obsolescence in the long-term [4,14]. In order to overcome the drawbacks of VSM in today's manufacturing environment and keep lean systems effective in the long-term, [4] introduced the idea of a dynamic and real-time VSM which is built upon the main concepts of conventional VSM, where the time-based flow is greatly emphasized and considered the most critical success factor of lean. It is called Dynamic Value Stream Mapping (DVSM). DVSM can be defined as "a digitalized event-driven lean-based IT system that runs in real-time according to lean principles that cover all manufacturing aspects through a diversity of powerful practices and tools that are mutually supportive and synergize well together to effectively reduce wastes and maximize value" [4]. Accordingly, DVSM represents a smart, comprehensive, and integrated real-time monitoring and controlling lean-based IT mechanism for the next generation of manufacturing Sustainability 2020, 12, 2272 4 of 18 systems or smart factories with dynamic and intelligent aspects concerning lean targets [4]. It can be expressed as "built-in lean Industry 4.0" or Lean 4.0 [31].
The structure of the DVSM is shown in Figure 1, it contains different real-time engines. For instance, the Actual Value Stream Mapping (AVSM) engine represents the current status on the physical world and it is considered the DVSM interface with the PSF. AVSM translates the production activities applied on products into flow in terms of time and location (i.e., VSM-format). The Virtual Value Stream Mapping (VVSM) engine represents the virtual world and it is considered the DVSM interface with the highest enterprise levels. VVSM translates the standard/planned lean-based production data that are developed in the enterprise level into the context of event-instances (i.e., VSM-format). This happens before releasing the products for production; each product should have a VVSM that represents its standard/planned lean-based data.
activities applied on products into flow in terms of time and location (i.e., VSM-format). The Virtual Value Stream Mapping (VVSM) engine represents the virtual world and it is considered the DVSM interface with the highest enterprise levels. VVSM translates the standard/planned lean-based production data that are developed in the enterprise level into the context of event-instances (i.e., VSM-format). This happens before releasing the products for production; each product should have a VVSM that represents its standard/planned lean-based data.
To convert lean tools to become smart, firstly, lean specialists build real-time data-based algorithms or a mathematical model for each lean tool. As explained in next section, the Real-time Dynamic Scheduling Generator (RT-DSG) is constructed mathematically using mixed-integer programming, while in the Real-time Dispatching Priority Generator (RT-DPG) an algorithm is used. Thereafter, lean specialists use the Real-time Rules (RT-RE) engine to translate these algorithms or mathematical models into smart lean tool rules, which are called Real-Time Lean Control Rules (RT-LCRs). To run them online, the constructed RT-LCRs will be uploaded into the Lean Practices and Tools (LPTE) engine, which is considered the heart of DVSM. LPTE runs in real-time on DVSM and continuously invokes the required real-time data from both AVSM and VVSM in order to supply different RT-LCRs with real-time data to sustain the overall lean system. According to [32][33][34], cloud computing as one of Industry 4.0 technology enablers can significantly contribute to the realization of DVSM.

Real-time Scheduling and Dispatching Model (RT-SDM)
This section introduces the RT-SDM to deal with the dynamic nature of job shops. The RT-SDM is divided into two sub-modules to run on DVSM-LPTE; the first is the Real-time Dynamic Scheduling Generator (RT-DSG) sub-module that generates the initial schedule at the global-VVSM level, the second is called the Real-time Dispatching Priority Generator (RT-DPG) sub-module, which reprioritizes the products that are waiting in supermarkets or queues. Both RT-DSG and RT-DPG work in parallel in order to generate the most optimal real-time re/actions.
RT-DSG consists of planning and scheduling levels, the objective functions and constraints of the constructed planning and scheduling level are built in RT-DSG, which runs online in DVSM-LPTE, which should minimize the idle time and thus total MLT, while maximizing the utilization of the available resources. The RT-DSG is equipped with RT-LCRs, which firstly are mathematically To convert lean tools to become smart, firstly, lean specialists build real-time data-based algorithms or a mathematical model for each lean tool. As explained in next section, the Real-time Dynamic Scheduling Generator (RT-DSG) is constructed mathematically using mixed-integer programming, while in the Real-time Dispatching Priority Generator (RT-DPG) an algorithm is used. Thereafter, lean specialists use the Real-time Rules (RT-RE) engine to translate these algorithms or mathematical models into smart lean tool rules, which are called Real-Time Lean Control Rules (RT-LCRs). To run them online, the constructed RT-LCRs will be uploaded into the Lean Practices and Tools (LPTE) engine, which is considered the heart of DVSM. LPTE runs in real-time on DVSM and continuously invokes the required real-time data from both AVSM and VVSM in order to supply different RT-LCRs with real-time data to sustain the overall lean system. According to [32][33][34], cloud computing as one of Industry 4.0 technology enablers can significantly contribute to the realization of DVSM.

Real-Time Scheduling and Dispatching Model (RT-SDM)
This section introduces the RT-SDM to deal with the dynamic nature of job shops. The RT-SDM is divided into two sub-modules to run on DVSM-LPTE; the first is the Real-time Dynamic Scheduling Generator (RT-DSG) sub-module that generates the initial schedule at the global-VVSM level, the second is called the Real-time Dispatching Priority Generator (RT-DPG) sub-module, which re-prioritizes the Sustainability 2020, 12, 2272 5 of 18 products that are waiting in supermarkets or queues. Both RT-DSG and RT-DPG work in parallel in order to generate the most optimal real-time re/actions.
RT-DSG consists of planning and scheduling levels, the objective functions and constraints of the constructed planning and scheduling level are built in RT-DSG, which runs online in DVSM-LPTE, which should minimize the idle time and thus total MLT, while maximizing the utilization of the available resources. The RT-DSG is equipped with RT-LCRs, which firstly are mathematically constructed and then expressed in complex event processing (CEP) format. The following section introduces the real-time mathematical model of the RT-DSG.

Mathematical Model of RT-DSG
The below proposed mathematical model for the complete planning and scheduling operation in a real-time job shop floor was constructed on the basis of mixed-integer programming. The following optimization model formulation of the flexible job shop problem adopted the modeling approach for efficient results of the problem, which are subjected to their considered objective function. Since all the available real-time constraints and processes cannot be implemented in such models, some assumptions are considered on a certain real-time basis (see Table 1). Table 1. Mathematical model assumptions.

1
Flexible job shop problem consists of a set of n independent jobs I = i n , where n ∈ set on integers. 2 Each job has its own processing order through a set of M machines.

3
The operators, machines, tools, and jobs and other production-related objects are equipped with RFID-tags to become a smart object and trackable in real-time, where workstations, routs, machine areas, floor, gates, etc., are equipped with RFID readers to collect real-time production data.

4
Each operation is processed according to DVSM commands to obtain jobs from a real-time production order pool, which is responsible for prioritizing and sequencing the jobs at each workstation under each machine and continued to the next operations. 5 The number and order of processes must be performed to complete job i are defined in VVSMi  6 An operation cannot be taken up for processing until its previous operations are completed.

7
The production horizon is divided into multiple time periods under time horizon T. Normally, the time unit of T is one working day (eight-unit hours of working). Therefore, the order time and due date DD are scaled in unit of working hours multiplied by the number of working days.

8
In order to capture the event-instances and data generated in real-time (measured in seconds or milliseconds) during a daily production operation run, the time horizon is further divided into multiple minor periods, which is t. Therefore, in AVSM the processing time, start time, and setup time are scaled by unit hours or minutes.

9
AM i is a set of alternate machines which can process job i, AM i ⊆ M for a given processing time under the machines that suit the specified processing mechanism.

10
In each stage g, the WIPs are stored in a buffer B g . The real-time data of the new arriving jobs and the old jobs which are available in the buffer can be obtained from AVSM.

11
The RT-DSG releases jobs to a specific machine and its labors according to sequencing and dispatching rules that have been selected by the RT-DPG with respect to AVSM data. 12 These sequencing and dispatching rules are assigned with respect to the weighted priority ω.

13
At every stage, the sequencing and the dispatching of the jobs and production orders must be accomplished on a check time of every (Trs = time of rescheduling) minutes to follow a real-time pull dispatching strategy.

Formulation
The formulation of mathematical optimization models in planning and scheduling levels is described, starting with defining the indices and sets.

Indices and Sets
The indices and sets are defined where the source of real-time information, either from VVSM or AVSM, is written in front of each (see Table 2).

Indices and Sets Description
i The total set of jobs (G-VVSM), where G = global VVSM, which represents the entire value stream for all products) k The total set of machines (G-VVSM) G Total number of stages (AVSM) g Set of individual stages (g ∈ G) (AVSM) PO Set of total production orders (VVSM) M g Total set of machines in stage g (G-VVSM) AM i The set of alternative machines on which job i can be processed Demand of job i that cannot be produced on time in day t c (AVSM) The cumulative workload of production order at stage g AL PO Average workload of production order Maximum completion time of all jobs (make span) (VVSM)

Production Planning Level
In the production planning level, the jobs are planned according to the following criteria: 1.
Grouping the jobs in production orders with respect to the weighted priority of the jobs; 2.
Choosing jobs with the minimum number of tool changeovers and total tool changeover time; and 3.
Obtaining an optimal start time for each job with the bounded release date and due date.
These three criteria are considered in the planning stage, to optimally plan all the jobs into the respective production order, PO. Here, mainly the number of tool changeovers and the tool changeover time are considered, because different jobs must be processed in different machines according to their material and may need different tools and thus different tool change times. Also, an optimal start time for each job is determined from the objective function, considering the release date and due date as a bound. Hence, in this planning stage, grouping of jobs into the production orders according to the three considered criteria are analyzed and variables are constructed mathematically.
Objective function: Constraints: The above formulated constraints work with the constructed objective function together to obtain an optimal production plan. The above equations are explained as follows: Equation (1) considers minimizing the total tool changeover time and an optimal start time; with these both attributes, possibly an effective planning level can be achieved. Equation (2) ensures that the start time of each job should lie between the release date and the due date. Equation For the effective functioning of the objective, certain relationships have been constructed mathematically to follow a smooth planning stage, as follows: Equation (7) ensures the sequence of weighted priority of each job according to the tool change over time. Equation (8) ensures that the weighted priority is assigned between 1 and 5, and Equation (9) maintains the precedence relationship of the jobs.
In the above constructed planning level, the considered weighted priority ω i is estimated in accordance with the following relationship: ∀ i ∈ I, in real time job pool, i f n CT ↑, then ω i ↓ .
Equation (10) allocates the value of ω i . If there is a greater number of tool changeovers, then the value of ω i is set as low, thereby ω i has the highest weighted priority.

Production Scheduling Level
In the production scheduling level, each job contained in the set of each production orders must be sequenced in a real-time job pool. This scheduling stage problem can be considered as parallel machine scheduling with maximizing the utilization of the stages. Since each stage is dependent on one another, there will be an influence on time if there are any discrepancies on any of the dependent stages.
Here, scheduling level is carried out with constraints such as balancing the workload in each stage considering the time horizon T and available working load at each stage. Flowingly, to make sure the effective allocation of production order at each stage is allocated, including the buffer status.
The basic objective of workload balancing is to achieve effective utilization of production capacities. The concept of balancing is to evenly distribute the production orders among the stages. It also may be considered as evenly distributing jobs among the contained machines. The workflow in each stage is calculated before assigning the production orders. Workload balancing aims at providing equal distribution of load on parallel machines and helps to reduce the total elapsed time of production orders. The aim of the scheduling process is to increase the utilization of stages, thereby increasing the utilization of each machine at each stage.
The parallel machine scheduling problem consists of a set of k machines k ∈ M at stage g, ∀g ∈ G and a set of production orders PO containing i jobs ∀i ∈ I. Each PO requires processing time P PO , for it to be processed on any one of the stages. When a stage becomes available, a production order from the list of unscheduled POs with the highest priority based on ω PO is selected and assigned to the stage for processing.
This scheduling level focuses on the measure of workload balancing among the stages. Instead of assigning a production order to any first available stage, the stages with less cumulative workload are selected for a production order from the unscheduled list of production orders. The cumulative workload of a stage is equal to the sum of all processing times of jobs, which is contained in the production order which is assigned to that stage. The cumulative workload of all stages is compared and the stage with the minimum cumulative workload is selected for assigning the next production order from the list of production orders arriving from the planning stage. The difference between the squares of the cumulative workload of production order at the stages and the average workload of the production order with respect to total number of stages is called an imbalance in workload. Imbalances IM g at each stage are expressed as follows: In our real-time scheduling model, the workload balancing strategies are adopted to minimize these imbalances on the stages. Uniformly distributed workloads on all the stages is the best schedule. Therefore, the objective function is constructed to minimize the imbalances in each stage, thereby allocating the production order to the stage which has minimum imbalance.
The objective function is a least-squares estimation function and therefore it can be converted into a linear objective function by using the least absolute deviation estimation technique, which minimizes the sum of absolute errors. Hence, the objective function takes the following form: Objective function: subjected to: CL PO g = P i M g , ∀i ∈ I and ∀g ∈ G.
The constraints are formulated in order to distribute the production orders to achieve a balanced workload, thereby minimizing the imbalances in workload of the stage for each production order. The above-constructed constraints and objective functions are explained in detail as follows. Equation (11) is the objective function of scheduling level which ensures the minimization of imbalances in each stage. Equation (12) determines the average workload of all the stages at the current time. Equation (13) determines the cumulative workload of single stage.
For the effective functioning of the objective and related constraints, certain relationships have been constructed mathematically to follow a smooth scheduling stage: ∀i ⊂ PO g ; in stage g ⇒ maxDD i ≤ T PO g , In the scheduling level, according to the above-described mathematical relationships, which support the scheduling stage, the inputs include production orders, maximum due date of jobs, and production order at each stage. Current positions of the production orders are tracked by RFID in real-time. The relationships constructed above are explained in detail, as follows: Equation (14) ensures the finishing time of each job. Equation (15) ensures that all jobs which are allocated to PO g arrive between the planned time horizon T and maximum due date of all jobs of the respective production order. Equation (16) ensures that all jobs are completed within their maximum due date. Equation (17) ensures the sequence of the scheduling the production orders at each stage with respect to the weighted priority of the production order. Equation (18) ensures the capturing of the real-time processing start event by RFID. Equation (19) ensures the capturing of the real-time processing end event by RFID, and Equation (20) ensures that each job has completed all required processes in the respective stage.
In above-constructed scheduling level, the considered weighted priority of production order ω PO is estimated in accordance with the following relationship: where the constraint is: allocates the value of ω PO . If the value of workload imbalance is low, then the value of ω PO is set as low, thereby ω PO has highest weighted priority. Decision Output: In the scheduling level, the real-time re/action is the assignment of a production order which has the minimum imbalance of workload to the initial stage. This real-time re/action decides which production order should be allocated to which stage and the following sequence of the production order in the scheduling level. The real-time functionality of the planning and scheduling model is illustrated in the flowchart in Figure 2.

The Framework of the RT-Pull Dispatching Model
Once the scheduling phase is completed in each stage, now each product should be preceded for each operation in the machine which is assigned in that stage. This is hereby controlled by RT-DPG to dispatch each job from the constraint scheduled pool of jobs. For this dispatching procedure, the pull dispatching strategy is followed with the real-time function.
In general, the pull strategy control works with Kanban systems. In a pull scheduling system, a

Real-Time Dispatching Priority Generator (RT-DPG) Model
The horizon of the scheduler is measured in units of days or weeks, depending on uncertainty, while the dispatching horizon is measured in minutes or hours, depending on deterministic real-time data [35]. Therefore, in an attempt to follow and meet what is already planned and scheduled in the RT-DSG module in real-time, and mitigate the consequences of the unplanned or unpredictable events (e.g., machine breakdowns, material shortage, defective problems, disparity operators' performance), this part presents another real-time production control module, namely RT-DPG. RT-DPG utilizes RFID event-instances in AVSM and VVSM to smartly re-sequence or reprioritize products in real-time at the local workstations, supermarkets, or machines, queues, which cannot be addressed through RT-DSG.
The RT-DPG is proposed to run in real-time in DVSM-LPTE in order to generate the optimal sequence of WIPs that are waiting either in the machine's queue or workstation's supermarket throughout the production processes.
RT-DPG is proposed to be translated into RT-LCRs to live prioritize the material flow in unpredictable dynamic production environments to reduce the total waiting time along the value stream and maximize the utilization of all resources, thereby reducing the overall manufacturing lead time, avoiding discrepancies in executing the planned schedules, and meeting customer demand.
As mentioned, in reality, no specific traditional dispatching rule works well all the time [12]. Therefore, a dynamic priority method was developed to reprioritize the products in real-time. Here, we propose what is called the Dispatching Priority Value (DPV) method, which starts by integer "1" as the highest DPV and extends according to the number of product types that are waiting-a smaller value represents higher priority. According to the RT-DPG, the product with the highest DPV will be displayed on the tablet of logistic operators to be dispatched.

The Framework of the RT-Pull Dispatching Model
Once the scheduling phase is completed in each stage, now each product should be preceded for each operation in the machine which is assigned in that stage. This is hereby controlled by RT-DPG to dispatch each job from the constraint scheduled pool of jobs. For this dispatching procedure, the pull dispatching strategy is followed with the real-time function.
In general, the pull strategy control works with Kanban systems. In a pull scheduling system, a certain amount of inventory is held at each workstation, and the next process has been consumed with orders of its replenishment through the rate. Using the concept of pull dispatch, we propose a framework of an RT-pull dispatching system for our shop floor dispatching, shown in Figure 3. This RT-pull dispatching system includes two stages: (1) the product release times; (2) RT-dispatching rules.
Step 1: Back propagation scheduling: This step aims to consider the latest starting time (LST) for all products on all machines to fulfill the due dates. Here, the back-propagation scheduling approach is used to take consideration of the LST, which is based largely on the due date and processing time for all products.
Step 2: Real-Time production orders prioritizing and planning: This step aims to obtain the real-time product information, such as the arrival material data. Then, we can obtain the earliest starting time (EST) for all products on all machines after matching the production orders and the arrival customer order data. The allocation of the arriving customer order is mainly based on the first come, first served rule and based on the due date of the product. This process is initiated after the real time scheduling phase is complete.
Step 3: Determine the PO g release order: This step aims to obtain the appropriate product dispatch times. Using the real-time data from the resources AVSM, VVSM, G-VVSM information, we can obtain the time scale (LST) for all jobs on all machines, stages, buffers, and current time. That is, if the lot release times are within the time scale value, it does not affect the product delivery.  Step 3: Determine the release order: This step aims to obtain the appropriate product dispatch times. Using the real-time data from the resources AVSM, VVSM, G-VVSM information, we can obtain the time scale (LST) for all jobs on all machines, stages, buffers, and current time. That is, if the lot release times are within the time scale value, it does not affect the product delivery.
With the application of the above steps, we propose a heuristic algorithm for the product dispatching times for the multi-stage parallel flexible shop floor with the real-time control of each work stage. Also, there may be chance of mismatch between the dispatching jobs; these may be due to the disturbed updating of the online data transponding system or may be due to the customers' immediate order placing or the canceling of an order. One way in which these mismatches can be avoided between some jobs is that each job is activated in such a way that they already are assigned with dispatching priority value " ", i= 1, 2, 3….n, where "1" is the highest priority dispatchable job, and "n" is the number of jobs with respect to DPV, which decides in which sequence the rules must be checked and executed. For the execution procedure the pseudo codes are expressed as below, Figure 4 describes how the RT-DPG works. The following relationships are used to estimate latest start time (LST):

RT-LCR: Job dispatch schedule in RT-DPG
READ buffer information from stage as , available time of job from − 1 (1) IF any job ∈ is detected in buffer, With the application of the above steps, we propose a heuristic algorithm for the product dispatching times for the multi-stage parallel flexible shop floor with the real-time control of each work stage. Also, there may be chance of mismatch between the dispatching jobs; these may be due to the disturbed updating of the online data transponding system or may be due to the customers' immediate order placing or the canceling of an order. One way in which these mismatches can be avoided between some jobs is that each job is activated in such a way that they already are assigned with dispatching priority value "DPV i ", i = 1, 2, 3 . . . .n, where "1" is the highest priority dispatchable job, and "n" is the number of jobs with respect to DPV, which decides in which sequence the rules KC i must be checked and executed. For the execution procedure the pseudo codes are expressed as below, Figure 4 describes how the RT-DPG works.

Results and Discussion
The feasibility of DVSM was demonstrated through developing different scenarios to be applied on a smart factory/Industry 4.0 lab. Figure 5 illustrates the testing Industry 4.0 lab in King Saud University. It was a smart reconfigurable manufacturing system (RMS), developed step-by-step from The following relationships are used to estimate latest start time (LST):

RT-LCR: Job dispatch schedule in RT-DPG
READ buffer information from stage g as B g , available time of job i from g − 1 (1) IF any job i ∈ B g is detected in buffer, (2) THEN retrieve the time t i in B g in real time THEN assign PO with highest priority of ω PO to stage g, EXECUTE KC i PO g i as HJ by start processing PO g i ELSE (10) EXECUTE to dispatch jobs according to ω i ≤ ω i+1 , ∀i ∈ PO g (11) ENDIF J + 1 ENDWHILE (12) CHECK for any PO in RT-DPG, (13) IF any PO detected THEN, start with step 1.

ENDIF ELSE
IF R mO k , M g = 1, THEN assign PO with highest priority of ω PO to stage g, ELSE wait for R mO k , M g = 1 ENDIF , EXECUTEKC i PO g i as HJ by start processing PO g i ELSE EXECUTE to dispatch jobs according to ω i ≤ ω i+1 , ∀i ∈ PO g ENDIF J + 1 ENDWHILE CHECK for any PO in RT-DPG, IF any PO detected THEN start with step 1.

ENDIF
Step 1 retrieves the real-time buffer information from each stage and the status of the stage; step 2 checks for the availability of any job in the buffer.
Step 3 obtains the time of the job present in the buffer, including the buffer time.
Step 4 ensures for any available idle alternate machine on which the job in the buffer can be processed.
Step 5: if any available alternate machine which can process the same job is found then that job in buffer is set on that machine. Step 6 detects the availability of the machine operator.
Step 7 computes the value of [X i = t c + ST i + P i ], where t c is the current time, which is updated by RFID information.
Step 8 compares the value of X i to the entire job's LST, which is available in PO g . Step 9: if X i is greater than any job's latest start time (LST) from overall jobs in PO, set the dispatching priority value as the highest priority 1, and then execute that job as a hot job and process that first.
Step 10: if any of the jobs in PO g does not satisfy step 8.
Step 11: further process of dispatching the jobs with ω i ≤ ω i+1 continues until no other products remain in the buffer and in production order.
Step 12: the processing of first production order ends.
Step 13: the RT-DPG checks for any further available production orders and if any production order is detected, it starts dispatching them.

Results and Discussion
The feasibility of DVSM was demonstrated through developing different scenarios to be applied on a smart factory/Industry 4.0 lab. Figure 5 illustrates the testing Industry 4.0 lab in King Saud University. It was a smart reconfigurable manufacturing system (RMS), developed step-by-step from scratch. The latest development was done by [36], where a virtual reality system was integrated with it; thus, students became able to anticipate the RMS design, interact with its operations, and understand them, and evaluate its performance. and sensors were used to track smart products with required timestamps, such as processing start/end, setup start/end, or machineries like machine breakdown start/end or maintenance start/end. An initial or alpha DVSM-IT system was developed to run different lean tools. For RT-DSG, RT-LCRs can be constructed and coded, where the required real-time data can be invoked and processed to generate reactions or commands in real-time.
The following production situation was proposed to test our concepts: the final products were four types of yogurt jars, three of them with flavors. There were three sizes of yogurt jars. Therefore, it was a high-mix production system with 12 product types. In order to test for mass customized products, it was proposed that each customer could request their own label on the yogurt jar. The filled yogurt jars were packed and then stored in a refrigerated automated storage and retrieval system. The empty jars were available in front of the filling machine. They were labeled according to customer requests, where RFID-tag was attached in this stage. The customer orders were received online; here the students were the customers, where each of them placed their order through the ITplatform using their mobile phone or tablet. The maximum quantity of each order was 10 yogurt jars. To start the production, the orders were initially scheduled using SimAL scheduling software.
In order to prove the effectiveness of RT-DPG against the traditional DRs, three scenarios were proposed. The first two scenarios represented the traditional DRs, namely EDD and FCFS, whereas the third scenario represented our RT-DPG concept. To do so, several incidents and disruptions were proposed to be done intentionally during the production run, such as changing the priority of two This Industry 4.0 lab consisted of a fully automated yoghurt filling machine equipped with real-time data capturing systems, such as an RFID system, different types of sensors, and machine data from a robot arm, air compressor, and conveyor motor. Those technologies are considered Industry 4.0 real-time data capturing enablers. They supplied the DVSM with real-time data. The RFID readers and sensors were used to track smart products with required timestamps, such as processing start/end, setup start/end, or machineries like machine breakdown start/end or maintenance start/end.
An initial or alpha DVSM-IT system was developed to run different lean tools. For RT-DSG, RT-LCRs can be constructed and coded, where the required real-time data can be invoked and processed to generate reactions or commands in real-time.
The following production situation was proposed to test our concepts: the final products were four types of yogurt jars, three of them with flavors. There were three sizes of yogurt jars. Therefore, it was a high-mix production system with 12 product types. In order to test for mass customized products, it was proposed that each customer could request their own label on the yogurt jar. The filled yogurt jars were packed and then stored in a refrigerated automated storage and retrieval system. The empty jars were available in front of the filling machine. They were labeled according to customer requests, where RFID-tag was attached in this stage. The customer orders were received online; here the students were the customers, where each of them placed their order through the IT-platform using their mobile phone or tablet. The maximum quantity of each order was 10 yogurt jars. To start the production, the orders were initially scheduled using SimAL scheduling software.
In order to prove the effectiveness of RT-DPG against the traditional DRs, three scenarios were proposed. The first two scenarios represented the traditional DRs, namely EDD and FCFS, whereas the third scenario represented our RT-DPG concept. To do so, several incidents and disruptions were proposed to be done intentionally during the production run, such as changing the priority of two orders, changing the due date of an order, failure in the conveyor motor for five minutes, unavailability of the small size of empty jars, unavailability of yogurt with mango flavor for three minutes. According to these incidents or unpredictable events, several RT-LCRs were constructed and coded to be activated on the IT-platform during the production run. Initially, these RT-LCRs were tested and validated using simulation software ProModel. The focus of the constructed RT-LCRs was to reduce the MLT through avoidance or reducing the impact of waste causes. In order to construct the RT-LCRs, the event-instances of the standard VSM were defined and saved on the VVSM-database, and several event-instances were defined and sorted to be captured either from AVSM or VVSM. For example, the customer orders and their status were considered as VVSM real-time data, where filling start/end, jar arrives/depart were captured from AVSM. In addition, reactions or command names were defined to be executed by the machines or workers.
As a result, once an incident was detected, the DVSM-IT activated the corresponding RT-LCR, and accordingly the DVSM generated the most suitable commands, which showed which type of yogurt jar must be uploaded on the conveyor. Therefore, the dynamic behavior of the system was captured, and the suitable reaction was generated. On the other hand, for two DRs no changes could be made in response to the dynamic behavior in the manufacturing system. The above scenarios were applied and repeated in the Industry 4.0 lab several times, and the results were precise, since it was a dynamic manufacturing environment. Therefore, the average values of the performance criteria were taken for RT-DPGs, FCFS, and EDD. Table 3 illustrates the results of each scenario in addition to simulation results that were used to test the validity of RT-LCRs. The simulation results were not equal to RT-LCR results, since the simulation could not address some real events which could not be modeled; thus, their impacts will be propagated and influence the performance criteria, while in reality, the events become deterministic in real-time and they will be directly solved through a suitable reaction. Both RT-DSG and RT-DPG work in parallel in order to generate the most optimal real-time re/actions. If the collection of reactions in the RT-DPG level will significantly impact the time horizon in RT-DSG level, then the RT-LCRs in the RT-DSG will be activated to reschedule the overall production orders.
Finally, the results show the ability of DVSM to control the flow of smart products and re-sequence/re-prioritize them in real-time to avoid hindrance or tardiness along the value stream.

Conclusions
This paper introduced the DVSM, which can be used as an IT platform for the digitalization of lean tools to be smartly implemented, sustained, and keep them alive and more efficient in today's dynamic manufacturing systems. The idea of DVSM comes from the fact that lean extends to cover all manufacturing aspects through a diversity of powerful tools that are mutually supportive and synergize well together to effectively reduce waste and maximize value. Therefore, DVSM is considered a digitalized smart real-time lean-based mechanism to achieve an intelligent, comprehensive, integrated, and holistic real-time lean-based manufacturing system. This research addressed the challenges of lean manufacturing in today's manufacturing systems, where lean has become inefficient. In addition, the paper explored the adoption benefits of RFID and recent advancements in information and communication technologies in manufacturing facilities to effectively reduce waste and maximize value in a real-time lean-based manufacturing system.
The focus was on developing a smart real-time scheduling and dispatching model in a lean manufacturing environment. The RT-SDM can track the flow of products and detect the mismatches and discrepancies between the physical and virtual world that are caused by lean waste. RT-SDM runs in real-time on DVSM to avoid a frozen production schedule and dispatching rule, and accordingly generates suitable reactions and commands to be executed either by machines or a human to mitigate the impact of incidents and try to re-match between VVSM and AVSM.
The proposed DVSM and the developed smart lean-based scheduling and dispatching models were tested and verified through developing an alpha IT platform for a lean smart factory lab in the University of King Saud. The results show the significant improvements on some performance measures after running RT-SDM.
Although several challenges were faced, the results are promising and pave the way for future research to increase the efficiency of DVSM. Technically, overlapping between RFID readings in contiguous points could be a future work. Also, huge amount of data needs more focus in the big data field. From the lean perspective, more attention must be given to the conflicts between commands that are generated based on different RT-LCRs; they must be perfectly coordinated.