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
cb20ded9
Commit
cb20ded9
authored
Jun 18, 2026
by
Tong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
a94f7c82
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
316 additions
and
115 deletions
+316
-115
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+11
-10
HybridAlgorithm.java
src/main/java/com/aps/service/Algorithm/HybridAlgorithm.java
+2
-1
VariableNeighborhoodSearch.java
...com/aps/service/Algorithm/VariableNeighborhoodSearch.java
+300
-101
PlanResultService.java
src/main/java/com/aps/service/plan/PlanResultService.java
+2
-2
PlanResultServiceTest.java
src/test/java/com/aps/demo/PlanResultServiceTest.java
+1
-1
No files found.
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
cb20ded9
...
...
@@ -788,7 +788,7 @@ public class GeneticDecoder {
Entry
currentOp
=
orderOps
.
get
(
scheduledCount
);
FileHelper
.
writeLogFile
(
"工序:"
+
currentOp
.
getId
());
int
opSequence
=
currentOp
.
getSequence
();
...
...
@@ -863,7 +863,8 @@ public class GeneticDecoder {
orderProcessCounter
.
put
(
groupId
,
orderProcessCounter
.
get
(
groupId
)
+
1
);
orderLastEndTime
.
put
(
groupId
,
actualEndTime
);
if
(
isJit
&&
orderProcessCounter
.
get
(
groupId
)
>=
entrysBygroupId
.
get
(
groupId
).
size
())
{
if
(
false
){
// if (isJit&& orderProcessCounter.get(groupId) >= entrysBygroupId.get(groupId).size()) {
List
<
Entry
>
orderOpsBySeq
=
entrysBygroupId
.
get
(
groupId
).
stream
()
.
sorted
(
Comparator
.
comparingInt
(
Entry:
:
getSequence
))
...
...
@@ -1503,10 +1504,10 @@ public class GeneticDecoder {
Entry
op
=
entryIndexById
.
get
(
result
.
getOperationId
());
Map
<
String
,
MaterialDeduction
>
deductions
=
readOperationStockDeductions
(
op
);
if
(
deductions
!=
null
&&
!
deductions
.
isEmpty
())
{
rollbackOperationStockDeduction
(
chromosome
,
deductions
);
}
//
Map<String, MaterialDeduction> deductions = readOperationStockDeductions(op);
//
if (deductions != null && !deductions.isEmpty()) {
//
rollbackOperationStockDeduction(chromosome, deductions);
//
}
}
machineTasksCache
.
clear
();
...
...
@@ -1540,10 +1541,10 @@ public class GeneticDecoder {
Entry
op
=
entryIndexById
.
get
(
result
.
getOperationId
());
Map
<
String
,
MaterialDeduction
>
deductions
=
readOperationStockDeductions
(
op
);
if
(
deductions
!=
null
&&
!
deductions
.
isEmpty
())
{
rollbackOperationStockDeduction
(
chromosome
,
deductions
);
}
//
Map<String, MaterialDeduction> deductions = readOperationStockDeductions(op);
//
if (deductions != null && !deductions.isEmpty()) {
//
rollbackOperationStockDeduction(chromosome, deductions);
//
}
Machine
machine
=
getMachineById
(
chromosome
,
result
.
getMachineId
());
if
(
machine
!=
null
)
{
AddMachineAvailable
(
machine
,
result
.
getGeneDetails
());
...
...
src/main/java/com/aps/service/Algorithm/HybridAlgorithm.java
View file @
cb20ded9
...
...
@@ -115,6 +115,7 @@ public class HybridAlgorithm {
List
<
GlobalOperationInfo
>
globalOpList
=
new
ArrayList
<>();
// initialization.generateGlobalOpList();
// 初始化变邻域搜索
_vns
=
new
VariableNeighborhoodSearch
(
allOperations
,
orders
,
materials
,
_entryRel
,
_fitnessCalculator
);
_vns
.
initMachineSelectFrequency
();
_hillClimbing
=
new
HillClimbing
(
allOperations
,
orders
,
materials
,
_entryRel
,
_fitnessCalculator
);
_simulatedAnnealing
=
new
SimulatedAnnealing
(
allOperations
,
orders
,
materials
,
_entryRel
,
_fitnessCalculator
);
_tabuSearch
=
new
TabuSearch
(
allOperations
,
orders
,
materials
,
_entryRel
,
_fitnessCalculator
);
...
...
@@ -464,7 +465,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/java/com/aps/service/Algorithm/VariableNeighborhoodSearch.java
View file @
cb20ded9
This diff is collapsed.
Click to expand it.
src/main/java/com/aps/service/plan/PlanResultService.java
View file @
cb20ded9
...
...
@@ -177,8 +177,8 @@ public class PlanResultService {
* 后续会按场景创建人自动回退到可用的策略配置。
*/
public
Chromosome
execute2
(
String
SceneId
)
{
return
execute2
(
SceneId
,
2361
l
,
241
l
,
null
);
//
return execute2(SceneId, 2321l, 207l, null);
//
return execute2(SceneId, 2361l, 241l, null);
return
execute2
(
SceneId
,
2321
l
,
207
l
,
null
);
}
...
...
src/test/java/com/aps/demo/PlanResultServiceTest.java
View file @
cb20ded9
...
...
@@ -42,7 +42,7 @@ public class PlanResultServiceTest {
// nsgaiiUtils.Test();
// planResultService.execute2("64E64F6B68094AF38CEDC418630C3CC2");//2000
//
planResultService.execute2("E1448B3C9C8743DEAB39708F2CFE348A");//倒排bomces
//
planResultService.execute2("E1448B3C9C8743DEAB39708F2CFE348A");//倒排bomces
planResultService
.
execute2
(
"197083D0D26A449EB179AC103C753FD3"
);
// planResultService.execute2("9FEDFD92BB6A4675BF9B1CC64505D1AB");
...
...
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