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
73a7b529
Commit
73a7b529
authored
Apr 20, 2026
by
Tong Li
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/tl'
parents
fa7cf28d
a1d62496
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
13 deletions
+19
-13
GlobalParam.java
src/main/java/com/aps/entity/basic/GlobalParam.java
+5
-5
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+3
-2
HybridAlgorithm.java
src/main/java/com/aps/service/Algorithm/HybridAlgorithm.java
+0
-1
MaterialRequirementService.java
...com/aps/service/Algorithm/MaterialRequirementService.java
+9
-3
PlanResultServiceTest.java
src/test/java/com/aps/demo/PlanResultServiceTest.java
+2
-2
No files found.
src/main/java/com/aps/entity/basic/GlobalParam.java
View file @
73a7b529
...
@@ -83,11 +83,11 @@ public class GlobalParam {
...
@@ -83,11 +83,11 @@ public class GlobalParam {
public
GlobalParam
()
{
public
GlobalParam
()
{
// 初始化默认目标值配置
// 初始化默认目标值配置
//完工时间、总流程时间、总换型时间、机器负载标准差、延迟时间
//完工时间、总流程时间、总换型时间、机器负载标准差、延迟时间
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_MAKESPAN
,
1
,
0.
3
));
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_MAKESPAN
,
1
,
0.
4
));
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_FLOW_TIME
,
2
,
0.
2
));
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_FLOW_TIME
,
2
,
0.
6
));
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_SETUP_TIME
,
2
,
0.
15
));
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_SETUP_TIME
,
2
,
0.
39
));
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_MACHINE_LOAD
,
1
,
0.
2
));
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_MACHINE_LOAD
,
1
,
0.
3
));
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_TARDINESS
,
1
,
0.
15
));
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_TARDINESS
,
1
,
0.
3
));
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_SEMI_JIT
,
2
,
0.01
));
objectiveConfigs
.
add
(
createMinimizeObjectiveConfig
(
OBJECTIVE_SEMI_JIT
,
2
,
0.01
));
objectiveConfigs
.
sort
(
Comparator
.
comparing
((
ObjectiveConfig
op
)
->
op
.
getLevel
()));
objectiveConfigs
.
sort
(
Comparator
.
comparing
((
ObjectiveConfig
op
)
->
op
.
getLevel
()));
...
...
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
73a7b529
...
@@ -1106,7 +1106,7 @@ public class GeneticDecoder {
...
@@ -1106,7 +1106,7 @@ public class GeneticDecoder {
int
setupTime
=
0
;
int
setupTime
=
0
;
long
machineId
=
machine
.
getId
();
long
machineId
=
machine
.
getId
();
boolean
needMaterialCheck
=
false
;
//
(operation.getMaterialRequirements()!=null&&operation.getMaterialRequirements().size()>0&&operation.getTargetFinishedOperationId()==null)||calbom;
boolean
needMaterialCheck
=
(
operation
.
getMaterialRequirements
()!=
null
&&
operation
.
getMaterialRequirements
().
size
()>
0
&&
operation
.
getTargetFinishedOperationId
()==
null
)||
calbom
;
boolean
commitMaterialCheck
=
needMaterialCheck
;
boolean
commitMaterialCheck
=
needMaterialCheck
;
int
baseEarliestStartTime
=
earliestStartTime
;
int
baseEarliestStartTime
=
earliestStartTime
;
int
candidateStartTime
=
earliestStartTime
;
int
candidateStartTime
=
earliestStartTime
;
...
@@ -1137,10 +1137,11 @@ public class GeneticDecoder {
...
@@ -1137,10 +1137,11 @@ public class GeneticDecoder {
{
{
candidateStartTime
=
Math
.
max
(
candidateStartTime
,
lastGeneOnMachine
.
getEndTime
());
candidateStartTime
=
Math
.
max
(
candidateStartTime
,
lastGeneOnMachine
.
getEndTime
());
}
}
// 0 884400
machinePreview
=
buildMachinePreview
(
scheduledOperation
,
scheduledMachine
,
processingTime
,
processingTimeTotal
,
machinePreview
=
buildMachinePreview
(
scheduledOperation
,
scheduledMachine
,
processingTime
,
processingTimeTotal
,
candidateStartTime
,
lastGeneOnMachine
,
machineTasks
,
chromosome
);
candidateStartTime
,
lastGeneOnMachine
,
machineTasks
,
chromosome
);
try
{
try
{
//864000
bomtime
=
EditOperationBOMTime
(
scheduledOperation
,
chromosome
,
machinePreview
.
getStartTime
(),
machineTasksCache
,
entryIndexById
,
scheduleIndexById
,
false
);
bomtime
=
EditOperationBOMTime
(
scheduledOperation
,
chromosome
,
machinePreview
.
getStartTime
(),
machineTasksCache
,
entryIndexById
,
scheduleIndexById
,
false
);
}
finally
{
}
finally
{
Machine
liveMachineAfterTrial
=
getMachineById
(
chromosome
,
machineId
);
Machine
liveMachineAfterTrial
=
getMachineById
(
chromosome
,
machineId
);
...
...
src/main/java/com/aps/service/Algorithm/HybridAlgorithm.java
View file @
73a7b529
...
@@ -141,7 +141,6 @@ int opcount=allOperations.size();
...
@@ -141,7 +141,6 @@ int opcount=allOperations.size();
// 步骤2:对初始种群进行爬山法局部优化
// 步骤2:对初始种群进行爬山法局部优化
if
(
opcount
<
100
)
{
if
(
opcount
<
100
)
{
Chromosome
best
=
population
.
get
(
0
);
Chromosome
best
=
population
.
get
(
0
);
...
...
src/main/java/com/aps/service/Algorithm/MaterialRequirementService.java
View file @
73a7b529
...
@@ -1087,7 +1087,7 @@ if(demand==null)
...
@@ -1087,7 +1087,7 @@ if(demand==null)
}
}
}
}
orderMaterial
.
setYpQty
(
useStock
);
orderMaterial
.
setUseStock
(
useStock
);
orderMaterial
.
setUseStock
(
useStock
);
...
@@ -1232,6 +1232,8 @@ if(demand==null)
...
@@ -1232,6 +1232,8 @@ if(demand==null)
if
(
commitChanges
)
{
if
(
commitChanges
)
{
s
.
setUsedInventory
(
s
.
getUsedInventory
()+
useStock1
);
s
.
setUsedInventory
(
s
.
getUsedInventory
()+
useStock1
);
}
}
orderMaterial
.
setUseStock
(
useStock
);
if
(
needed
==
0
)
if
(
needed
==
0
)
{
{
break
;
break
;
...
@@ -1255,18 +1257,22 @@ if(demand==null)
...
@@ -1255,18 +1257,22 @@ if(demand==null)
.
filter
(
t
->
t
.
getStrsupid
().
equals
(
orderMaterial
.
getBomId
())
.
filter
(
t
->
t
.
getStrsupid
().
equals
(
orderMaterial
.
getBomId
())
&&
t
.
getMaterialid
().
equals
(
orderMaterial
.
getMaterialId
()))
&&
t
.
getMaterialid
().
equals
(
orderMaterial
.
getMaterialId
()))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
if
(
routingsupportingreplaces2
!=
null
&&
routingsupportingreplaces2
.
size
()
>
1
)
{
if
(
routingsupportingreplaces2
!=
null
&&
routingsupportingreplaces2
.
size
()
>
0
)
{
for
(
RoutingSupportingReplace
rsr
:
routingsupportingreplaces2
)
{
for
(
RoutingSupportingReplace
rsr
:
routingsupportingreplaces2
)
{
Material
material1
=
materials
.
stream
()
Material
material1
=
materials
.
stream
()
.
filter
(
m
->
m
.
getId
().
equals
(
rsr
.
getTargetmaterialid
()))
.
filter
(
m
->
m
.
getId
().
equals
(
rsr
.
getTargetmaterialid
()))
.
findFirst
()
.
findFirst
()
.
orElse
(
null
);
.
orElse
(
null
);
if
(
material1
==
null
)
{
if
(
material1
==
null
)
{
break
;
break
;
}
}
OrderMaterialRequirement
orderMaterial1
=
MaterialStock
(
material1
,
rsr
.
getTargetmaterialid
(),
orderMaterial
.
getOrderId
(),
orderMaterial
.
getChildOrderId
(),
operation
,
allneeded
,
needed
,
earliestStartTime
,
commitChanges
);
OrderMaterialRequirement
orderMaterial1
=
MaterialStock
(
material1
,
rsr
.
getTargetmaterialid
(),
orderMaterial
.
getOrderId
(),
orderMaterial
.
getChildOrderId
(),
operation
,
allneeded
,
needed
,
earliestStartTime
,
commitChanges
);
if
(
orderMaterial1
!=
null
)
{
if
(
orderMaterial1
!=
null
)
{
useStock
=
orderMaterial1
.
getUseStock
();
useStock
=
orderMaterial1
.
getUseStock
();
needed
-=
useStock
;
needed
-=
useStock
;
orderMaterial
.
setUseStock
(
orderMaterial
.
getUseStock
()
+
useStock
);
orderMaterial
.
setUseStock
(
orderMaterial
.
getUseStock
()
+
useStock
);
...
...
src/test/java/com/aps/demo/PlanResultServiceTest.java
View file @
73a7b529
...
@@ -41,8 +41,8 @@ public class PlanResultServiceTest {
...
@@ -41,8 +41,8 @@ public class PlanResultServiceTest {
// nsgaiiUtils.Test();
// nsgaiiUtils.Test();
// planResultService.execute2("E29F2B3ADA8149F6B916B5119296A92B");//2000
// planResultService.execute2("E29F2B3ADA8149F6B916B5119296A92B");//2000
planResultService
.
execute2
(
"E2CD1FC6FF9B4B19A59FEC7F846D4952"
);
//600
//
planResultService.execute2("E2CD1FC6FF9B4B19A59FEC7F846D4952");//600
// planResultService.execute2("EAA0E2D70BC94EEDA2E5A4597BE69523
");//bom
planResultService
.
execute2
(
"EAF3C94B8F3345278F226C94FB0FED86
"
);
//bom
// planResultService.execute2("08B1D87FE1B84ECDBAC2E546DDB6FB81");//2000
// planResultService.execute2("08B1D87FE1B84ECDBAC2E546DDB6FB81");//2000
// planResultService.execute2("0428340BB4F540938F1FB5599F03E8A4");//5000
// planResultService.execute2("0428340BB4F540938F1FB5599F03E8A4");//5000
// planResultService.execute2("C8B533BD8944405B9A2F8823C575C204");//500
// planResultService.execute2("C8B533BD8944405B9A2F8823C575C204");//500
...
...
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