**6. Conclusions**

We analyzed a quite general single-server queue with heterogeneous customers and a finite buffer. The arrival flow is defined by the *MMAP* what allows us to take into account the possible correlation of inter-arrival intervals of customers of different types. The service time distribution is of phase-type which allows to approximate more general distributions. Customers of various types have different impatience. It is assumed that the problem of assigning the non-preemptive priorities to different types of customers is solved in the assumption that during staying in the buffer customers can improve their priority. Presented above results allow computing the steady-state distribution of the system and the key performance measures of the system under any fixed set of the system parameters. This creates an opportunity for further use of the obtained results for the optimal scheduling of the flows (assigning the priorities and permissions to increase the priority) under any fixed cost criterion. The criterion may include, e.g., the profit gained via the service of different types of customers or the coefficient of utilization of the server and loss probabilities (rejection at the entrance of the system, pushing out by a high priority customer, leaving the system due to impatience) of different types of customers.

Results can be applied for optimization of the scheduling of: (i) information flows in communication networks where users are categorized into several groups according to their importance, in particular, possible damage caused by the loss or obsolescence of the corresponding information; (ii) patients with different degree of life threat in emergency departments; (iii) perishable goods and foods in warehouses, etc. As future directions of generalization of the considered model we can mention the account of possibility of different distribution of service time for different types of customers and possibility of unreliable service of customers similar to [33].

**Author Contributions:** Conceptualization, S.L., S.D. and V.K.; methodology, S.D., O.D., and C.K.; software, S.L., S.D. and O.D.; validation, S.L., S.D. and O.D.; formal analysis, S.D., V.K., and C.K.; investigation, C.K.; writing, original draft preparation, S.L. and C.K.; writing, review and editing V.K., and C.K.; supervision S.L. and C.K.; project administration O.D. and V.K. All authors read and agreed to the published version of the manuscript.

**Funding:** This work has been supported by Sangji University Grant 2018. This work was also partially supported by the Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education (NRF-2018K2A9A1A06072058) and gran<sup>t</sup> No. F19KOR-001 of the Belarusian Republican Foundation for Fundamental Research.

**Conflicts of Interest:** The authors declare no conflict of interest.
