Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
dothinking committed Aug 19, 2021
1 parent 6178d16 commit 097a4b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/2021-08-08-作业车间调度问题求解框架.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tags: [job shop schedule]

## 项目仓库

https://github.com/dothinking/job_shop_schedule
https://github.com/dothinking/jsp_framework

## 建模

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tags: [job shop schedule]

基于前文对作业车间调度问题的定义和描述,本文进行Python建模,开发了一个通用的作业车间调度问题求解框架,把问题分解、抽象为可重用的部分,从而专注求解算法的开发、实施和验证。

> [dothinking/job_shop_schedule](https://github.com/dothinking/job_shop_schedule)
> [dothinking/jsp_framework](https://github.com/dothinking/jsp_framework)

## 框架结构
Expand Down Expand Up @@ -87,9 +87,8 @@ tags: [job shop schedule]
关键代码参考:

```python
from model.solver import JSSolver
from model.problem import JSProblem
from model.solution import JSSolution
# user defined path, e.g. path/to/UserSolver.py
from jsp_fwk import (JSProblem, JSSolution, JSSolver)

class UserSolver(JSSolver):

Expand All @@ -112,22 +111,23 @@ class UserSolver(JSSolver):

## 测试算法

框架已经内置了作业车间调度问题的标准考题数据,便于根据名称直接初始化问题。以下示例调用自定义求解器 `SampleSolver` 求解 `ft10` 问题。
框架已经内置了作业车间调度问题的标准考题数据,便于根据名称直接初始化问题。以下示例调用上一节自定义的求解器 `UserSolver` 求解 `ft10` 问题。

- 更多基本问题数据 [参考](https://github.com/dothinking/job_shop_schedule/blob/master/benchmark/instances.json)

- 求解过程以甘特图形式动态展示解的变化


```python
from model.problem import JSProblem
from solver.SampleSolver import SampleSolver
# test.py
from jsp_fwk import JSProblem
from path/to/UserSolver import UserSolver

# load benchmark problem
problem = JSProblem(benchmark='ft10')

# solve problem with user defined solver
s = SampleSolver(name='sample')
s = UserSolver()
s.solve(problem=problem)
```

Expand Down

0 comments on commit 097a4b8

Please sign in to comment.