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
c63d407d
Commit
c63d407d
authored
Feb 05, 2026
by
Tong Li
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/tl'
parents
f465ed23
9dbee6c0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
18 deletions
+22
-18
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+7
-6
MachineCalculator.java
...ain/java/com/aps/service/Algorithm/MachineCalculator.java
+9
-6
PlanResultServiceTest.java
src/test/java/com/aps/demo/PlanResultServiceTest.java
+6
-6
No files found.
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
c63d407d
...
@@ -280,7 +280,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
...
@@ -280,7 +280,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
public
void
decode
(
Chromosome
chromosome
)
{
public
void
decode
(
Chromosome
chromosome
)
{
//
List<OrderMaterialRequirement> orderMaterials = materialRequirementService.buildMultiLevelRequirementNetwork(chromosome, sceneId, baseTime,_globalParam);
List
<
OrderMaterialRequirement
>
orderMaterials
=
materialRequirementService
.
buildMultiLevelRequirementNetwork
(
chromosome
,
sceneId
,
baseTime
,
_globalParam
);
if
(
_globalParam
.
isIsCheckSf
())
{
if
(
_globalParam
.
isIsCheckSf
())
{
int
isnew
=
generateGlobalOpList
(
chromosome
);
int
isnew
=
generateGlobalOpList
(
chromosome
);
...
@@ -444,7 +444,11 @@ if(finishedOrder==null||finishedOrder.size()==0)
...
@@ -444,7 +444,11 @@ if(finishedOrder==null||finishedOrder.size()==0)
double
t
=
machineOption
.
getRuntime
().
doubleValue
()/
machineOption
.
getSingleOut
().
doubleValue
()*(
operation
.
getQuantity
());
double
t
=
machineOption
.
getRuntime
().
doubleValue
()/
machineOption
.
getSingleOut
().
doubleValue
()*(
operation
.
getQuantity
());
processingTimeTotal
=(
int
)
Math
.
ceil
(
t
);
processingTimeTotal
=(
int
)
Math
.
ceil
(
t
);
}
}
int
days
=(
int
)
((
processingTimeTotal
)/
24
/
3600
);
if
(
days
>
600
)
{
throw
new
RuntimeException
(
"工序总加工时长"
+
days
+
"天超出限制"
);
}
if
(
machine
==
null
||
operation
.
getMachineOptions
()==
null
)
if
(
machine
==
null
||
operation
.
getMachineOptions
()==
null
)
{
{
return
0
;
return
0
;
...
@@ -534,10 +538,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
...
@@ -534,10 +538,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
earliestStartTime
=
bomtime
;
earliestStartTime
=
bomtime
;
}
}
}
}
if
(
machine
.
getId
()==
2063
)
{
int
i
=
0
;
}
...
...
src/main/java/com/aps/service/Algorithm/MachineCalculator.java
View file @
c63d407d
...
@@ -520,10 +520,7 @@ public class MachineCalculator {
...
@@ -520,10 +520,7 @@ public class MachineCalculator {
CopyOnWriteArrayList
<
TimeSegment
>
timeSegments2
=
new
CopyOnWriteArrayList
<>(
timeSegments
.
subList
(
1
,
timeSegments
.
size
()-
1
));
CopyOnWriteArrayList
<
TimeSegment
>
timeSegments2
=
new
CopyOnWriteArrayList
<>(
timeSegments
.
subList
(
1
,
timeSegments
.
size
()-
1
));
if
(
timeSegments2
==
null
||
timeSegments2
.
size
()==
0
)
{
int
i
=
0
;
}
LocalDateTime
effectiveStart
=
timeSegments2
.
get
(
0
).
getStart
();
LocalDateTime
effectiveStart
=
timeSegments2
.
get
(
0
).
getStart
();
...
@@ -543,16 +540,19 @@ public class MachineCalculator {
...
@@ -543,16 +540,19 @@ public class MachineCalculator {
times
.
add
(
time
);
times
.
add
(
time
);
TimeSegment
shiftlast
=
timeSegments
.
get
(
timeSegments
.
size
()-
1
);
TimeSegment
shiftlast
=
timeSegments
.
get
(
timeSegments
.
size
()-
1
);
Map
<
Integer
,
Object
>
outMaplast
=
CreateScheduleResultDetail
(
shiftlast
,
st
,
remainingTime
,
oneTime
);
Map
<
Integer
,
Object
>
outMaplast
=
CreateScheduleResultDetail
(
shiftlast
,
st
,
remainingTime
,
oneTime
);
remainingTime
=(
int
)
outMaplast
.
get
(
1
);
remainingTime
=(
int
)
outMaplast
.
get
(
1
);
ScheduleResultDetail
timelast
=(
ScheduleResultDetail
)
outMaplast
.
get
(
2
);
ScheduleResultDetail
timelast
=(
ScheduleResultDetail
)
outMaplast
.
get
(
2
);
times
.
add
(
timelast
);
times
.
add
(
timelast
);
CopyOnWriteArrayList
<
TimeSegment
>
usedSegments2
=
RemoveMachineAvailable
(
machine
,
timelast
,
shiftlast
);
CopyOnWriteArrayList
<
TimeSegment
>
usedSegments2
=
RemoveMachineAvailable
(
machine
,
timelast
,
shiftlast
);
if
(
usedSegments2
!=
null
&&
usedSegments2
.
size
()
>
0
)
{
if
(
usedSegments2
!=
null
&&
usedSegments2
.
size
()
>
0
)
{
usedSegments
.
addAll
(
usedSegments2
);
usedSegments
.
addAll
(
usedSegments2
);
}
}
if
(
usedSegments
!=
null
&&
usedSegments
.
size
()
>
0
)
{
if
(
usedSegments
!=
null
&&
usedSegments
.
size
()
>
0
)
{
machine
.
getAvailability
().
addAll
(
usedSegments
);
machine
.
getAvailability
().
addAll
(
usedSegments
);
machine
.
getAvailability
().
sort
(
Comparator
.
comparing
(
TimeSegment:
:
getStart
));
machine
.
getAvailability
().
sort
(
Comparator
.
comparing
(
TimeSegment:
:
getStart
));
...
@@ -581,8 +581,11 @@ public class MachineCalculator {
...
@@ -581,8 +581,11 @@ public class MachineCalculator {
// 添加时间详情
// 添加时间详情
ScheduleResultDetail
time
=
new
ScheduleResultDetail
();
ScheduleResultDetail
time
=
new
ScheduleResultDetail
();
time
.
setKey
(
shift
.
getKey
());
time
.
setKey
(
shift
.
getKey
());
time
.
setStartTime
((
int
)
ChronoUnit
.
SECONDS
.
between
(
baseTime
,
effectiveStart
));
// time.setStartTime( (int)Duration.between(baseTime, effectiveStart).getSeconds());
time
.
setEndTime
((
int
)
ChronoUnit
.
SECONDS
.
between
(
baseTime
,
currentTime
));
// time.setEndTime( (int)Duration.between(baseTime, currentTime).getSeconds());
time
.
setStartTime
(
Math
.
abs
((
int
)
ChronoUnit
.
SECONDS
.
between
(
baseTime
,
effectiveStart
)));
time
.
setEndTime
(
Math
.
abs
((
int
)
ChronoUnit
.
SECONDS
.
between
(
baseTime
,
currentTime
)));
time
.
setQuantity
((
int
)(
processable
/
oneTime
));
time
.
setQuantity
((
int
)(
processable
/
oneTime
));
time
.
setOneTime
(
oneTime
);
time
.
setOneTime
(
oneTime
);
Map
<
Integer
,
Object
>
outMap
=
new
HashMap
<>();
Map
<
Integer
,
Object
>
outMap
=
new
HashMap
<>();
...
...
src/test/java/com/aps/demo/PlanResultServiceTest.java
View file @
c63d407d
...
@@ -39,7 +39,7 @@ public class PlanResultServiceTest {
...
@@ -39,7 +39,7 @@ public class PlanResultServiceTest {
// TestSortService sortService=new TestSortService();
// TestSortService sortService=new TestSortService();
// sortService.test1();
// sortService.test1();
// nsgaiiUtils.Test();
// nsgaiiUtils.Test();
//
planResultService.execute2("1BC8FFD1A7D54AE7AA75D2CBC7C08080");
planResultService
.
execute2
(
"1BC8FFD1A7D54AE7AA75D2CBC7C08080"
);
// planResultService.execute2("00E0C5D3E4AD4F36B56C39395906618D");
// planResultService.execute2("00E0C5D3E4AD4F36B56C39395906618D");
// planResultService.execute2("726D4C1A712B4B1393175BD44B775B66");
// planResultService.execute2("726D4C1A712B4B1393175BD44B775B66");
...
@@ -51,11 +51,11 @@ public class PlanResultServiceTest {
...
@@ -51,11 +51,11 @@ public class PlanResultServiceTest {
// planResultService.Redecode("27065EA0ECD14A81B7FAAFEF52273F93");
// planResultService.Redecode("27065EA0ECD14A81B7FAAFEF52273F93");
// planResultService.Redecode("00E0C5D3E4AD4F36B56C39395906618D");
// planResultService.Redecode("00E0C5D3E4AD4F36B56C39395906618D");
// planResultService.Drag("27065EA0ECD14A81B7FAAFEF52273F93",opids,6,false,0l);
// planResultService.Drag("27065EA0ECD14A81B7FAAFEF52273F93",opids,6,false,0l);
MaintenanceWindow
maintenanceWindow
=
new
MaintenanceWindow
();
//
MaintenanceWindow maintenanceWindow=new MaintenanceWindow();
maintenanceWindow
.
setStartTime
(
LocalDateTime
.
of
(
2026
,
2
,
4
,
0
,
0
,
0
));
//
maintenanceWindow.setStartTime(LocalDateTime.of(2026, 2, 4, 0, 0, 0));
maintenanceWindow
.
setEndTime
(
LocalDateTime
.
of
(
2025
,
2
,
5
,
0
,
0
,
0
));
//
maintenanceWindow.setEndTime(LocalDateTime.of(2025, 2, 5, 0, 0, 0));
planResultService
.
AddMaintenanceWindow
(
"00E0C5D3E4AD4F36B56C39395906618D"
,
2492
l
,
maintenanceWindow
);
//
planResultService.AddMaintenanceWindow("00E0C5D3E4AD4F36B56C39395906618D",2492l,maintenanceWindow);
// planResultService.DelOperation("B6AE363FF5044DDF8DECE32D5FE0F7EA",7);
//
// planResultService.DelOperation("B6AE363FF5044DDF8DECE32D5FE0F7EA",7);
// planResultService.SpiltOrder("A41D662EE0764D008173C5A0E42B15F6","5f9d5383-b89a-4a4f-8805-2f617c711968",new Double[]{500d, 500d});
// planResultService.SpiltOrder("A41D662EE0764D008173C5A0E42B15F6","5f9d5383-b89a-4a4f-8805-2f617c711968",new Double[]{500d, 500d});
}
}
...
...
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