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
e56eef9d
Commit
e56eef9d
authored
Mar 20, 2026
by
Tong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解码优化
parent
103266f2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
660 additions
and
62 deletions
+660
-62
FileHelper.java
src/main/java/com/aps/common/util/FileHelper.java
+1
-1
GeneticAlgorithm.java
...main/java/com/aps/service/Algorithm/GeneticAlgorithm.java
+3
-3
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+654
-56
MaterialRequirementService.java
...com/aps/service/Algorithm/MaterialRequirementService.java
+2
-2
No files found.
src/main/java/com/aps/common/util/FileHelper.java
View file @
e56eef9d
...
...
@@ -22,7 +22,7 @@ public class FileHelper {
String
filePath
=
LOG_FILE_PATH
+
date
+
LOG_FILE
;
try
(
PrintWriter
writer
=
new
PrintWriter
(
new
FileWriter
(
filePath
,
true
)))
{
String
timestamp
=
LocalDateTime
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
));
String
timestamp
=
LocalDateTime
.
now
().
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss
.SSS
"
));
writer
.
println
(
"["
+
timestamp
+
"] "
+
message
);
System
.
out
.
println
(
"["
+
timestamp
+
"] "
+
message
);
...
...
src/main/java/com/aps/service/Algorithm/GeneticAlgorithm.java
View file @
e56eef9d
...
...
@@ -118,11 +118,11 @@ public class GeneticAlgorithm {
FileHelper
.
writeLogFile
(
"初始化种群-----------开始-------"
);
// 步骤1:初始化种群
//
List<Chromosome> population = initialization.generateInitialPopulation(param, globalOpList);
List
<
Chromosome
>
population
=
initialization
.
generateInitialPopulation
(
param
,
globalOpList
);
// 步骤1:使用构造启发式算法生成初始种群
FileHelper
.
writeLogFile
(
"构造启发式初始化-----------开始-------"
);
List
<
Chromosome
>
population
=
initialization
.
generateHeuristicInitialPopulation
(
param
,
globalOpList
);
//
List<Chromosome> population = initialization.generateHeuristicInitialPopulation(param, globalOpList);
FileHelper
.
writeLogFile
(
"构造启发式初始化-----------结束-------"
);
...
...
@@ -477,7 +477,7 @@ return population;
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
(
decoder
,
chromosome
,
param
,
allOperations
,
globalOpList
),
decodeExecutor
))
...
...
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
e56eef9d
This diff is collapsed.
Click to expand it.
src/main/java/com/aps/service/Algorithm/MaterialRequirementService.java
View file @
e56eef9d
...
...
@@ -1140,7 +1140,7 @@ if(headers1==null)
* @return 包含物料需求列表和子订单列表的结果对象(替代C#的out参数)
*/
public
void
EditOperationBOM
(
Entry
operation
,
Chromosome
chromosome
,
LocalDateTime
earliestStartTime
,
GeneticDecoder
coder
)
{
public
void
EditOperationBOM
(
Entry
operation
,
Chromosome
chromosome
,
LocalDateTime
earliestStartTime
,
GeneticDecoder
coder
,
Map
<
Long
,
CopyOnWriteArrayList
<
GAScheduleResult
>>
machineTasksCache
)
{
List
<
OrderMaterialRequirement
>
materialRequirements
=
new
ArrayList
<>();
String
sceneId
=
chromosome
.
getScenarioID
();
...
...
@@ -1319,7 +1319,7 @@ if(headers1==null)
for
(
Integer
orderid
:
orderids
)
{
coder
.
ClearorderOperationResult
(
chromosome
,
orderid
);
coder
.
EditorderOperation
(
chromosome
,
orderid
,
needed
);
coder
.
EditorderOperation
(
chromosome
,
orderid
,
needed
,
machineTasksCache
);
}
}
else
{
...
...
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