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
e647dc92
Commit
e647dc92
authored
Dec 10, 2025
by
Tong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
遗传算法-策略
parent
a9f7d0cc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
0 deletions
+53
-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
PlanResultService.java
src/main/java/com/aps/service/plan/PlanResultService.java
+25
-0
No files found.
src/main/java/com/aps/entity/ConfigSetting.java
0 → 100644
View file @
e647dc92
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 @
e647dc92
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/service/plan/PlanResultService.java
View file @
e647dc92
...
@@ -70,6 +70,16 @@ public class PlanResultService {
...
@@ -70,6 +70,16 @@ public class PlanResultService {
@Autowired
@Autowired
private
RoutingDataService
_routingDataService
;
private
RoutingDataService
_routingDataService
;
@Autowired
private
ConfigService
_configService
;
@Autowired
private
StrategyRuleService
_strategyRuleService
;
private
LocalDateTime
baseTime
=
LocalDateTime
.
of
(
2025
,
11
,
1
,
0
,
0
,
0
);
private
LocalDateTime
baseTime
=
LocalDateTime
.
of
(
2025
,
11
,
1
,
0
,
0
,
0
);
public
List
<
ScheduleChromosome
>
execute
()
{
public
List
<
ScheduleChromosome
>
execute
()
{
...
@@ -302,11 +312,23 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
...
@@ -302,11 +312,23 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
List
<
Entry
>
entrys
=(
List
<
Entry
>)
list
.
get
(
1
);
List
<
Entry
>
entrys
=(
List
<
Entry
>)
list
.
get
(
1
);
List
<
GroupResult
>
entryRel
=(
List
<
GroupResult
>)
list
.
get
(
2
);
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
();
GlobalParam
globalParam
=
new
GlobalParam
();
// 5. 执行调度算法
// 5. 执行调度算法
GeneticAlgorithm
scheduler
=
new
GeneticAlgorithm
(
globalParam
,
machines
,
orders
,
null
,
machineScheduler
,
entryRel
);
//new GeneticAlgorithm(products, machines, orders, machineScheduler);
GeneticAlgorithm
scheduler
=
new
GeneticAlgorithm
(
globalParam
,
machines
,
orders
,
null
,
machineScheduler
,
entryRel
);
//new GeneticAlgorithm(products, machines, orders, machineScheduler);
param
.
initAdaptiveParams
(
entrys
.
size
());
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
);
Chromosome
chromosome
=
scheduler
.
Run
(
param
,
entrys
);
KpiCalculator
kpiCalculator
=
new
KpiCalculator
(
chromosome
);
KpiCalculator
kpiCalculator
=
new
KpiCalculator
(
chromosome
);
...
@@ -523,6 +545,9 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
...
@@ -523,6 +545,9 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
// 5. 执行调度算法
// 5. 执行调度算法
GeneticAlgorithm
scheduler
=
new
GeneticAlgorithm
(
globalParam
,
machines
,
orders
,
null
,
machineScheduler
,
entryRel
);
//new GeneticAlgorithm(products, machines, orders, machineScheduler);
GeneticAlgorithm
scheduler
=
new
GeneticAlgorithm
(
globalParam
,
machines
,
orders
,
null
,
machineScheduler
,
entryRel
);
//new GeneticAlgorithm(products, machines, orders, machineScheduler);
param
.
initAdaptiveParams
(
entrys
.
size
());
param
.
initAdaptiveParams
(
entrys
.
size
());
// 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
);
Chromosome
chromosomes
=
scheduler
.
Run
(
param
,
entrys
);
KpiCalculator
kpiCalculator
=
new
KpiCalculator
(
chromosomes
);
KpiCalculator
kpiCalculator
=
new
KpiCalculator
(
chromosomes
);
kpiCalculator
.
calculatekpi
();
kpiCalculator
.
calculatekpi
();
...
...
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