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
316ec27e
Commit
316ec27e
authored
Feb 05, 2026
by
DESKTOP-VKRD9QF\Administration
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://39.100.78.207:1213/tongli/hyh.apsj
parents
a7f09c7c
c63d407d
Show 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 @
316ec27e
...
...
@@ -280,7 +280,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
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
())
{
int
isnew
=
generateGlobalOpList
(
chromosome
);
...
...
@@ -444,7 +444,11 @@ if(finishedOrder==null||finishedOrder.size()==0)
double
t
=
machineOption
.
getRuntime
().
doubleValue
()/
machineOption
.
getSingleOut
().
doubleValue
()*(
operation
.
getQuantity
());
processingTimeTotal
=(
int
)
Math
.
ceil
(
t
);
}
int
days
=(
int
)
((
processingTimeTotal
)/
24
/
3600
);
if
(
days
>
600
)
{
throw
new
RuntimeException
(
"工序总加工时长"
+
days
+
"天超出限制"
);
}
if
(
machine
==
null
||
operation
.
getMachineOptions
()==
null
)
{
return
0
;
...
...
@@ -534,10 +538,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
earliestStartTime
=
bomtime
;
}
}
if
(
machine
.
getId
()==
2063
)
{
int
i
=
0
;
}
...
...
src/main/java/com/aps/service/Algorithm/MachineCalculator.java
View file @
316ec27e
...
...
@@ -520,10 +520,7 @@ public class MachineCalculator {
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
();
...
...
@@ -543,16 +540,19 @@ public class MachineCalculator {
times
.
add
(
time
);
TimeSegment
shiftlast
=
timeSegments
.
get
(
timeSegments
.
size
()-
1
);
Map
<
Integer
,
Object
>
outMaplast
=
CreateScheduleResultDetail
(
shiftlast
,
st
,
remainingTime
,
oneTime
);
remainingTime
=(
int
)
outMaplast
.
get
(
1
);
ScheduleResultDetail
timelast
=(
ScheduleResultDetail
)
outMaplast
.
get
(
2
);
times
.
add
(
timelast
);
CopyOnWriteArrayList
<
TimeSegment
>
usedSegments2
=
RemoveMachineAvailable
(
machine
,
timelast
,
shiftlast
);
if
(
usedSegments2
!=
null
&&
usedSegments2
.
size
()
>
0
)
{
usedSegments
.
addAll
(
usedSegments2
);
}
if
(
usedSegments
!=
null
&&
usedSegments
.
size
()
>
0
)
{
machine
.
getAvailability
().
addAll
(
usedSegments
);
machine
.
getAvailability
().
sort
(
Comparator
.
comparing
(
TimeSegment:
:
getStart
));
...
...
@@ -581,8 +581,11 @@ public class MachineCalculator {
// 添加时间详情
ScheduleResultDetail
time
=
new
ScheduleResultDetail
();
time
.
setKey
(
shift
.
getKey
());
time
.
setStartTime
((
int
)
ChronoUnit
.
SECONDS
.
between
(
baseTime
,
effectiveStart
));
time
.
setEndTime
((
int
)
ChronoUnit
.
SECONDS
.
between
(
baseTime
,
currentTime
));
// time.setStartTime( (int)Duration.between(baseTime, effectiveStart).getSeconds());
// 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
.
setOneTime
(
oneTime
);
Map
<
Integer
,
Object
>
outMap
=
new
HashMap
<>();
...
...
src/test/java/com/aps/demo/PlanResultServiceTest.java
View file @
316ec27e
...
...
@@ -39,7 +39,7 @@ public class PlanResultServiceTest {
// TestSortService sortService=new TestSortService();
// sortService.test1();
// nsgaiiUtils.Test();
//
planResultService.execute2("1BC8FFD1A7D54AE7AA75D2CBC7C08080");
planResultService
.
execute2
(
"1BC8FFD1A7D54AE7AA75D2CBC7C08080"
);
// planResultService.execute2("00E0C5D3E4AD4F36B56C39395906618D");
// planResultService.execute2("726D4C1A712B4B1393175BD44B775B66");
...
...
@@ -51,11 +51,11 @@ public class PlanResultServiceTest {
// planResultService.Redecode("27065EA0ECD14A81B7FAAFEF52273F93");
// planResultService.Redecode("00E0C5D3E4AD4F36B56C39395906618D");
// planResultService.Drag("27065EA0ECD14A81B7FAAFEF52273F93",opids,6,false,0l);
MaintenanceWindow
maintenanceWindow
=
new
MaintenanceWindow
();
maintenanceWindow
.
setStartTime
(
LocalDateTime
.
of
(
2026
,
2
,
4
,
0
,
0
,
0
));
maintenanceWindow
.
setEndTime
(
LocalDateTime
.
of
(
2025
,
2
,
5
,
0
,
0
,
0
));
planResultService
.
AddMaintenanceWindow
(
"00E0C5D3E4AD4F36B56C39395906618D"
,
2492
l
,
maintenanceWindow
);
// planResultService.DelOperation("B6AE363FF5044DDF8DECE32D5FE0F7EA",7);
//
MaintenanceWindow maintenanceWindow=new MaintenanceWindow();
//
maintenanceWindow.setStartTime(LocalDateTime.of(2026, 2, 4, 0, 0, 0));
//
maintenanceWindow.setEndTime(LocalDateTime.of(2025, 2, 5, 0, 0, 0));
//
planResultService.AddMaintenanceWindow("00E0C5D3E4AD4F36B56C39395906618D",2492l,maintenanceWindow);
//
// planResultService.DelOperation("B6AE363FF5044DDF8DECE32D5FE0F7EA",7);
// 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