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
51cf694a
Commit
51cf694a
authored
Feb 03, 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
d080df16
250695e0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
192 additions
and
36 deletions
+192
-36
Machine.java
src/main/java/com/aps/entity/basic/Machine.java
+6
-0
GeneticDecoder.java
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
+145
-21
MachineCalculator.java
...ain/java/com/aps/service/Algorithm/MachineCalculator.java
+7
-4
MaterialRequirementService.java
...com/aps/service/Algorithm/MaterialRequirementService.java
+3
-0
ScheduleOperationService.java
...a/com/aps/service/Algorithm/ScheduleOperationService.java
+29
-1
DiscreteParameterDurationServiceImpl.java
...ps/service/impl/DiscreteParameterDurationServiceImpl.java
+1
-9
PlanResultServiceTest.java
src/test/java/com/aps/demo/PlanResultServiceTest.java
+1
-1
No files found.
src/main/java/com/aps/entity/basic/Machine.java
View file @
51cf694a
package
com
.
aps
.
entity
.
basic
;
package
com
.
aps
.
entity
.
basic
;
import
com.aps.entity.Algorithm.GAScheduleResult
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -27,6 +28,11 @@ public class Machine {
...
@@ -27,6 +28,11 @@ public class Machine {
*/
*/
private
int
earliestTime
=
0
;
private
int
earliestTime
=
0
;
/**
* 最后的任务,默认值:0
*/
private
GAScheduleResult
lastGene
=
null
;
/**
/**
* 总任务时间
* 总任务时间
*/
*/
...
...
src/main/java/com/aps/service/Algorithm/GeneticDecoder.java
View file @
51cf694a
This diff is collapsed.
Click to expand it.
src/main/java/com/aps/service/Algorithm/MachineCalculator.java
View file @
51cf694a
...
@@ -271,10 +271,13 @@ public class MachineCalculator {
...
@@ -271,10 +271,13 @@ public class MachineCalculator {
Machine
machine
,
int
processingTime
,
LocalDateTime
currentTime
,
Machine
machine
,
int
processingTime
,
LocalDateTime
currentTime
,
String
prevtime
,
CopyOnWriteArrayList
<
GAScheduleResult
>
existingTasks
,
double
oneTime
,
double
quantity
,
boolean
checkprevtime
,
boolean
islockMachineTime
String
prevtime
,
CopyOnWriteArrayList
<
GAScheduleResult
>
existingTasks
,
double
oneTime
,
double
quantity
,
boolean
checkprevtime
,
boolean
islockMachineTime
,
boolean
isInterrupt
)
{
,
boolean
isInterrupt
)
{
CopyOnWriteArrayList
<
GAScheduleResult
>
machineTasks
=
existingTasks
.
stream
()
CopyOnWriteArrayList
<
GAScheduleResult
>
machineTasks
=
null
;
.
filter
(
t
->
t
.
getMachineId
()
==
machine
.
getId
())
if
(
existingTasks
!=
null
)
{
.
sorted
(
Comparator
.
comparingInt
(
GAScheduleResult:
:
getStartTime
))
machineTasks
=
existingTasks
.
stream
()
.
collect
(
Collectors
.
toCollection
(
CopyOnWriteArrayList:
:
new
));
.
filter
(
t
->
t
.
getMachineId
()
==
machine
.
getId
())
.
sorted
(
Comparator
.
comparingInt
(
GAScheduleResult:
:
getStartTime
))
.
collect
(
Collectors
.
toCollection
(
CopyOnWriteArrayList:
:
new
));
}
CopyOnWriteArrayList
<
ScheduleResultDetail
>
times
=
new
CopyOnWriteArrayList
<>();
CopyOnWriteArrayList
<
ScheduleResultDetail
>
times
=
new
CopyOnWriteArrayList
<>();
...
...
src/main/java/com/aps/service/Algorithm/MaterialRequirementService.java
View file @
51cf694a
...
@@ -276,6 +276,8 @@ public class MaterialRequirementService {
...
@@ -276,6 +276,8 @@ public class MaterialRequirementService {
.
eq
(
Routingsupporting:
:
getIsdeleted
,
0
);
.
eq
(
Routingsupporting:
:
getIsdeleted
,
0
);
routingsupportings1
=
routingsupportingMapper
.
selectList
(
routingsupportingwrapper
);
routingsupportings1
=
routingsupportingMapper
.
selectList
(
routingsupportingwrapper
);
if
(
routingsupportings1
!=
null
&&
routingsupportings1
.
size
()>
0
)
{
routingsupportings
.
addAll
(
routingsupportings1
);
routingsupportings
.
addAll
(
routingsupportings1
);
List
<
String
>
routingsupportingids
=
routingsupportings1
.
stream
()
List
<
String
>
routingsupportingids
=
routingsupportings1
.
stream
()
...
@@ -338,6 +340,7 @@ public class MaterialRequirementService {
...
@@ -338,6 +340,7 @@ public class MaterialRequirementService {
}
}
}
}
}
}
}
}
}
if
(
routingIds1
!=
null
)
if
(
routingIds1
!=
null
)
{
{
...
...
src/main/java/com/aps/service/Algorithm/ScheduleOperationService.java
View file @
51cf694a
...
@@ -201,7 +201,6 @@ int newStartTime=0;
...
@@ -201,7 +201,6 @@ int newStartTime=0;
}
}
/**
/**
* 移动工序方法
* 移动工序方法
* @param chromosome 染色体对象
* @param chromosome 染色体对象
...
@@ -212,6 +211,35 @@ int newStartTime=0;
...
@@ -212,6 +211,35 @@ int newStartTime=0;
public
void
moveOperation
(
Chromosome
chromosome
,
List
<
Integer
>
opIds
,
int
newStartTime
,
public
void
moveOperation
(
Chromosome
chromosome
,
List
<
Integer
>
opIds
,
int
newStartTime
,
Long
newMachineId
,
GlobalParam
globalParam
,
int
lockStartTime
)
{
Long
newMachineId
,
GlobalParam
globalParam
,
int
lockStartTime
)
{
List
<
Entry
>
allOperations
=
chromosome
.
getAllOperations
();
List
<
Entry
>
allOperations
=
chromosome
.
getAllOperations
();
for
(
Integer
opId:
opIds
)
{
GAScheduleResult
targetResults
=
chromosome
.
getResult
().
stream
()
.
filter
(
r
->
r
.
getOperationId
()
==
opId
).
findFirst
()
.
orElseThrow
(()
->
new
NoSuchElementException
(
"Operation not found: "
+
opId
));
targetResults
.
setLockStartTime
(
1
);
targetResults
.
setDesignatedStartTime
(
newStartTime
);
Entry
targetOp
=
allOperations
.
stream
()
.
filter
(
o
->
o
.
getId
()
==
opId
)
.
findFirst
()
.
orElseThrow
(()
->
new
NoSuchElementException
(
"Operation not found: "
+
opId
));
targetOp
.
setDesignatedStartTime
(
chromosome
.
getBaseTime
().
plusSeconds
(
newStartTime
));
}
redecode
(
chromosome
,
chromosome
.
getBaseTime
(),
globalParam
);
}
/**
* 移动工序方法
* @param chromosome 染色体对象
* @param opIds 工序ID
* @param newStartTime 新开始时间
* @param newMachineId 新设备ID
*/
public
void
moveOperation1
(
Chromosome
chromosome
,
List
<
Integer
>
opIds
,
int
newStartTime
,
Long
newMachineId
,
GlobalParam
globalParam
,
int
lockStartTime
)
{
List
<
Entry
>
allOperations
=
chromosome
.
getAllOperations
();
int
newStartTime1
=
newStartTime
;
int
newStartTime1
=
newStartTime
;
...
...
src/main/java/com/aps/service/impl/DiscreteParameterDurationServiceImpl.java
View file @
51cf694a
...
@@ -28,7 +28,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
...
@@ -28,7 +28,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
Machine
machine
,
Machine
machine
,
List
<
Entry
>
allOperations
,
int
startTime
,
List
<
GAScheduleResult
>
machineTasks
)
{
List
<
Entry
>
allOperations
,
int
startTime
,
List
<
GAScheduleResult
>
machineTasks
)
{
if
(
machineTasks
.
isEmpty
())
{
if
(
machineTasks
==
null
||
machineTasks
.
isEmpty
())
{
return
0.0
;
return
0.0
;
}
}
...
@@ -38,15 +38,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
...
@@ -38,15 +38,7 @@ public class DiscreteParameterDurationServiceImpl extends ServiceImpl<DiscretePa
return
0.0
;
return
0.0
;
}
}
// 获取设备上最后一个任务
GAScheduleResult
lastGene
=
machineTasks
.
stream
()
.
filter
(
g
->
g
.
getMachineId
()
==
machine
.
getId
())
.
max
(
Comparator
.
comparingInt
(
GAScheduleResult:
:
getEndTime
))
.
orElse
(
null
);
if
(
lastGene
==
null
)
{
return
0.0
;
}
...
...
src/test/java/com/aps/demo/PlanResultServiceTest.java
View file @
51cf694a
...
@@ -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
(
"
EDDAFBAC0BD84375B7CF89BC85255082
"
);
planResultService
.
execute2
(
"
18E5F8BE09B14EAE822651BFEF100900
"
);
// planResultService.execute2("726D4C1A712B4B1393175BD44B775B66");
// planResultService.execute2("726D4C1A712B4B1393175BD44B775B66");
// planResultService.execute2("265F24B6DF3C40E4B17D193B0CC8AAF2");
// planResultService.execute2("265F24B6DF3C40E4B17D193B0CC8AAF2");
// LocalDateTime t= LocalDateTime.of(2026, 02, 14, 1, 25, 52);
// LocalDateTime t= LocalDateTime.of(2026, 02, 14, 1, 25, 52);
...
...
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