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
7351ba4a
Commit
7351ba4a
authored
Apr 28, 2026
by
Tong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
换数据库
parent
a02e041c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
24 deletions
+36
-24
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+28
-21
HybridAlgorithm.java
src/main/java/com/aps/service/Algorithm/HybridAlgorithm.java
+1
-1
application.yml
src/main/resources/application.yml
+4
-1
PlanResultServiceTest.java
src/test/java/com/aps/demo/PlanResultServiceTest.java
+3
-1
No files found.
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
7351ba4a
...
...
@@ -1338,11 +1338,36 @@ public class GeneticDecoder {
}
}
GAScheduleResult
result
=
new
GAScheduleResult
(
);
GAScheduleResult
result
=
CreateResult
(
operation
,
machine
.
getId
(),
startTime
,
endTime
,
processingTime
,
setupTime
,
preTime
,
teardownTime
,
bomtime
,
geneDetails
,
existingResult
);
// System.out.println("huanxingshijian="+result.getChangeOverTime()+"-------------------"+result.getOrderId()+"--------"+result.getExecId()+"---------"+prev.getOrderId()+"--------"+prev.getExecId());
chromosome
.
getResult
().
add
(
result
);
machine
.
setLastGene
(
result
);
// FileHelper.writeLogFile(" 结束 "+ConvertTime(startTime)+"--"+ConvertTime(endTime)+" "+operation.getGroupId()+" : "+operation.getId()+",处理时间: " + processingTime + ", 后处理: " + teardownTime +
// ", 前处理: " + preTime + ", 换型: " + setupTime+ ", 数量: " + operation.getQuantity()+ ", 设备: "+machine.getId()+ ", 是否可中断: "+operation.getIsInterrupt());
if
(
machineTasks
!=
null
)
{
machineTasks
.
add
(
result
);
}
updateSemiJitTargets
(
operation
,
startTime
,
chromosome
);
scheduleIndexById
.
put
(
operation
.
getId
(),
result
);
// long pwsElapsed = System.nanoTime() - pwsStart;
// if (pwsElapsed > 500_000_000L) {
// FileHelper.writeLogFile("[PERF] processWithSingleMachine 总慢 opId=" + operationId
// + ", groupId=" + operation.getGroupId() + ", machineId=" + machineId
// + ", hasBOM=" + commitMaterialCheck + ", 耗时=" + fmtMs(pwsElapsed));
// }
return
endTime
;
}
private
GAScheduleResult
CreateResult
(
Entry
operation
,
long
machineId
,
int
startTime
,
int
endTime
,
double
processingTime
,
int
setupTime
,
int
preTime
,
int
teardownTime
,
int
bomtime
,
CopyOnWriteArrayList
<
ScheduleResultDetail
>
geneDetails
,
GAScheduleResult
existingResult
)
{
GAScheduleResult
result
=
new
GAScheduleResult
();
result
.
setGroupId
(
operation
.
getGroupId
());
result
.
setOperationId
(
operation
.
getId
());
...
...
@@ -1355,7 +1380,7 @@ public class GeneticDecoder {
result
.
setTargetFinishedOperationId
(
operation
.
getTargetFinishedOperationId
()
==
null
?
null
:
new
ArrayList
<>(
operation
.
getTargetFinishedOperationId
()));
result
.
setMachineId
(
machine
.
getId
()
);
result
.
setMachineId
(
machine
Id
);
result
.
setStartTime
(
startTime
);
result
.
setEndTime
(
endTime
);
result
.
setOneTime
(
processingTime
);
...
...
@@ -1392,25 +1417,7 @@ public class GeneticDecoder {
result
.
setGeneDetails
(
geneDetails
);
// System.out.println("huanxingshijian="+result.getChangeOverTime()+"-------------------"+result.getOrderId()+"--------"+result.getExecId()+"---------"+prev.getOrderId()+"--------"+prev.getExecId());
chromosome
.
getResult
().
add
(
result
);
machine
.
setLastGene
(
result
);
// FileHelper.writeLogFile(" 结束 "+ConvertTime(startTime)+"--"+ConvertTime(endTime)+" "+operation.getGroupId()+" : "+operation.getId()+",处理时间: " + processingTime + ", 后处理: " + teardownTime +
// ", 前处理: " + preTime + ", 换型: " + setupTime+ ", 数量: " + operation.getQuantity()+ ", 设备: "+machine.getId()+ ", 是否可中断: "+operation.getIsInterrupt());
if
(
machineTasks
!=
null
)
{
machineTasks
.
add
(
result
);
}
updateSemiJitTargets
(
operation
,
startTime
,
chromosome
);
scheduleIndexById
.
put
(
operation
.
getId
(),
result
);
// long pwsElapsed = System.nanoTime() - pwsStart;
// if (pwsElapsed > 500_000_000L) {
// FileHelper.writeLogFile("[PERF] processWithSingleMachine 总慢 opId=" + operationId
// + ", groupId=" + operation.getGroupId() + ", machineId=" + machineId
// + ", hasBOM=" + commitMaterialCheck + ", 耗时=" + fmtMs(pwsElapsed));
// }
return
endTime
;
return
result
;
}
private
void
updateSemiJitTargets
(
Entry
parentOperation
,
int
parentStartTime
,
Chromosome
chromosome
)
{
...
...
src/main/java/com/aps/service/Algorithm/HybridAlgorithm.java
View file @
7351ba4a
...
...
@@ -453,7 +453,7 @@ public class HybridAlgorithm {
FileHelper
.
writeLogFile
(
"解码---------------"
+
population
.
size
()
);
// GeneticDecoder decoder = new GeneticDecoder(_GlobalParam, param.getBaseTime(), machines, orders, materials, machineScheduler,materialRequirementService, sceneId);
boolean
ismore
=
tru
e
;
boolean
ismore
=
fals
e
;
if
(
ismore
)
{
CompletableFuture
.
allOf
(
population
.
stream
()
.
map
(
chromosome
->
CompletableFuture
.
runAsync
(()
->
decode
(
sharedDecoder
,
chromosome
,
param
,
allOperations
,
globalOpList
),
decodeExecutor
))
...
...
src/main/resources/application.yml
View file @
7351ba4a
...
...
@@ -55,9 +55,12 @@ spring:
# Oracle数据源
oracle
:
driver-class-name
:
oracle.jdbc.OracleDriver
url
:
jdbc:oracle:thin:@//39.100.7
8.207:700
2/ORCLPDB1
# ORCL为你的Oracle实例名
url
:
jdbc:oracle:thin:@//39.100.7
7.7:152
2/ORCLPDB1
# ORCL为你的Oracle实例名
username
:
mes
# 替换为你的Oracle用户名
password
:
root_mes123456
# 替换为你的Oracle密码
# url: jdbc:oracle:thin:@//39.100.78.207:7002/ORCLPDB1 # ORCL为你的Oracle实例名
# username: mes # 替换为你的Oracle用户名
# password: root_mes123456 # 替换为你的Oracle密码
# sqlserver:
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://192.168.0.181:1434;databaseName=mes;encrypt=false
...
...
src/test/java/com/aps/demo/PlanResultServiceTest.java
View file @
7351ba4a
...
...
@@ -40,10 +40,12 @@ public class PlanResultServiceTest {
// sortService.test1();
// nsgaiiUtils.Test();
planResultService
.
execute2
(
"AD62106303684459949A7323D114BF60"
);
//2000
// planResultService.execute2("E29F2B3ADA8149F6B916B5119296A92B");//2000
// planResultService.execute2("E2CD1FC6FF9B4B19A59FEC7F846D4952");//600
// planResultService.execute2("EAF3C94B8F3345278F226C94FB0FED86");//bom
planResultService
.
execute2
(
"6D63146BE5C84A78B5AB044327BA55BD"
);
//2000
//
planResultService.execute2("6D63146BE5C84A78B5AB044327BA55BD");//2000
// planResultService.execute2("6D63146BE5C84A78B5AB044327BA55BD");//5000
// planResultService.execute2("C8B533BD8944405B9A2F8823C575C204");//500
// planResultService.execute2("EFDD34E4B5BC434BAEAE6A84DFCD4E7B");//20
...
...
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