-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update backward scheduling * Update --------- Co-authored-by: LongxingTan <tanlongxing888@163.com>
- Loading branch information
1 parent
e59f208
commit 5a443c2
Showing
44 changed files
with
1,349 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
heuristics | ||
============ | ||
|
||
|
||
禁忌搜索 | ||
------------ | ||
|
||
|
||
遗传算法 | ||
------------- | ||
|
||
遗传算法应用在排产中的关键就是如何将排产结果进行编码、以及如何计算fitness。 | ||
|
||
每一个可行解被称为一个染色体,一个染色体由多个元素构成,这个元素称为基因。 | ||
|
||
遗传算法应用在排产问题时,以及TSP、VRP等经典问题,模型的解不表示数量,而表示顺序。 | ||
对于m个job,n个机器的排产问题。基因序列的长度是 m * n,因为每个job都需要在n台机器上加工。 | ||
|
||
两个序列表示模型的解,一个是工序的OS,一个是机器的MS。其中,OS基因序列的数值表示第i个job,这个数值第几次出现决定的是该job的第几道工序。MS同理表示的选择的机器。 | ||
|
||
|
||
|
||
强化学习 | ||
------------- | ||
|
||
Q-learning方法的关键是在agent探索过程中保存一个状态收益表。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Tutorials | ||
rl | ||
========= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,43 @@ | ||
""" | ||
class CRScheduler: | ||
# ... (rest of the class code) | ||
def schedule_job(self, job): | ||
# ... (rest of the method code) | ||
for operation in job.route.operations: | ||
# ... (rest of the method code) | ||
# Store the scheduling result for each operation | ||
self.schedule_result[operation] = (operation.start_time, operation.end_time) | ||
""" | ||
|
||
from matplotlib import ticker | ||
import matplotlib.patches as patches | ||
import matplotlib.pyplot as plt | ||
|
||
|
||
def plot_gantt_chart(schedule_result): | ||
fig, ax = plt.subplots() | ||
|
||
# Set y-axis limits | ||
ax.set_ylim(0, 10) | ||
ax.set_xlim(0, max([end_time for (_, end_time) in schedule_result.values()])) | ||
|
||
for i, (operation, (start_time, end_time)) in enumerate(schedule_result.items()): | ||
# Draw Gantt chart bar for each operation | ||
y = 5 - i # Position the bar on the y-axis | ||
height = 1 # Bar height | ||
width = end_time - start_time | ||
rect = patches.Rectangle((start_time, y), width, height, linewidth=1, edgecolor="black", facecolor="blue") | ||
ax.add_patch(rect) | ||
|
||
# Add text label for the operation name | ||
ax.text( | ||
start_time + width / 2, y + height / 2, f"Operation {operation.id}", ha="center", va="center", color="white" | ||
) | ||
|
||
plt.xlabel("Time") | ||
plt.ylabel("Operations") | ||
plt.title("Gantt Chart - Scheduling Result") | ||
plt.show() |
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.