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
2728c661
Commit
2728c661
authored
May 25, 2026
by
Tong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wuliao
parent
336d7ba9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
2 deletions
+37
-2
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+1
-0
HillClimbing.java
src/main/java/com/aps/service/Algorithm/HillClimbing.java
+32
-1
HybridAlgorithm.java
src/main/java/com/aps/service/Algorithm/HybridAlgorithm.java
+1
-0
MaterialRequirementService.java
...com/aps/service/Algorithm/MaterialRequirementService.java
+3
-1
No files found.
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
2728c661
...
@@ -2936,6 +2936,7 @@ if(geneDetails!=null&&geneDetails.size()>0)
...
@@ -2936,6 +2936,7 @@ if(geneDetails!=null&&geneDetails.size()>0)
double
totalSetupTime
=
calculateTotalSetupTime
(
chromosome
);
double
totalSetupTime
=
calculateTotalSetupTime
(
chromosome
);
chromosome
.
setTotalChangeoverTime
(
totalSetupTime
);
chromosome
.
setTotalChangeoverTime
(
totalSetupTime
);
Objectives
[
i
]
=
totalSetupTime
;
Objectives
[
i
]
=
totalSetupTime
;
}
}
if
(
GlobalParam
.
OBJECTIVE_FLOW_TIME
.
equals
(
config
.
getName
()))
{
if
(
GlobalParam
.
OBJECTIVE_FLOW_TIME
.
equals
(
config
.
getName
()))
{
// 4. 最小化总流程时间 所有工序加工时间的总和
// 4. 最小化总流程时间 所有工序加工时间的总和
...
...
src/main/java/com/aps/service/Algorithm/HillClimbing.java
View file @
2728c661
...
@@ -444,6 +444,24 @@ public class HillClimbing {
...
@@ -444,6 +444,24 @@ public class HillClimbing {
}
}
FileHelper
.
writeLogFile
(
String
.
format
(
"爬山法%s - kpi:%s"
,
chromosome
.
getGeneStr
(),
fitness
));
FileHelper
.
writeLogFile
(
String
.
format
(
"爬山法%s - kpi:%s"
,
chromosome
.
getGeneStr
(),
fitness
));
if
(
chromosome
.
getMakespan
()!=
0
)
{
FileHelper
.
writeLogFile
(
String
.
format
(
"爬山法%s - kpi-Makespan: %f"
,
chromosome
.
getGeneStr
(),
chromosome
.
getMakespan
()));
}
if
(
chromosome
.
getDelayTime
()!=
0
)
{
FileHelper
.
writeLogFile
(
String
.
format
(
"爬山法%s - kpi-DelayTime: %f"
,
chromosome
.
getGeneStr
(),
chromosome
.
getDelayTime
()));
}
if
(
chromosome
.
getTotalChangeoverTime
()!=
0
)
{
FileHelper
.
writeLogFile
(
String
.
format
(
"爬山法%s - kpi-ChangeoverTime: %f"
,
chromosome
.
getGeneStr
(),
chromosome
.
getTotalChangeoverTime
()));
}
if
(
chromosome
.
getMachineLoadStd
()!=
0
)
{
FileHelper
.
writeLogFile
(
String
.
format
(
"爬山法%s - kpi-MachineLoad: %f"
,
chromosome
.
getGeneStr
(),
chromosome
.
getMachineLoadStd
()));
}
if
(
chromosome
.
getTotalFlowTime
()!=
0
)
{
FileHelper
.
writeLogFile
(
String
.
format
(
"爬山法%s - kpi-FlowTime: %f"
,
chromosome
.
getGeneStr
(),
chromosome
.
getTotalFlowTime
()));
}
}
}
/**
/**
...
@@ -613,7 +631,20 @@ public class HillClimbing {
...
@@ -613,7 +631,20 @@ public class HillClimbing {
// 假设Machine类有拷贝方法,或使用MapStruct等工具进行映射
// 假设Machine类有拷贝方法,或使用MapStruct等工具进行映射
chromosome
.
setMachines
(
ProductionDeepCopyUtil
.
deepCopyList
(
machines
,
Machine
.
class
));
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setMachines
(
ProductionDeepCopyUtil
.
deepCopyList
(
machines
,
Machine
.
class
));
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setOrders
(
ProductionDeepCopyUtil
.
deepCopyList
(
new
CopyOnWriteArrayList
<>(
orders
),
Order
.
class
)
);
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setOperatRel
(
ProductionDeepCopyUtil
.
deepCopyList
(
new
CopyOnWriteArrayList
<>(
_entryRel
),
GroupResult
.
class
)
);
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setMaterials
(
ProductionDeepCopyUtil
.
deepCopyTreeMap
(
materials
,
String
.
class
,
Material
.
class
));
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setAllOperations
(
ProductionDeepCopyUtil
.
deepCopyList
(
new
CopyOnWriteArrayList
<>(
allOperations
),
Entry
.
class
)
);
// 简单拷贝,实际可能需要深拷贝
// 加载锁定工单到ResultOld
List
<
GAScheduleResult
>
lockedOrders
=
GlobalCacheUtil
.
get
(
"locked_orders_"
+
chromosome
.
getScenarioID
());
if
(
lockedOrders
!=
null
&&
!
lockedOrders
.
isEmpty
())
{
chromosome
.
setResultOld
(
ProductionDeepCopyUtil
.
deepCopyList
(
lockedOrders
,
GAScheduleResult
.
class
));
FileHelper
.
writeLogFile
(
"将 "
+
lockedOrders
.
size
()
+
" 个锁定工单加载到初始种群中"
);
}
else
{
chromosome
.
setResultOld
(
new
CopyOnWriteArrayList
<>());
}
}
}
// 并行解码所有候选方案
// 并行解码所有候选方案
...
...
src/main/java/com/aps/service/Algorithm/HybridAlgorithm.java
View file @
2728c661
...
@@ -485,6 +485,7 @@ public class HybridAlgorithm {
...
@@ -485,6 +485,7 @@ public class HybridAlgorithm {
chromosome
.
setMachines
(
ProductionDeepCopyUtil
.
deepCopyList
(
machines
,
Machine
.
class
));
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setMachines
(
ProductionDeepCopyUtil
.
deepCopyList
(
machines
,
Machine
.
class
));
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setOrders
(
ProductionDeepCopyUtil
.
deepCopyList
(
new
CopyOnWriteArrayList
<>(
orders
),
Order
.
class
)
);
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setOrders
(
ProductionDeepCopyUtil
.
deepCopyList
(
new
CopyOnWriteArrayList
<>(
orders
),
Order
.
class
)
);
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setOperatRel
(
ProductionDeepCopyUtil
.
deepCopyList
(
new
CopyOnWriteArrayList
<>(
_entryRel
),
GroupResult
.
class
)
);
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setOperatRel
(
ProductionDeepCopyUtil
.
deepCopyList
(
new
CopyOnWriteArrayList
<>(
_entryRel
),
GroupResult
.
class
)
);
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setMaterials
(
ProductionDeepCopyUtil
.
deepCopyTreeMap
(
materials
,
String
.
class
,
Material
.
class
));
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setMaterials
(
ProductionDeepCopyUtil
.
deepCopyTreeMap
(
materials
,
String
.
class
,
Material
.
class
));
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setAllOperations
(
ProductionDeepCopyUtil
.
deepCopyList
(
new
CopyOnWriteArrayList
<>(
allOperations
),
Entry
.
class
)
);
// 简单拷贝,实际可能需要深拷贝
chromosome
.
setAllOperations
(
ProductionDeepCopyUtil
.
deepCopyList
(
new
CopyOnWriteArrayList
<>(
allOperations
),
Entry
.
class
)
);
// 简单拷贝,实际可能需要深拷贝
...
...
src/main/java/com/aps/service/Algorithm/MaterialRequirementService.java
View file @
2728c661
...
@@ -1286,13 +1286,15 @@ if(demand==null)
...
@@ -1286,13 +1286,15 @@ if(demand==null)
if
(
material1
==
null
)
{
if
(
material1
==
null
)
{
break
;
break
;
}
}
FileHelper
.
writeLogFile
(
"RoutingSupportingReplace: "
+(
commitChanges
?
"1"
:
"0"
)+
" "
+
material1
.
getCode
()+
": "
+
useStock
);
OrderMaterialRequirement
orderMaterial1
=
MaterialStock
(
material1
,
rsr
.
getTargetmaterialid
(),
orderMaterial
.
getOrderId
(),
orderMaterial
.
getChildOrderId
(),
operationId
,
allneeded
,
needed
,
earliestStartTime
,
commitChanges
);
OrderMaterialRequirement
orderMaterial1
=
MaterialStock
(
material1
,
rsr
.
getTargetmaterialid
(),
orderMaterial
.
getOrderId
(),
orderMaterial
.
getChildOrderId
(),
operationId
,
allneeded
,
needed
,
earliestStartTime
,
commitChanges
);
if
(
orderMaterial1
!=
null
)
{
if
(
orderMaterial1
!=
null
)
{
useStock
=
orderMaterial1
.
getUseStock
();
useStock
=
orderMaterial1
.
getUseStock
();
needed
-=
useStock
;
needed
-=
useStock
;
FileHelper
.
writeLogFile
(
"RoutingSupportingReplace: "
+
material1
.
getCode
()+
": "
+
useStock
);
FileHelper
.
writeLogFile
(
"RoutingSupportingReplace: "
+
(
commitChanges
?
"1"
:
"0"
)+
" "
+
material1
.
getCode
()+
": "
+
useStock
);
orderMaterial
.
setUseStock
(
orderMaterial
.
getUseStock
()
+
useStock
);
orderMaterial
.
setUseStock
(
orderMaterial
.
getUseStock
()
+
useStock
);
orderMaterial
.
getReplaceMaterial
().
add
(
orderMaterial1
);
orderMaterial
.
getReplaceMaterial
().
add
(
orderMaterial1
);
if
(
needed
<=
0
)
{
if
(
needed
<=
0
)
{
...
...
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