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
b0d9e31b
Commit
b0d9e31b
authored
Dec 11, 2025
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
2cda60b4
e647dc92
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
407 additions
and
5 deletions
+407
-5
Chromosome.java
src/main/java/com/aps/entity/Algorithm/Chromosome.java
+41
-0
ConfigSetting.java
src/main/java/com/aps/entity/ConfigSetting.java
+15
-0
StrategyScheduling.java
src/main/java/com/aps/entity/StrategyScheduling.java
+13
-0
Machine.java
src/main/java/com/aps/entity/basic/Machine.java
+4
-0
Order.java
src/main/java/com/aps/entity/basic/Order.java
+8
-0
KpiCalculator.java
src/main/java/com/aps/service/Algorithm/KpiCalculator.java
+291
-0
ScheduleOperationService.java
...a/com/aps/service/Algorithm/ScheduleOperationService.java
+4
-0
PlanResultService.java
src/main/java/com/aps/service/plan/PlanResultService.java
+31
-5
No files found.
src/main/java/com/aps/entity/Algorithm/Chromosome.java
View file @
b0d9e31b
...
...
@@ -115,4 +115,45 @@ public class Chromosome {
private
String
ScenarioName
;
private
LocalDateTime
BaseTime
;
// 当前基准时间
//最大设备利用率
private
double
machineMaxRate
;
//最小设备利用率
private
double
machineMinRate
;
//设备等待时长
private
double
machineWaitTime
;
//订单及时完成率
private
double
orderOnTime
;
//最大延迟
private
double
orderMaxDelay
;
//最小延迟
private
double
orderMinDelay
;
//平均延迟
private
double
orderAvgDelay
;
//最长生产周期
private
double
orderMaxProductTime
;
//最短生产周期
private
double
orderMinProductTime
;
//平均生产周期
private
double
orderAvgProductTime
;
//最大流量
private
double
orderMaxFlow
;
//最小流量
private
double
orderMinFlow
;
//平均流量
private
double
orderAvgFlow
;
}
src/main/java/com/aps/entity/ConfigSetting.java
0 → 100644
View file @
b0d9e31b
package
com
.
aps
.
entity
;
import
lombok.Data
;
/**
* 作者:佟礼
* 时间:2025-12-10
*/
@Data
public
class
ConfigSetting
{
private
int
id
;
private
String
title
;
private
boolean
value
;
private
String
content
;
}
src/main/java/com/aps/entity/StrategyScheduling.java
0 → 100644
View file @
b0d9e31b
package
com
.
aps
.
entity
;
/**
* 作者:佟礼
* 时间:2025-12-10
*/
public
class
StrategyScheduling
{
private
String
name
;
private
String
title
;
private
String
content
;
private
int
amplitude
;
private
boolean
value
;
}
src/main/java/com/aps/entity/basic/Machine.java
View file @
b0d9e31b
...
...
@@ -19,6 +19,10 @@ public class Machine {
private
List
<
Holiday
>
holidays
;
private
double
actualWorkTime
;
private
double
rate
;
// 事件回调
private
Consumer
<
Void
>
shiftsChanged
;
private
Consumer
<
Void
>
maintenanceWindowsChanged
;
...
...
src/main/java/com/aps/entity/basic/Order.java
View file @
b0d9e31b
...
...
@@ -22,6 +22,12 @@ public class Order {
private
LocalDateTime
dueDate
;
private
LocalDateTime
orderCompletion
;
private
LocalDateTime
orderStart
;
private
double
machineProcessingTime
;
private
double
orderFlow
;
private
double
orderProductTime
;
private
double
tardiness
;
private
int
priority
;
private
boolean
canSplit
=
false
;
...
...
@@ -30,4 +36,6 @@ public class Order {
private
String
mainId
;
/*使用这个半成品的成品工单*/
public
List
<
String
>
FinishOrderId
;
private
double
delayHours
;
//延迟时间
}
\ No newline at end of file
src/main/java/com/aps/service/Algorithm/KpiCalculator.java
0 → 100644
View file @
b0d9e31b
This diff is collapsed.
Click to expand it.
src/main/java/com/aps/service/Algorithm/ScheduleOperationService.java
View file @
b0d9e31b
...
...
@@ -650,6 +650,10 @@ public class ScheduleOperationService {
decoder
.
decode
(
chromosome
);
KpiCalculator
kpiCalculator
=
new
KpiCalculator
(
chromosome
);
kpiCalculator
.
calculatekpi
();
// if(chromosome.getWeightedObjective()==0) {
//
// double[] normalized = objectiveWeights.normalizeObjectives(chromosome.getObjectives(), null, null);
...
...
src/main/java/com/aps/service/plan/PlanResultService.java
View file @
b0d9e31b
...
...
@@ -13,10 +13,7 @@ import com.aps.entity.Schedule.GenVO;
import
com.aps.entity.Schedule.MachineVO
;
import
com.aps.entity.basic.*
;
import
com.aps.service.*
;
import
com.aps.service.Algorithm.GeneticAlgorithm
;
import
com.aps.service.Algorithm.IdGroupingWithDualSerial
;
import
com.aps.service.Algorithm.RoutingDataService
;
import
com.aps.service.Algorithm.ScheduleOperationService
;
import
com.aps.service.Algorithm.*
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -73,6 +70,16 @@ public class PlanResultService {
@Autowired
private
RoutingDataService
_routingDataService
;
@Autowired
private
ConfigService
_configService
;
@Autowired
private
StrategyRuleService
_strategyRuleService
;
private
LocalDateTime
baseTime
=
LocalDateTime
.
of
(
2025
,
11
,
1
,
0
,
0
,
0
);
public
List
<
ScheduleChromosome
>
execute
()
{
...
...
@@ -305,12 +312,27 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
List
<
Entry
>
entrys
=(
List
<
Entry
>)
list
.
get
(
1
);
List
<
GroupResult
>
entryRel
=(
List
<
GroupResult
>)
list
.
get
(
2
);
Config
config
=
_configService
.
lambdaQuery
()
.
eq
(
Config:
:
getComponent
,
"setting"
)
.
one
();
StrategyRule
strategyRules
=
_strategyRuleService
.
lambdaQuery
()
.
eq
(
StrategyRule:
:
getIsDeleted
,
0
)
.
eq
(
StrategyRule:
:
getIsGlobal
,
1
)
.
one
();
GlobalParam
globalParam
=
new
GlobalParam
();
// 5. 执行调度算法
GeneticAlgorithm
scheduler
=
new
GeneticAlgorithm
(
globalParam
,
machines
,
orders
,
null
,
machineScheduler
,
entryRel
);
//new GeneticAlgorithm(products, machines, orders, machineScheduler);
param
.
initAdaptiveParams
(
entrys
.
size
());
double
[]
customWeights
=
new
double
[]
{
0.2
,
0.1
,
0.1
,
0.1
,
0.5
};
// 延迟时间权重提升到0.5
scheduler
.
Init
(
null
,
false
);
Chromosome
chromosome
=
scheduler
.
Run
(
param
,
entrys
);
KpiCalculator
kpiCalculator
=
new
KpiCalculator
(
chromosome
);
kpiCalculator
.
calculatekpi
();
_sceneService
.
saveChromosomeToFile
(
chromosome
,
SceneId
);
// Chromosomes.forEach(this::WriteScheduleSummary);
...
...
@@ -523,8 +545,12 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
// 5. 执行调度算法
GeneticAlgorithm
scheduler
=
new
GeneticAlgorithm
(
globalParam
,
machines
,
orders
,
null
,
machineScheduler
,
entryRel
);
//new GeneticAlgorithm(products, machines, orders, machineScheduler);
param
.
initAdaptiveParams
(
entrys
.
size
());
Chromosome
chromosomes
=
scheduler
.
Run
(
param
,
entrys
);
// double[] customWeights = new double[] { 0.2, 0.1, 0.1, 0.1, 0.5 }; // 延迟时间权重提升到0.5
scheduler
.
Init
(
null
,
true
);
Chromosome
chromosomes
=
scheduler
.
Run
(
param
,
entrys
);
KpiCalculator
kpiCalculator
=
new
KpiCalculator
(
chromosomes
);
kpiCalculator
.
calculatekpi
();
chromosomes
.
setScenarioID
(
SceneId
);
chromosomes
.
setBaseTime
(
param
.
getBaseTime
());
chromosomes
.
setOperatRel
(
entryRel
);
...
...
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