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
7484ece0
Commit
7484ece0
authored
Apr 24, 2026
by
Tong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
变领域优化
parent
b17004da
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
40 deletions
+84
-40
GeneticOperations.java
...ain/java/com/aps/service/Algorithm/GeneticOperations.java
+23
-18
VariableNeighborhoodSearch.java
...com/aps/service/Algorithm/VariableNeighborhoodSearch.java
+61
-22
No files found.
src/main/java/com/aps/service/Algorithm/GeneticOperations.java
View file @
7484ece0
...
...
@@ -595,53 +595,58 @@ public class GeneticOperations {
return
indexWeights
.
get
(
CommonCalculator
.
getOsIndex
(
indexWeights
));
}
public
void
DelOrder
(
Chromosome
chromosome
)
{
List
<
Entry
>
allOperations
=
chromosome
.
getAllOperations
();
List
<
GlobalOperationInfo
>
globalOpList
=
chromosome
.
getGlobalOpList
();
if
(
chromosome
.
getOrders
()==
null
||
chromosome
.
getOrders
().
size
()==
0
)
return
;
List
<
Order
>
orders
=
chromosome
.
getOrders
();
List
<
Integer
>
OperationSequencing
=
chromosome
.
getOperationSequencing
();
log
(
"删除前"
+
OperationSequencing
.
size
(),
true
);
log
(
String
.
format
(
"半成品订单-删除前,工序: %d,工序序列: %d,设备: %d,设备序列: %d"
,
allOperations
.
size
(),
OperationSequencing
.
size
(),
globalOpList
.
size
(),
chromosome
.
getMachineSelection
().
size
()),
true
);
List
<
Integer
>
newoorderids
=
orders
.
stream
()
.
filter
(
t
->
t
.
isNewSfCreate
())
.
map
(
Order:
:
getId
)
.
sorted
(
Comparator
.
reverseOrder
())
.
collect
(
Collectors
.
toList
());
if
(
newoorderids
!=
null
&&
newoorderids
.
size
()>
0
)
{
List
<
Entry
>
allOperations
=
chromosome
.
getAllOperations
();
List
<
GlobalOperationInfo
>
globalOpList
=
chromosome
.
getGlobalOpList
();
List
<
Integer
>
OperationSequencing
=
chromosome
.
getOperationSequencing
();
log
(
String
.
format
(
"半成品订单-删除前,工序: %d,工序序列: %d,设备: %d,设备序列: %d"
,
allOperations
.
size
(),
OperationSequencing
.
size
(),
globalOpList
.
size
(),
chromosome
.
getMachineSelection
().
size
()),
true
);
for
(
Integer
id
:
newoorderids
)
{
List
<
Entry
>
sourceOps
=
allOperations
.
stream
()
.
filter
(
o
->
o
.
getGroupId
()
==
id
)
.
filter
(
o
->
o
.
getGroupId
()
==
id
)
.
sorted
(
Comparator
.
comparing
(
Entry:
:
getSequence
))
.
collect
(
Collectors
.
toList
());
for
(
Entry
entry
:
sourceOps
)
{
OptionalInt
index1
=
IntStream
.
range
(
0
,
globalOpList
.
size
())
.
filter
(
h
->
entry
.
getId
()
==
globalOpList
.
get
(
h
).
getOp
().
getId
())
.
filter
(
h
->
entry
.
getId
()
==
globalOpList
.
get
(
h
).
getOp
().
getId
())
.
findFirst
();
globalOpList
.
remove
((
int
)
index1
.
orElse
(
0
));
globalOpList
.
remove
((
int
)
index1
.
orElse
(
0
));
chromosome
.
getMachineSelection
().
remove
((
int
)
index1
.
orElse
(
0
));
chromosome
.
getMachineSelection
().
remove
((
int
)
index1
.
orElse
(
0
));
}
chromosome
.
getOperatRel
().
remove
(
id
-
1
);
chromosome
.
getOperatRel
().
remove
(
id
-
1
);
}
allOperations
.
removeIf
(
t
->
newoorderids
.
contains
(
t
.
getGroupId
()));
OperationSequencing
.
removeIf
(
t
->
newoorderids
.
contains
(
t
));
allOperations
.
removeIf
(
t
->
newoorderids
.
contains
(
t
.
getGroupId
()));
OperationSequencing
.
removeIf
(
t
->
newoorderids
.
contains
(
t
));
AtomicInteger
globalOpId
=
new
AtomicInteger
(
0
);
globalOpList
.
forEach
(
t
->
{
globalOpList
.
forEach
(
t
->
{
t
.
setGlobalOpId
(
globalOpId
.
getAndIncrement
());
});
orders
.
removeIf
(
t
->
newoorderids
.
contains
(
t
.
getId
()));
orders
.
removeIf
(
t
->
newoorderids
.
contains
(
t
.
getId
()));
log
(
String
.
format
(
"半成品订单-删除后,工序: %d,工序序列: %d,设备: %d,设备序列: %d"
,
allOperations
.
size
(),
OperationSequencing
.
size
(),
globalOpList
.
size
(),
chromosome
.
getMachineSelection
().
size
()),
true
);
}
}
private
void
log
(
String
message
,
boolean
enableLogging
)
{
...
...
src/main/java/com/aps/service/Algorithm/VariableNeighborhoodSearch.java
View file @
7484ece0
This diff is collapsed.
Click to expand it.
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