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
7b9698da
Commit
7b9698da
authored
Sep 08, 2026
by
Tong Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MP
parent
0cdb4f74
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
optimization_result_1.json
mp/result/optimization_result_1.json
+1
-1
MultiLevelBomTestDataBuilder.java
...m/aps/macroplanner/data/MultiLevelBomTestDataBuilder.java
+14
-14
No files found.
mp/result/optimization_result_1.json
View file @
7b9698da
This diff is collapsed.
Click to expand it.
src/main/java/com/aps/macroplanner/data/MultiLevelBomTestDataBuilder.java
View file @
7b9698da
...
...
@@ -3,6 +3,7 @@ package com.aps.macroplanner.data;
import
java.time.LocalDate
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
/**
* 多级 BOM + 多成品 + 共享半成品 测试数据构建器。
...
...
@@ -46,11 +47,11 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
// === 产品: 成品 P1, P2 + 半成品 S1 + 原材料 R1, R2 ===
Product
prodP1
=
new
Product
(
"P1"
,
"成品P1"
);
Product
prodP2
=
new
Product
(
"P2"
,
"成品P2"
);
//
Product prodP2 = new Product("P2", "成品P2");
Product
prodS1
=
new
Product
(
"S1"
,
"半成品S1"
);
Product
prodR1
=
new
Product
(
"R1"
,
"原材料R1"
);
Product
prodR2
=
new
Product
(
"R2"
,
"原材料R2"
);
products
.
addAll
(
Arrays
.
asList
(
prodP1
,
prod
P2
,
prod
S1
,
prodR1
,
prodR2
));
products
.
addAll
(
Arrays
.
asList
(
prodP1
,
prodS1
,
prodR1
,
prodR2
));
// === 库存点: 每种产品一个库存点 ===
StockingPoint
spP1
=
new
StockingPoint
(
"SP_P1"
,
"P1成品库"
);
...
...
@@ -62,26 +63,27 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
// === 产品→库存点映射 ===
productSpMappings
.
add
(
new
ProductSpMapping
(
prodP1
,
spP1
));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodP2
,
spP2
));
//
productSpMappings.add(new ProductSpMapping(prodP2, spP2));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodS1
,
spSemi
));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodR1
,
spR1
));
productSpMappings
.
add
(
new
ProductSpMapping
(
prodR2
,
spR2
));
// === 生产工序: 成品 + 半成品 ===
List
<
UnitOperation
>
UnitOperations
=
Arrays
.
asList
(
new
UnitOperation
(
"Unit_P1"
,
""
,
1
,
false
,
0
,
1
),
new
UnitOperation
(
"Unit_P1_1"
,
""
,
2
,
false
,
0
,
1
));
// P1: 消耗 S1×2.0 + R1×3.0, 产出 P1@SP_P1
Operation
opP1
=
new
Operation
(
"OP_P1"
,
"生产P1"
,
"Unit_P1"
,
new
OperationOutput
(
prodP1
,
spP1
),
1.0
,
1.0
,
false
,
0
,
1.0
);
Operation
opP1_1
=
new
Operation
(
"OP_P1_1"
,
"生产P1"
,
"Unit_P1_1"
,
new
OperationOutput
(
prodP1
,
spP1
),
2.0
,
1.0
,
false
,
0
,
1.0
);
Operation
opP1
=
new
Operation
(
"OP_P1"
,
"生产P1"
,
UnitOperations
,
new
OperationOutput
(
prodP1
,
spP1
),
1.0
,
0
);
// P2: 消耗 S1×1.0, 产出 P2@SP_P2
// P2: 消耗 S1×1.0, 产出 P2@SP_P2
// Operation opP2 = new Operation("OP_P2", "生产P2", "Unit_P2",
// new OperationOutput(prodP2, spP2), 1.0, 1.0, false, 0, 1.0);
// // S1: 消耗 R2×2.0, 产出 S1@SP_Semi
Operation
opS1
=
new
Operation
(
"OP_S1"
,
"生产S1"
,
"Unit_S1"
,
new
OperationOutput
(
prodS1
,
spSemi
),
1.0
,
1.0
,
false
,
0
,
1.0
);
// operations.addAll(Arrays.asList(opP1,opP1_1, opP2, opS1));
operations
.
addAll
(
Arrays
.
asList
(
opP1
,
opP1_1
,
opS1
));
operations
.
addAll
(
Arrays
.
asList
(
opP1
,
opS1
));
// === 原材料采购工序 ===
Operation
opProcureR1
=
new
Operation
(
"OP_Procure_R1"
,
"采购R1"
,
"Unit_R1"
,
...
...
@@ -94,8 +96,6 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
operationInputs
.
add
(
new
OperationInput
(
opP1
,
prodS1
,
spSemi
,
2.0
));
operationInputs
.
add
(
new
OperationInput
(
opP1
,
prodR1
,
spR1
,
3.0
));
operationInputs
.
add
(
new
OperationInput
(
opP1_1
,
prodS1
,
spSemi
,
2.0
));
operationInputs
.
add
(
new
OperationInput
(
opP1_1
,
prodR1
,
spR1
,
3.0
));
// === BOM 投料: P2 消耗 S1×1.0 ===
// operationInputs.add(new OperationInput(opP2, prodS1, spSemi, 1.0));
...
...
@@ -116,7 +116,7 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
// === 初始库存: 全部从 0 开始 ===
initialInventories
.
add
(
new
InitialInventory
(
prodP1
,
spP1
,
0.0
));
initialInventories
.
add
(
new
InitialInventory
(
prodP2
,
spP2
,
0.0
));
//
initialInventories.add(new InitialInventory(prodP2, spP2, 0.0));
initialInventories
.
add
(
new
InitialInventory
(
prodS1
,
spSemi
,
0.0
));
initialInventories
.
add
(
new
InitialInventory
(
prodR1
,
spR1
,
0.0
));
initialInventories
.
add
(
new
InitialInventory
(
prodR2
,
spR2
,
0.0
));
...
...
@@ -131,8 +131,8 @@ public class MultiLevelBomTestDataBuilder extends TestDataBuilder {
for
(
Period
p
:
periods
)
{
inventorySpecs
.
add
(
new
InventorySpec
(
prodP1
,
spP1
,
p
,
80.0
,
10.0
,
200.0
,
true
,
true
,
true
));
inventorySpecs
.
add
(
new
InventorySpec
(
prodP2
,
spP2
,
p
,
60.0
,
10.0
,
200.0
,
true
,
true
,
true
));
//
inventorySpecs.add(new InventorySpec(prodP2, spP2, p,
//
60.0, 10.0, 200.0, true, true, true));
inventorySpecs
.
add
(
new
InventorySpec
(
prodS1
,
spSemi
,
p
,
100.0
,
10.0
,
300.0
,
true
,
true
,
true
));
inventorySpecs
.
add
(
new
InventorySpec
(
prodR1
,
spR1
,
p
,
...
...
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