Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HYH.APSJ
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
佟礼
HYH.APSJ
Commits
25512e9d
Commit
25512e9d
authored
Dec 18, 2025
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回数据修改
parent
bdb0cf2b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
16 deletions
+59
-16
pom.xml
pom.xml
+1
-1
schedule_log.txt
schedule_log.txt
+32
-0
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+12
-7
PlanResultServiceTest.java
src/test/java/com/aps/demo/PlanResultServiceTest.java
+14
-8
No files found.
pom.xml
View file @
25512e9d
...
...
@@ -9,7 +9,7 @@
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<groupId>
com.aps
</groupId>
<artifactId>
java-test
</artifactId>
<artifactId>
aps
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<name>
demo2
</name>
<description>
demo2
</description>
...
...
schedule_log.txt
View file @
25512e9d
...
...
@@ -66299,3 +66299,35 @@
[87000-99000]:[11-02 00:10-11-02 03:30] 12000
[113400-137400]:[11-02 07:30-11-02 14:10] 24000
[2025-12-16 11:49:14]
[2025-12-18 15:55:53]
=== Schedule Summary === 0.484233
[2025-12-18 15:55:53] Operation: 1|2|1|2|1|2|1|2|1|2
[2025-12-18 15:55:53] Makespan: 283800.000000 minutes
[2025-12-18 15:55:53] Total Tardiness: 0.000000 hours
[2025-12-18 15:55:53] Setup Time: 0.000000 minutes
[2025-12-18 15:55:53] Flow Time: 93060.000000 minutes
[2025-12-18 15:55:53] Machine Load Balance: 99.33%
[2025-12-18 15:55:53] -------------------------
[2025-12-18 15:55:53] [171060-212520]:[11-02 23:31-11-03 11:02] Order 1, Machine 3403, Operation 1, Batch 50000.0, processingTime %.1f
[171060-199740]:[11-02 23:31-11-03 07:29] 28680
[205200-212520]:[11-03 09:00-11-03 11:02] 7320
[2025-12-18 15:55:53] [235800-241800]:[11-03 17:30-11-03 19:10] Order 1, Machine 3243, Operation 2, Batch 5000.0, processingTime %.1f
[235800-241800]:[11-03 17:30-11-03 19:10] 6000
[2025-12-18 15:55:53] [271800-277800]:[11-04 03:30-11-04 05:10] Order 1, Machine 3243, Operation 4, Batch 5000.0, processingTime %.1f
[271800-277800]:[11-04 03:30-11-04 05:10] 6000
[2025-12-18 15:55:53] [259800-265800]:[11-04 00:10-11-04 01:50] Order 1, Machine 3243, Operation 5, Batch 5000.0, processingTime %.1f
[259800-265800]:[11-04 00:10-11-04 01:50] 6000
[2025-12-18 15:55:53] [247800-253800]:[11-03 20:50-11-03 22:30] Order 1, Machine 3243, Operation 6, Batch 5000.0, processingTime %.1f
[247800-253800]:[11-03 20:50-11-03 22:30] 6000
[2025-12-18 15:55:53]
[2025-12-18 15:55:53] [212520-216120]:[11-03 11:02-11-03 12:02] Order 2, Machine 3403, Operation 7, Batch 5000.0, processingTime %.1f
[212520-216120]:[11-03 11:02-11-03 12:02] 3600
[2025-12-18 15:55:53] [241800-247800]:[11-03 19:10-11-03 20:50] Order 2, Machine 3243, Operation 8, Batch 5000.0, processingTime %.1f
[241800-247800]:[11-03 19:10-11-03 20:50] 6000
[2025-12-18 15:55:53] [253800-259800]:[11-03 22:30-11-04 00:10] Order 2, Machine 3243, Operation 9, Batch 5000.0, processingTime %.1f
[253800-259800]:[11-03 22:30-11-04 00:10] 6000
[2025-12-18 15:55:53] [265800-271800]:[11-04 01:50-11-04 03:30] Order 2, Machine 3243, Operation 10, Batch 5000.0, processingTime %.1f
[265800-271800]:[11-04 01:50-11-04 03:30] 6000
[2025-12-18 15:55:53] [277800-283800]:[11-04 05:10-11-04 06:50] Order 2, Machine 3243, Operation 11, Batch 5000.0, processingTime %.1f
[277800-283800]:[11-04 05:10-11-04 06:50] 6000
[2025-12-18 15:55:53]
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
25512e9d
...
...
@@ -41,8 +41,14 @@ public class GeneticDecoder {
private
List
<
OrderMaterialRequirement
>
orderMaterials
;
// 添加静态实例引用
private
static
DiscreteParameterMatrixService
staticDiscreteParameterMatrixService
;
// 设置静态服务实例的方法
public
static
void
setDiscreteParameterMatrixService
(
DiscreteParameterMatrixService
service
)
{
staticDiscreteParameterMatrixService
=
service
;
}
private
DiscreteParameterMatrixService
discreteParameterMatrixService
;
public
GeneticDecoder
(
GlobalParam
globalParam
,
LocalDateTime
baseTime
,
List
<
Machine
>
machines
,
List
<
Order
>
orders
,
List
<
Material
>
materials
,
MachineSchedulerService
machineScheduler
,
List
<
OrderMaterialRequirement
>
_orderMaterials
)
{
this
.
baseTime
=
baseTime
;
...
...
@@ -819,13 +825,12 @@ public class GeneticDecoder {
//离散参数
// prev.getDiscreteParameter()
setupTime
=
(
prev
.
getProductId
()
!=
operation
.
getProductId
())
?
(
int
)
discreteParameterMatrixService
.
getDiscreteParameterMatrixValue
(
prev
,
operation
)
:
0
;
if
(
setupTime
>
0
)
{
System
.
out
.
println
(
"设备 "
+
machine
.
getId
()
+
" 需要换型,因为产品从 "
+
prev
.
getProductId
()
+
" 变更为 "
+
operation
.
getProductId
());
if
(
staticDiscreteParameterMatrixService
!=
null
)
{
setupTime
=
(
int
)
staticDiscreteParameterMatrixService
.
getDiscreteParameterMatrixValue
(
prev
,
operation
);
}
else
{
// 添加兜底处理,避免空指针异常
setupTime
=
0
;
}
}
...
...
src/test/java/com/aps/demo/PlanResultServiceTest.java
View file @
25512e9d
...
...
@@ -35,7 +35,7 @@ public class PlanResultServiceTest {
public
void
testExecute2
()
{
// 这里需要一个有效的SceneId来测试
// 在实际测试中,您需要提供一个数据库中存在的SceneId
String
sceneId
=
"2
BD38C14EDAD4CBFB8C9671CD45437A6
"
;
String
sceneId
=
"2
605077DA8D84D2E9380EDB67A448C5C
"
;
try
{
// Chromosome result = planResultService.execute2(sceneId);
...
...
@@ -57,16 +57,22 @@ public class PlanResultServiceTest {
//planResultService.SpiltOrder(sceneId,"2f24e563-1337-422b-a0ba-92da7e8c6584",splitCounts.toArray(new Double[0]));
Double
[]
splitCountsArray
=
new
Double
[
2
];
// 创建一个空的Double数组,可以根据实际需求调整大小或初始化值
splitCountsArray
[
0
]
=
0.0
;
splitCountsArray
[
1
]
=
5000.0
;
planResultService
.
schedule
(
sceneId
);
Chromosome
schedule
=
sceneService
.
loadChromosomeFromFile
(
sceneId
);
// 转换为 ProductGanttVO 格式
List
<
ProductGanttVO
>
productGanttVOList
=
new
ArrayList
<>();
List
<
ProductGanttVO
>
resourceGanttVOs
=
planResultService
.
convertToProductGanttVO1
(
schedule
);
productGanttVOList
.
addAll
(
resourceGanttVOs
);
planResultService
.
SpiltOrder
(
sceneId
,
"2f24e563-1337-422b-a0ba-92da7e8c6584"
,
splitCountsArray
);
System
.
out
.
println
(
"执行成功,结果:"
+
(
productGanttVOList
!=
null
?
"获得染色体对象"
:
"空结果"
));
// planResultService.schedule(sceneId);
// Chromosome schedule = sceneService.loadChromosomeFromFile(sceneId);
//
// // 转换为 ProductGanttVO 格式
// List<ProductGanttVO> productGanttVOList= new ArrayList<>();
// List<ProductGanttVO> resourceGanttVOs = planResultService.convertToProductGanttVO1(schedule);
// productGanttVOList.addAll(resourceGanttVOs);
//
// System.out.println("执行成功,结果:" + (productGanttVOList != null ? "获得染色体对象" : "空结果"));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment