lte数据优化之调度优化
工业工程师R (R for Industrial Engineers)
行动调查 (Operations Research)
Operations Research is a scientific approach for decision making that seeks for the best design and operation of a system, usually under conditions requiring the allocation of scarce or limited resources. The scientific approach for decision making requires the use of one or more mathematical optimization models (i.e. representations of the actual situation) to make the optimum decision.
运筹学是一种决策的科学方法,通常在需要分配稀缺资源或有限资源的条件下,寻求系统的最佳设计和运行。 科学的决策方法要求使用一个或多个数学优化模型(即,实际情况的表示)来做出最佳决策。
排程 (Scheduling)
Scheduling consists in the process of arranging, assigning, controlling and optimizing resources, work and workloads in a production or manufacturing setting. It has a direct significant impact on the productivity of a process.
计划包括在生产或制造环境中安排,分配,控制和优化资源,工作和工作负载的过程。 它对流程的生产力有直接的重大影响。
In a manufacturing setting, the purpose of scheduling consists in minimizing costs and production times by indicating the facility and operators the total number of units to be produced, at what time period and to which customer, the previous while satisfying the demand and not exceeding their current capacities.
在制造环境中,计划的目的在于通过指示设施和操作员要生产的总数量,在什么时间段和向哪个客户生产满足需求且不超过其数量的前一个产品,来最大程度地减少成本和生产时间当前的容量。
Under this premise, scheduling tasks could be analyzed and solved using the transportation algorithm, where n units from i suppliers (i.e. production time periods) must be transported (i.e. produced) to j customers (i.e. demand time period).
在此前提下,可以使用运输算法分析和解决计划任务,其中必须将i个供应商的n个单位(即生产时间段)运输(即生产)到j个客户(即需求时间段)。
The lpSolve package from R contains several functions for solving transportation problems. For the following example, let’s consider the following business case related with production planning and scheduling:
来自R的lpSolve软件包包含一些用于解决运输问题的函数。 对于以下示例,让我们考虑以下与生产计划和调度有关的业务案例:
A factory produces a particular product based on quarterly demands. The demand starts slow during the first quarter of the year, peaks in the middle and tapers off towards the end of the year. Because of the high popularity of its product, the factory may use overtime to satisfy the demand. The table below provides the production capacities and the demands for each yearly quarter.
工厂根据季度需求生产特定产品。 需求在今年第一季度开始缓慢,在中期达到顶峰,并在年底逐渐减少。 由于其产品的高度受欢迎,工厂可能会加班来满足需求。 下表提供了每个季度的生产能力和需求。
![Image for post](https://miro.medium.com/max/9999/1*ShWAjSu4xRzizDm6DiFDUQ.png)
The unit product cost in any period is $6 during regular time and $9 during overtime. Holding cost per unit per quarter is $0.10. To ensure that the model has a feasible solution when no shortage is allowed, the cumulative supply up to any quarter must be equal at least to the associated cumulative demand, as the tables below shows.
任何时期的单位产品成本在正常时间是6美元,在加班时间是9美元。 每季度每单位的持有成本为0.10美元。 为确保模型在不出现短缺的情况下具有可行的解决方案,如下表所示,任何季度之前的累计供应量必须至少等于相关的累计需求量。
![Image for post](https://miro.medium.com/max/9999/1*hlgD873YF3so7AFtvA2dGA.png)
Since the cumulative supply of the fourth quarter exceeds the cumulative demand of the same period, a dummy surplus destination needs to be added to balance the model and solve it as a ‘transportation’ problem.
由于第四季度的累计供应量超过了同期的累计需求,因此需要添加一个虚拟的剩余目的地来平衡模型并将其解决为“运输”问题。
Questions to be answered:
有待回答的问题:
- What production scheduling plan will minimize cost for the company? 哪种生产计划计划将使公司的成本最小化?
- Which is the optimum production cost? 最佳生产成本是多少?
Decision Variables:
决策变量:
![Image for post](https://miro.medium.com/max/9999/1*fNpLardpNwFAXExfZKoj3w.png)
Problem Formulation:
问题表述:
![Image for post](https://miro.medium.com/max/9999/1*ax5NDKIylZKmcr5fd4tJqA.png)
![Image for post](https://miro.medium.com/max/9999/1*rvVpOQt1xM69w68f3EwADA.png)
R Code:
R代码:
# Import lpSolve package
library(lpSolve)
# Set production costs matrix
costs <- matrix(c(6, 6.1, 6.2, 6.3, 0,
9, 9.1, 9.2, 9.3, 0,
100, 6, 6.1, 6.2, 0,
100, 9, 9.1, 9.2, 0,
100, 100, 6, 6.1, 0,
100, 100, 9, 9.1, 0,
100, 100, 100, 6, 0,
100, 100, 100, 9, 0), nrow = 8, byrow = TRUE)
# Set customers and production type names
colnames(costs) <- c("Spring", "Summer", "Fall", "Winter", "Surplus")
rownames(costs) <- c("R1", "O1", "R2", "O2", "R3", "03", "R4", "04")
# Set unequality/equality signs for production types
row.signs <- rep("<=", 8)
# Set right hand side coefficients for production types
row.rhs <- c(90, 50, 100, 60, 120, 80, 110, 70)
# Set unequality/equality signs for demand
col.signs <- rep(">=", 5)
# Set right hand side coefficients for demand
col.rhs <- c(100, 190, 210, 160, 20)
# Final value (z)
lp.transport(costs, "min", row.signs, row.rhs, col.signs, col.rhs)
# Variables final values
lp.transport(costs, "min", row.signs, row.rhs, col.signs, col.rhs)$solution
Solution:
解:
Success: the objective function is 4685
[,1] [,2] [,3] [,4] [,5]
[1,] 50 40 0 0 0
[2,] 50 0 0 0 0
[3,] 0 90 10 0 0
[4,] 0 60 0 0 0
[5,] 0 0 120 0 0
[6,] 0 0 80 0 0
[7,] 0 0 0 110 0
[8,] 0 0 0 50 20
According to the results, the minimum production that will satisfy the yearly demand is $4,685. To achieve this, the factory myst schedule their production plan as follows:
根据结果,满足年需求的最低产量为$ 4,685。 为了实现这一目标,工厂计划将其生产计划安排如下:
![Image for post](https://miro.medium.com/max/9999/1*ZW4GgAU5eAjewCRsXoOn8A.png)
结论思想 (Concluding Thoughts)
Production scheduling can be optimized through operations research algorithms to maximize profits or minimize goals while satisfying the demand without exceeding production capacity constraints. The lpSolve R package allows solving tasks with just a few lines of code uing the transportation algorithm.
可以通过运营研究算法优化生产计划,以在不超出生产能力限制的前提下满足需求的同时最大化利润或最小化目标。 lpSolve R软件包允许使用运输算法仅用几行代码来解决任务。
Engineers, production planners and master schedulers must be capable of optimizing production plans to ensure an adequate allocation of resources while accomplishing the organization’s objectives and being efficient. To do so, they must have reliable decision support systems and use efficient decision making tools.
工程师,生产计划员和主计划员必须能够优化生产计划,以确保充分分配资源,同时实现组织的目标和效率。 为此,他们必须拥有可靠的决策支持系统并使用有效的决策工具。
— —
— —
If you found this article useful, feel welcome to download my personal codes on GitHub. You can also email me directly at rsalaza4@binghamton.edu and find me on LinkedIn. Interested in learning more about data analytics, data science and machine learning applications in the engineering field? Explore my previous articles by visiting my Medium profile. Thanks for reading.
如果您觉得本文有用,欢迎在 GitHub上 下载我的个人代码 。 您也可以直接通过rsalaza4@binghamton.edu向我发送电子邮件,并在 LinkedIn 上找到我 。 有兴趣了解更多有关工程领域中的数据分析,数据科学和机器学习应用程序的信息吗? 通过访问我的Medium 个人资料 来浏览我以前的文章 。 谢谢阅读。
- Robert
-罗伯特
翻译自: https://medium.com/swlh/scheduling-optimization-with-r-a9e08ea4b65
lte数据优化之调度优化