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
9362e4ee
Commit
9362e4ee
authored
Dec 25, 2025
by
Tong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
遗传算法-增加可中断
parent
b8789253
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
23 deletions
+31
-23
ProdProcessExec.java
src/main/java/com/aps/entity/ProdProcessExec.java
+1
-0
Entry.java
src/main/java/com/aps/entity/basic/Entry.java
+1
-1
GeneticAlgorithm.java
...main/java/com/aps/service/Algorithm/GeneticAlgorithm.java
+1
-0
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+1
-1
MachineCalculator.java
...ain/java/com/aps/service/Algorithm/MachineCalculator.java
+24
-21
RoutingDataService.java
...in/java/com/aps/service/Algorithm/RoutingDataService.java
+1
-0
LanuchServiceImpl.java
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
+2
-0
No files found.
src/main/java/com/aps/entity/ProdProcessExec.java
View file @
9362e4ee
...
...
@@ -91,6 +91,7 @@ public class ProdProcessExec {
*/
private
String
connectPropertyName
;
private
Long
canInterrupt
;
private
Integer
routingId
;
...
...
src/main/java/com/aps/entity/basic/Entry.java
View file @
9362e4ee
...
...
@@ -94,7 +94,7 @@ public class Entry {
/**
* 是否可中断,间缝插针
*/
public
Boolean
IsInterrupt
=
true
;
public
Long
IsInterrupt
=
1
l
;
/**
* 所需物料
...
...
src/main/java/com/aps/service/Algorithm/GeneticAlgorithm.java
View file @
9362e4ee
...
...
@@ -188,6 +188,7 @@ public class GeneticAlgorithm {
if
(
bestFitness
<
best
.
getWeightedObjective
())
{
bestFitness
=
best
.
getWeightedObjective
();
Iteration
=
1
;
}
else
{
Iteration
++;
...
...
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
9362e4ee
...
...
@@ -367,7 +367,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
int
preTime
=
machineOption
.
getPreTime
();
int
setupTime
=
calculateSetupTime
(
chromosome
.
getResult
(),
operation
,
machine
,
machineOption
);
System
.
out
.
println
(
" 处理时间: "
+
processingTime
+
", 后处理: "
+
teardownTime
+
FileHelper
.
writeLogFile
(
" 处理时间: "
+
processingTime
+
", 后处理: "
+
teardownTime
+
", 前处理: "
+
preTime
+
", 换型: "
+
setupTime
+
", 数量: "
+
operation
.
getQuantity
());
...
...
src/main/java/com/aps/service/Algorithm/MachineCalculator.java
View file @
9362e4ee
...
...
@@ -119,12 +119,8 @@ public class MachineCalculator {
if
(!
prevEnd
.
isEqual
(
LocalDateTime
.
of
(
2000
,
1
,
1
,
0
,
0
,
0
)))
{
if
(
prevEnd
.
isBefore
(
currentTime
))
{
// 检查班次间任务
LocalDateTime
finalPrevEnd
=
prevEnd
;
boolean
hasTask
=
machineTasks
.
stream
()
.
anyMatch
(
t
->
{
LocalDateTime
taskStart
=
baseTime
.
plusSeconds
(
t
.
getStartTime
());
return
taskStart
.
isAfter
(
finalPrevEnd
)
&&
taskStart
.
isBefore
(
shiftStart
);
});
boolean
hasTask
=
CheckTask
(
machine
,
machineTasks
,
prevEnd
,
shiftStart
);
if
(
hasTask
)
{
// 重置状态
...
...
@@ -137,21 +133,8 @@ public class MachineCalculator {
continue
;
}
// 检查班次间维修窗口
if
(
machine
.
getMaintenanceWindows
()
!=
null
)
{
LocalDateTime
finalPrevEnd1
=
prevEnd
;
boolean
hasMaintenance
=
machine
.
getMaintenanceWindows
().
stream
()
.
anyMatch
(
w
->
w
.
getStartTime
().
isAfter
(
finalPrevEnd1
)
&&
w
.
getStartTime
().
isBefore
(
shiftStart
));
if
(
hasMaintenance
)
{
currentTime
=
shiftStart
;
st
=
shiftStart
;
remainingTime
=
processingTime
;
prevEnd
=
LocalDateTime
.
of
(
2000
,
1
,
1
,
0
,
0
,
0
);
times
.
clear
();
continue
;
}
}
}
}
...
...
@@ -188,6 +171,26 @@ public class MachineCalculator {
return
times
;
}
private
boolean
CheckTask
(
Machine
machine
,
List
<
GAScheduleResult
>
machineTasks
,
LocalDateTime
prevEnd
,
LocalDateTime
shiftStart
)
{
LocalDateTime
finalPrevEnd
=
prevEnd
;
boolean
hasTask
=
machineTasks
.
stream
()
.
anyMatch
(
t
->
{
LocalDateTime
taskStart
=
baseTime
.
plusSeconds
(
t
.
getStartTime
());
return
taskStart
.
isAfter
(
finalPrevEnd
)
&&
taskStart
.
isBefore
(
shiftStart
);
});
if
(!
hasTask
)
{
// 检查班次间维修窗口
if
(
machine
.
getMaintenanceWindows
()
!=
null
)
{
LocalDateTime
finalPrevEnd1
=
prevEnd
;
boolean
hasMaintenance
=
machine
.
getMaintenanceWindows
().
stream
()
.
anyMatch
(
w
->
w
.
getStartTime
().
isAfter
(
finalPrevEnd1
)
&&
w
.
getStartTime
().
isBefore
(
shiftStart
));
return
hasMaintenance
;
}
}
return
hasTask
;
}
/**
* 获取设备当前或下一个有效班次
*/
...
...
src/main/java/com/aps/service/Algorithm/RoutingDataService.java
View file @
9362e4ee
...
...
@@ -196,6 +196,7 @@ public class RoutingDataService {
entry
.
setRoutingDetailId
(
op
.
getRoutingDetailId
());
entry
.
setTaskSeq
(
op
.
getTaskSeq
());
entry
.
setRoutingDetailName
(
op
.
getRoutingDetailName
());
entry
.
setIsInterrupt
(
op
.
getCanInterrupt
());
Order
order
=
ProdLaunchOrders
.
stream
()
.
filter
(
t
->
t
.
getOrderId
().
equals
(
op
.
getOrderId
()))
.
findFirst
().
orElse
(
null
);
...
...
src/main/java/com/aps/service/impl/LanuchServiceImpl.java
View file @
9362e4ee
...
...
@@ -643,6 +643,8 @@ public class LanuchServiceImpl implements LanuchService {
prodProcessExec
.
setRoutingId
(
prodOrderMain
.
getRoutingId
());
prodProcessExec
.
setRoutingCode
(
prodOrderMain
.
getRoutingCode
());
prodProcessExec
.
setConnectPropertyName
(
detail
.
getConnectPropertyName
());
prodProcessExec
.
setCanInterrupt
(
detail
.
getCanInterrupt
());
prodProcessExec
.
setSpeed
(
Optional
.
ofNullable
(
detail
.
getRuntime
())
...
...
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