Commit fc778193 authored by Tong Li's avatar Tong Li

遗传算法-移动多工单,删除订单

parent bb843694
......@@ -6,6 +6,7 @@
"Id" : 1,
"GroupId" : 1,
"OrderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"SceneId" : null,
"routingId" : null,
"routingDetailId" : 555853,
"taskSeq" : 10,
......@@ -83,7 +84,40 @@
"LatestCompletionTime" : null,
"priority" : 1.0,
"id" : 1,
"latestCompletionTime" : null,
"materialRequirements" : null,
"dependentOnOrderIds" : [ ],
"targetFinishedOperationId" : 0,
"selectMachineID" : 3403,
"nextEntryIds" : [ {
"prevOperationId" : 0,
"nextOperationId" : 2,
"dependencyType" : "FinishToStart",
"id" : 0
} ],
"isInterrupt" : true,
"mainId" : null,
"groupId" : 1,
"machineOptions" : [ {
"machineId" : 3403,
"processingTime" : 0.72,
"setupTime" : 0,
"teardownTime" : 0,
"contantTime" : 1,
"preTime" : 0
}, {
"machineId" : 3402,
"processingTime" : 0.72,
"setupTime" : 0,
"teardownTime" : 0,
"contantTime" : 1,
"preTime" : 0
} ],
"sceneId" : null,
"quantity" : 50000.0,
"sequence" : 1,
"prevEntryIds" : [ ],
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"discreteParameter" : [ {
"id" : 14,
"creationTime" : "2025-12-03T14:03:46",
......@@ -119,40 +153,8 @@
"parameterId" : "87fd2237-7c4e-402e-8bde-85a0268bdbe1",
"parameterName" : "ces133"
} ],
"materialRequirements" : null,
"dependentOnOrderIds" : [ ],
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"quantity" : 50000.0,
"execId" : "65ffe1c733cc4a888ca3dcc28a7ab65a",
"sequence" : 1,
"equipTypeID" : 1661,
"prevEntryIds" : [ ],
"nextEntryIds" : [ {
"prevOperationId" : 0,
"nextOperationId" : 2,
"dependencyType" : "FinishToStart",
"id" : 0
} ],
"machineOptions" : [ {
"machineId" : 3403,
"processingTime" : 0.72,
"setupTime" : 0,
"teardownTime" : 0,
"contantTime" : 1,
"preTime" : 0
}, {
"machineId" : 3402,
"processingTime" : 0.72,
"setupTime" : 0,
"teardownTime" : 0,
"contantTime" : 1,
"preTime" : 0
} ],
"selectMachineID" : 3403,
"latestCompletionTime" : null,
"targetFinishedOperationId" : 0,
"isInterrupt" : true,
"mainId" : null
"equipTypeID" : 1661
},
"globalOpId" : 0
}, {
......@@ -162,6 +164,7 @@
"Id" : 2,
"GroupId" : 1,
"OrderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"SceneId" : null,
"routingId" : null,
"routingDetailId" : 555854,
"taskSeq" : 10,
......@@ -205,22 +208,15 @@
"LatestCompletionTime" : null,
"priority" : 1.0,
"id" : 2,
"groupId" : 1,
"discreteParameter" : [ ],
"latestCompletionTime" : null,
"materialRequirements" : null,
"dependentOnOrderIds" : [ ],
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"quantity" : 50000.0,
"execId" : "36200a5d39aa43eb956824baa3d7961c",
"sequence" : 2,
"equipTypeID" : 1621,
"prevEntryIds" : [ {
"prevOperationId" : 1,
"nextOperationId" : 0,
"dependencyType" : "FinishToStart",
"id" : 0
} ],
"targetFinishedOperationId" : 0,
"selectMachineID" : 3243,
"nextEntryIds" : [ ],
"isInterrupt" : true,
"mainId" : null,
"groupId" : 1,
"machineOptions" : [ {
"machineId" : 3243,
"processingTime" : 1.2,
......@@ -236,11 +232,19 @@
"contantTime" : 1,
"preTime" : 0
} ],
"selectMachineID" : 3243,
"latestCompletionTime" : null,
"targetFinishedOperationId" : 0,
"isInterrupt" : true,
"mainId" : null
"sceneId" : null,
"quantity" : 50000.0,
"sequence" : 2,
"prevEntryIds" : [ {
"prevOperationId" : 1,
"nextOperationId" : 0,
"dependencyType" : "FinishToStart",
"id" : 0
} ],
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"discreteParameter" : [ ],
"execId" : "36200a5d39aa43eb956824baa3d7961c",
"equipTypeID" : 1621
},
"globalOpId" : 1
}, {
......@@ -250,6 +254,7 @@
"Id" : 3,
"GroupId" : 2,
"OrderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"SceneId" : null,
"routingId" : null,
"routingDetailId" : 527109,
"taskSeq" : 10,
......@@ -281,17 +286,15 @@
"LatestCompletionTime" : null,
"priority" : 1.0,
"id" : 3,
"groupId" : 2,
"discreteParameter" : [ ],
"latestCompletionTime" : null,
"materialRequirements" : null,
"dependentOnOrderIds" : [ ],
"orderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"quantity" : 20.0,
"execId" : "3dbe438ec2714f3d830bb186df914370",
"sequence" : 1,
"equipTypeID" : 746,
"prevEntryIds" : [ ],
"targetFinishedOperationId" : 0,
"selectMachineID" : 2183,
"nextEntryIds" : [ ],
"isInterrupt" : true,
"mainId" : null,
"groupId" : 2,
"machineOptions" : [ {
"machineId" : 2183,
"processingTime" : 3600.0,
......@@ -300,11 +303,14 @@
"contantTime" : 0,
"preTime" : 0
} ],
"selectMachineID" : 2183,
"latestCompletionTime" : null,
"targetFinishedOperationId" : 0,
"isInterrupt" : true,
"mainId" : null
"sceneId" : null,
"quantity" : 20.0,
"sequence" : 1,
"prevEntryIds" : [ ],
"orderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"discreteParameter" : [ ],
"execId" : "3dbe438ec2714f3d830bb186df914370",
"equipTypeID" : 746
},
"globalOpId" : 2
} ],
......@@ -312,6 +318,7 @@
"Id" : 1,
"GroupId" : 1,
"OrderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"SceneId" : null,
"routingId" : null,
"routingDetailId" : 555853,
"taskSeq" : 10,
......@@ -389,7 +396,40 @@
"LatestCompletionTime" : null,
"priority" : 1.0,
"id" : 1,
"latestCompletionTime" : null,
"materialRequirements" : null,
"dependentOnOrderIds" : [ ],
"targetFinishedOperationId" : 0,
"selectMachineID" : 3403,
"nextEntryIds" : [ {
"prevOperationId" : 0,
"nextOperationId" : 2,
"dependencyType" : "FinishToStart",
"id" : 0
} ],
"isInterrupt" : true,
"mainId" : null,
"groupId" : 1,
"machineOptions" : [ {
"machineId" : 3403,
"processingTime" : 0.72,
"setupTime" : 0,
"teardownTime" : 0,
"contantTime" : 1,
"preTime" : 0
}, {
"machineId" : 3402,
"processingTime" : 0.72,
"setupTime" : 0,
"teardownTime" : 0,
"contantTime" : 1,
"preTime" : 0
} ],
"sceneId" : null,
"quantity" : 50000.0,
"sequence" : 1,
"prevEntryIds" : [ ],
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"discreteParameter" : [ {
"id" : 14,
"creationTime" : "2025-12-03T14:03:46",
......@@ -425,44 +465,13 @@
"parameterId" : "87fd2237-7c4e-402e-8bde-85a0268bdbe1",
"parameterName" : "ces133"
} ],
"materialRequirements" : null,
"dependentOnOrderIds" : [ ],
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"quantity" : 50000.0,
"execId" : "65ffe1c733cc4a888ca3dcc28a7ab65a",
"sequence" : 1,
"equipTypeID" : 1661,
"prevEntryIds" : [ ],
"nextEntryIds" : [ {
"prevOperationId" : 0,
"nextOperationId" : 2,
"dependencyType" : "FinishToStart",
"id" : 0
} ],
"machineOptions" : [ {
"machineId" : 3403,
"processingTime" : 0.72,
"setupTime" : 0,
"teardownTime" : 0,
"contantTime" : 1,
"preTime" : 0
}, {
"machineId" : 3402,
"processingTime" : 0.72,
"setupTime" : 0,
"teardownTime" : 0,
"contantTime" : 1,
"preTime" : 0
} ],
"selectMachineID" : 3403,
"latestCompletionTime" : null,
"targetFinishedOperationId" : 0,
"isInterrupt" : true,
"mainId" : null
"equipTypeID" : 1661
}, {
"Id" : 2,
"GroupId" : 1,
"OrderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"SceneId" : null,
"routingId" : null,
"routingDetailId" : 555854,
"taskSeq" : 10,
......@@ -506,22 +515,15 @@
"LatestCompletionTime" : null,
"priority" : 1.0,
"id" : 2,
"groupId" : 1,
"discreteParameter" : [ ],
"latestCompletionTime" : null,
"materialRequirements" : null,
"dependentOnOrderIds" : [ ],
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"quantity" : 50000.0,
"execId" : "36200a5d39aa43eb956824baa3d7961c",
"sequence" : 2,
"equipTypeID" : 1621,
"prevEntryIds" : [ {
"prevOperationId" : 1,
"nextOperationId" : 0,
"dependencyType" : "FinishToStart",
"id" : 0
} ],
"targetFinishedOperationId" : 0,
"selectMachineID" : 3243,
"nextEntryIds" : [ ],
"isInterrupt" : true,
"mainId" : null,
"groupId" : 1,
"machineOptions" : [ {
"machineId" : 3243,
"processingTime" : 1.2,
......@@ -537,15 +539,24 @@
"contantTime" : 1,
"preTime" : 0
} ],
"selectMachineID" : 3243,
"latestCompletionTime" : null,
"targetFinishedOperationId" : 0,
"isInterrupt" : true,
"mainId" : null
"sceneId" : null,
"quantity" : 50000.0,
"sequence" : 2,
"prevEntryIds" : [ {
"prevOperationId" : 1,
"nextOperationId" : 0,
"dependencyType" : "FinishToStart",
"id" : 0
} ],
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"discreteParameter" : [ ],
"execId" : "36200a5d39aa43eb956824baa3d7961c",
"equipTypeID" : 1621
}, {
"Id" : 3,
"GroupId" : 2,
"OrderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"SceneId" : null,
"routingId" : null,
"routingDetailId" : 527109,
"taskSeq" : 10,
......@@ -577,17 +588,15 @@
"LatestCompletionTime" : null,
"priority" : 1.0,
"id" : 3,
"groupId" : 2,
"discreteParameter" : [ ],
"latestCompletionTime" : null,
"materialRequirements" : null,
"dependentOnOrderIds" : [ ],
"orderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"quantity" : 20.0,
"execId" : "3dbe438ec2714f3d830bb186df914370",
"sequence" : 1,
"equipTypeID" : 746,
"prevEntryIds" : [ ],
"targetFinishedOperationId" : 0,
"selectMachineID" : 2183,
"nextEntryIds" : [ ],
"isInterrupt" : true,
"mainId" : null,
"groupId" : 2,
"machineOptions" : [ {
"machineId" : 2183,
"processingTime" : 3600.0,
......@@ -596,11 +605,14 @@
"contantTime" : 0,
"preTime" : 0
} ],
"selectMachineID" : 2183,
"latestCompletionTime" : null,
"targetFinishedOperationId" : 0,
"isInterrupt" : true,
"mainId" : null
"sceneId" : null,
"quantity" : 20.0,
"sequence" : 1,
"prevEntryIds" : [ ],
"orderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"discreteParameter" : [ ],
"execId" : "3dbe438ec2714f3d830bb186df914370",
"equipTypeID" : 746
} ],
"orders" : [ {
"id" : 0,
......@@ -629,8 +641,8 @@
"FinishOrderId" : null,
"delayHours" : 0.0,
"orderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"finishOrderId" : null,
"syquantity" : 200000.0
"syquantity" : 200000.0,
"finishOrderId" : null
}, {
"id" : 0,
"orderCode" : "002",
......@@ -658,10 +670,11 @@
"FinishOrderId" : null,
"delayHours" : 0.0,
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"finishOrderId" : null,
"syquantity" : 50000.0
"syquantity" : 50000.0,
"finishOrderId" : null
} ],
"machineMaxRate" : 83.33,
"orderMaterials" : null,
"machineMaxRate" : 96.77,
"machineMinRate" : 0.0,
"machineWaitTime" : 4295.033333333334,
"orderOnTime" : 100.0,
......@@ -675,106 +688,151 @@
"orderMinFlow" : 0.0,
"orderAvgFlow" : 0.0,
"result" : [ {
"ExecId" : "65ffe1c733cc4a888ca3dcc28a7ab65a",
"OrderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"productId" : "cbd0dd08-e92e-f846-8577-c359540fb09a",
"ExecId" : "3dbe438ec2714f3d830bb186df914370",
"OrderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"productId" : "d5d0dd08-e3b6-c94c-8073-bad6ae137269",
"teardownTime" : 0,
"designatedStartTime" : -1,
"forcedMachineId" : -1,
"startTime" : 27000,
"endTime" : 63000,
"groupId" : 1,
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"quantity" : 50000.0,
"operationId" : 1,
"processingTime" : 36000.0,
"machineId" : 3403,
"seq" : 0,
"changeoverTime" : 0,
"execId" : "65ffe1c733cc4a888ca3dcc28a7ab65a",
"groupId" : 2,
"processingTime" : 72000.0,
"machineId" : 2183,
"quantity" : 20.0,
"startTime" : 27000,
"endTime" : 149400,
"orderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"operationId" : 3,
"geneDetails" : [ {
"key" : "306c7f03-660d-475a-ada9-97d1fd9fbcf9",
"key" : "48f10834-a9be-4097-8dca-2a1be5404ddc",
"processingTime" : 36000,
"quantity" : 10.0,
"startTime" : 27000,
"endTime" : 63000,
"quantity" : 50000.0,
"oneTime" : 3600.0
}, {
"key" : "936d981f-bd02-4691-a93b-33eb69fc3216",
"processingTime" : 36000,
"oneTime" : 0.72
"quantity" : 10.0,
"startTime" : 113400,
"endTime" : 149400,
"oneTime" : 3600.0
} ],
"oneTime" : 0.72,
"isLocked" : false,
"flowTime" : 36000
"execId" : "3dbe438ec2714f3d830bb186df914370",
"oneTime" : 3600.0,
"flowTime" : 122400
}, {
"ExecId" : "36200a5d39aa43eb956824baa3d7961c",
"ExecId" : "65ffe1c733cc4a888ca3dcc28a7ab65a",
"OrderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"productId" : "cbd0dd08-e92e-f846-8577-c359540fb09a",
"teardownTime" : 0,
"designatedStartTime" : -1,
"designatedStartTime" : 1234271,
"forcedMachineId" : -1,
"startTime" : 63000,
"endTime" : 137400,
"seq" : 0,
"changeoverTime" : 0,
"groupId" : 1,
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"processingTime" : 36000.0,
"machineId" : 3403,
"quantity" : 50000.0,
"operationId" : 2,
"processingTime" : 60000.0,
"machineId" : 3243,
"changeoverTime" : 0,
"execId" : "36200a5d39aa43eb956824baa3d7961c",
"startTime" : 1236600,
"endTime" : 1272600,
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"operationId" : 1,
"geneDetails" : [ {
"key" : "80a684a3-74b0-4b87-aea8-c56e0f7f62be",
"startTime" : 63000,
"endTime" : 99000,
"quantity" : 30000.0,
"key" : "47e0b2d2-8407-4a20-840e-b2d9aeb6470b",
"processingTime" : 36000,
"oneTime" : 1.2
}, {
"key" : "7098f1f3-0f4d-490d-baa0-1d6fa04a3255",
"startTime" : 113400,
"endTime" : 137400,
"quantity" : 20000.0,
"processingTime" : 24000,
"oneTime" : 1.2
"quantity" : 50000.0,
"startTime" : 1236600,
"endTime" : 1272600,
"oneTime" : 0.72
} ],
"oneTime" : 1.2,
"isLocked" : false,
"flowTime" : 74400
"execId" : "65ffe1c733cc4a888ca3dcc28a7ab65a",
"oneTime" : 0.72,
"flowTime" : 36000
}, {
"ExecId" : "3dbe438ec2714f3d830bb186df914370",
"OrderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"productId" : "d5d0dd08-e3b6-c94c-8073-bad6ae137269",
"ExecId" : "36200a5d39aa43eb956824baa3d7961c",
"OrderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"productId" : "cbd0dd08-e92e-f846-8577-c359540fb09a",
"teardownTime" : 0,
"designatedStartTime" : -1,
"forcedMachineId" : -1,
"startTime" : 27000,
"endTime" : 149400,
"groupId" : 2,
"orderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"quantity" : 20.0,
"operationId" : 3,
"processingTime" : 72000.0,
"machineId" : 2183,
"seq" : 0,
"changeoverTime" : 0,
"execId" : "3dbe438ec2714f3d830bb186df914370",
"groupId" : 1,
"processingTime" : 60000.0,
"machineId" : 3243,
"quantity" : 50000.0,
"startTime" : 1272600,
"endTime" : 1347000,
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"operationId" : 2,
"geneDetails" : [ {
"key" : "48f10834-a9be-4097-8dca-2a1be5404ddc",
"startTime" : 27000,
"endTime" : 63000,
"quantity" : 10.0,
"key" : "389863ab-4fe5-44bc-b69b-a369a04e7d82",
"processingTime" : 36000,
"oneTime" : 3600.0
"quantity" : 30000.0,
"startTime" : 1272600,
"endTime" : 1308600,
"oneTime" : 1.2
}, {
"key" : "936d981f-bd02-4691-a93b-33eb69fc3216",
"startTime" : 113400,
"endTime" : 149400,
"quantity" : 10.0,
"processingTime" : 36000,
"oneTime" : 3600.0
"key" : "9d0f6fb8-9be8-43a2-b410-285594db7f49",
"processingTime" : 24000,
"quantity" : 20000.0,
"startTime" : 1323000,
"endTime" : 1347000,
"oneTime" : 1.2
} ],
"oneTime" : 3600.0,
"isLocked" : false,
"flowTime" : 122400
"execId" : "36200a5d39aa43eb956824baa3d7961c",
"oneTime" : 1.2,
"flowTime" : 74400
} ],
"id" : "e8e060fa-c33d-43ff-90a4-3f28824eb085",
"machineSelection" : [ 1, 1, 1 ],
"crowdingDistance" : "Infinity",
"totalChangeoverTime" : 0.0,
"operationSequencing" : [ 2, 1, 1 ],
"weightedObjective" : 0.0,
"machineLoadStd" : 0.9987918166792348,
"baseTime" : "2025-11-01T00:00:00",
"makespan" : 1347000.0,
"delayTime" : 0.0,
"totalFlowTime" : 232800.0,
"operatRel" : [ {
"nodeInfoList" : [ {
"originalId" : "65ffe1c733cc4a888ca3dcc28a7ab65a",
"globalSerial" : 1,
"groupSerial" : 1,
"newParentIds" : [ ],
"newChildIds" : [ 2 ]
}, {
"originalId" : "36200a5d39aa43eb956824baa3d7961c",
"globalSerial" : 2,
"groupSerial" : 2,
"newParentIds" : [ 1 ],
"newChildIds" : [ ]
} ],
"originalToGlobalSerial" : {
"36200a5d39aa43eb956824baa3d7961c" : 2,
"65ffe1c733cc4a888ca3dcc28a7ab65a" : 1
}
}, {
"nodeInfoList" : [ {
"originalId" : "3dbe438ec2714f3d830bb186df914370",
"globalSerial" : 3,
"groupSerial" : 1,
"newParentIds" : [ ],
"newChildIds" : [ ]
} ],
"originalToGlobalSerial" : {
"3dbe438ec2714f3d830bb186df914370" : 3
}
} ],
"scenarioID" : "B571EF6682DB463AB2977B1055A74112",
"operationStr" : "2|1|1",
"fitness" : 0.4820972833156857,
"machines" : [ {
"id" : 2183,
"name" : null,
......@@ -1356,9 +1414,10 @@
"used" : false,
"holiday" : false
} ],
"code" : null,
"holidays" : [ ],
"actualWorkTime" : 72000.0,
"rate" : 83.33,
"rate" : 96.77,
"shiftsChanged" : null,
"maintenanceWindowsChanged" : null
}, {
......@@ -1399,20 +1458,11 @@
"earliestTime" : 0,
"totalTaskTime" : 0,
"type" : "REGULAR",
"used" : true,
"holiday" : false
}, {
"key" : "7098f1f3-0f4d-490d-baa0-1d6fa04a3255",
"start" : "2025-11-02T07:30:00",
"end" : "2025-11-02T14:10:00",
"earliestTime" : 0,
"totalTaskTime" : 0,
"type" : "REGULAR",
"used" : true,
"used" : false,
"holiday" : false
}, {
"key" : "721f79db-04a4-4c0f-bcd0-330c02265f25",
"start" : "2025-11-02T14:10:00",
"start" : "2025-11-02T07:30:00",
"end" : "2025-11-03T03:30:00",
"earliestTime" : 0,
"totalTaskTime" : 0,
......@@ -1534,11 +1584,20 @@
"earliestTime" : 0,
"totalTaskTime" : 0,
"type" : "REGULAR",
"used" : false,
"used" : true,
"holiday" : false
}, {
"key" : "d3e7b298-0c49-4e69-a340-66b55e98de49",
"key" : "9d0f6fb8-9be8-43a2-b410-285594db7f49",
"start" : "2025-11-16T07:30:00",
"end" : "2025-11-16T14:10:00",
"earliestTime" : 0,
"totalTaskTime" : 0,
"type" : "REGULAR",
"used" : true,
"holiday" : false
}, {
"key" : "d3e7b298-0c49-4e69-a340-66b55e98de49",
"start" : "2025-11-16T14:10:00",
"end" : "2025-11-17T03:30:00",
"earliestTime" : 0,
"totalTaskTime" : 0,
......@@ -1951,9 +2010,10 @@
"used" : false,
"holiday" : false
} ],
"code" : null,
"holidays" : [ ],
"actualWorkTime" : 60000.0,
"rate" : 69.44,
"rate" : 80.65,
"shiftsChanged" : null,
"maintenanceWindowsChanged" : null
}, {
......@@ -2537,6 +2597,7 @@
"used" : false,
"holiday" : false
} ],
"code" : null,
"holidays" : [ ],
"actualWorkTime" : 0.0,
"rate" : 0.0,
......@@ -3123,6 +3184,7 @@
"used" : false,
"holiday" : false
} ],
"code" : null,
"holidays" : [ ],
"actualWorkTime" : 0.0,
"rate" : 0.0,
......@@ -3166,7 +3228,7 @@
"earliestTime" : 0,
"totalTaskTime" : 0,
"type" : "REGULAR",
"used" : true,
"used" : false,
"holiday" : false
}, {
"key" : "f64e0997-b4cc-4316-bb99-aed6409e316d",
......@@ -3292,7 +3354,7 @@
"earliestTime" : 0,
"totalTaskTime" : 0,
"type" : "REGULAR",
"used" : false,
"used" : true,
"holiday" : false
}, {
"key" : "849cd537-e702-4188-a26a-b89d3e3f2c62",
......@@ -3709,55 +3771,119 @@
"used" : false,
"holiday" : false
} ],
"code" : null,
"holidays" : [ ],
"actualWorkTime" : 36000.0,
"rate" : 41.67,
"rate" : 48.39,
"shiftsChanged" : null,
"maintenanceWindowsChanged" : null
} ],
"scenarioID" : "B571EF6682DB463AB2977B1055A74112",
"totalChangeoverTime" : 0.0,
"makespan" : 149400.0,
"operatRel" : [ {
"nodeInfoList" : [ {
"originalId" : "65ffe1c733cc4a888ca3dcc28a7ab65a",
"globalSerial" : 1,
"groupSerial" : 1,
"newParentIds" : [ ],
"newChildIds" : [ 2 ]
"rank" : 0,
"objectives" : [ 1347000.0, 232800.0, 0.0, 0.9987918166792348, 0.0 ],
"machineStr" : "1,1,1",
"resultOld" : [ {
"ExecId" : "65ffe1c733cc4a888ca3dcc28a7ab65a",
"OrderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"productId" : "cbd0dd08-e92e-f846-8577-c359540fb09a",
"teardownTime" : 0,
"designatedStartTime" : 1234271,
"forcedMachineId" : 3403,
"seq" : 0,
"changeoverTime" : 0,
"groupId" : 1,
"processingTime" : 36000.0,
"machineId" : 3403,
"quantity" : 50000.0,
"startTime" : 27000,
"endTime" : 63000,
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"operationId" : 1,
"geneDetails" : [ {
"key" : "306c7f03-660d-475a-ada9-97d1fd9fbcf9",
"processingTime" : 36000,
"quantity" : 50000.0,
"startTime" : 27000,
"endTime" : 63000,
"oneTime" : 0.72
} ],
"isLocked" : false,
"execId" : "65ffe1c733cc4a888ca3dcc28a7ab65a",
"oneTime" : 0.72,
"flowTime" : 36000
}, {
"ExecId" : "36200a5d39aa43eb956824baa3d7961c",
"OrderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"productId" : "cbd0dd08-e92e-f846-8577-c359540fb09a",
"teardownTime" : 0,
"designatedStartTime" : -1,
"forcedMachineId" : -1,
"seq" : 0,
"changeoverTime" : 0,
"groupId" : 1,
"processingTime" : 60000.0,
"machineId" : 3243,
"quantity" : 50000.0,
"startTime" : 63000,
"endTime" : 137400,
"orderId" : "fcc0892a-0483-4da7-8414-9ce98be36e53",
"operationId" : 2,
"geneDetails" : [ {
"key" : "80a684a3-74b0-4b87-aea8-c56e0f7f62be",
"processingTime" : 36000,
"quantity" : 30000.0,
"startTime" : 63000,
"endTime" : 99000,
"oneTime" : 1.2
}, {
"originalId" : "36200a5d39aa43eb956824baa3d7961c",
"globalSerial" : 2,
"groupSerial" : 2,
"newParentIds" : [ 1 ],
"newChildIds" : [ ]
"key" : "7098f1f3-0f4d-490d-baa0-1d6fa04a3255",
"processingTime" : 24000,
"quantity" : 20000.0,
"startTime" : 113400,
"endTime" : 137400,
"oneTime" : 1.2
} ],
"originalToGlobalSerial" : {
"36200a5d39aa43eb956824baa3d7961c" : 2,
"65ffe1c733cc4a888ca3dcc28a7ab65a" : 1
}
"isLocked" : false,
"execId" : "36200a5d39aa43eb956824baa3d7961c",
"oneTime" : 1.2,
"flowTime" : 74400
}, {
"nodeInfoList" : [ {
"originalId" : "3dbe438ec2714f3d830bb186df914370",
"globalSerial" : 3,
"groupSerial" : 1,
"newParentIds" : [ ],
"newChildIds" : [ ]
"ExecId" : "3dbe438ec2714f3d830bb186df914370",
"OrderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"productId" : "d5d0dd08-e3b6-c94c-8073-bad6ae137269",
"teardownTime" : 0,
"designatedStartTime" : -1,
"forcedMachineId" : -1,
"seq" : 0,
"changeoverTime" : 0,
"groupId" : 2,
"processingTime" : 72000.0,
"machineId" : 2183,
"quantity" : 20.0,
"startTime" : 27000,
"endTime" : 149400,
"orderId" : "14a5bbda-bcf6-41d1-a342-bb07c2d41b4f",
"operationId" : 3,
"geneDetails" : [ {
"key" : "48f10834-a9be-4097-8dca-2a1be5404ddc",
"processingTime" : 36000,
"quantity" : 10.0,
"startTime" : 27000,
"endTime" : 63000,
"oneTime" : 3600.0
}, {
"key" : "936d981f-bd02-4691-a93b-33eb69fc3216",
"processingTime" : 36000,
"quantity" : 10.0,
"startTime" : 113400,
"endTime" : 149400,
"oneTime" : 3600.0
} ],
"originalToGlobalSerial" : {
"3dbe438ec2714f3d830bb186df914370" : 3
}
"isLocked" : false,
"execId" : "3dbe438ec2714f3d830bb186df914370",
"oneTime" : 3600.0,
"flowTime" : 122400
} ],
"operationStr" : "1|1|2",
"totalFlowTime" : 232800.0,
"fitness" : 0.4820972833156857,
"delayTime" : 0.0,
"machineLoadStd" : 0.9104720809707942,
"weightedObjective" : 0.0,
"machineSelection" : [ 1, 1, 1 ],
"operationSequencing" : [ 1, 1, 2 ],
"crowdingDistance" : "Infinity",
"rank" : 0,
"scenarioName" : null,
"initMachines" : [ {
"id" : 2183,
"name" : null,
......@@ -3796,7 +3922,7 @@
"earliestTime" : 0,
"totalTaskTime" : 0,
"type" : "REGULAR",
"used" : false,
"used" : true,
"holiday" : false
}, {
"key" : "936d981f-bd02-4691-a93b-33eb69fc3216",
......@@ -3805,7 +3931,7 @@
"earliestTime" : 0,
"totalTaskTime" : 0,
"type" : "REGULAR",
"used" : false,
"used" : true,
"holiday" : false
}, {
"key" : "a97c4750-faab-4799-8c36-775522070aef",
......@@ -4339,9 +4465,10 @@
"used" : false,
"holiday" : false
} ],
"code" : null,
"holidays" : [ ],
"actualWorkTime" : 0.0,
"rate" : 0.0,
"actualWorkTime" : 72000.0,
"rate" : 96.77,
"shiftsChanged" : null,
"maintenanceWindowsChanged" : null
}, {
......@@ -4508,11 +4635,20 @@
"earliestTime" : 0,
"totalTaskTime" : 0,
"type" : "REGULAR",
"used" : false,
"used" : true,
"holiday" : false
}, {
"key" : "d3e7b298-0c49-4e69-a340-66b55e98de49",
"key" : "9d0f6fb8-9be8-43a2-b410-285594db7f49",
"start" : "2025-11-16T07:30:00",
"end" : "2025-11-16T14:10:00",
"earliestTime" : 0,
"totalTaskTime" : 0,
"type" : "REGULAR",
"used" : true,
"holiday" : false
}, {
"key" : "d3e7b298-0c49-4e69-a340-66b55e98de49",
"start" : "2025-11-16T14:10:00",
"end" : "2025-11-17T03:30:00",
"earliestTime" : 0,
"totalTaskTime" : 0,
......@@ -4925,9 +5061,10 @@
"used" : false,
"holiday" : false
} ],
"code" : null,
"holidays" : [ ],
"actualWorkTime" : 0.0,
"rate" : 0.0,
"actualWorkTime" : 60000.0,
"rate" : 80.65,
"shiftsChanged" : null,
"maintenanceWindowsChanged" : null
}, {
......@@ -5511,6 +5648,7 @@
"used" : false,
"holiday" : false
} ],
"code" : null,
"holidays" : [ ],
"actualWorkTime" : 0.0,
"rate" : 0.0,
......@@ -6097,6 +6235,7 @@
"used" : false,
"holiday" : false
} ],
"code" : null,
"holidays" : [ ],
"actualWorkTime" : 0.0,
"rate" : 0.0,
......@@ -6266,7 +6405,7 @@
"earliestTime" : 0,
"totalTaskTime" : 0,
"type" : "REGULAR",
"used" : false,
"used" : true,
"holiday" : false
}, {
"key" : "849cd537-e702-4188-a26a-b89d3e3f2c62",
......@@ -6683,14 +6822,11 @@
"used" : false,
"holiday" : false
} ],
"code" : null,
"holidays" : [ ],
"actualWorkTime" : 0.0,
"rate" : 0.0,
"actualWorkTime" : 36000.0,
"rate" : 48.39,
"shiftsChanged" : null,
"maintenanceWindowsChanged" : null
} ],
"objectives" : [ 149400.0, 232800.0, 0.0, 0.9104720809707942, 0.0 ],
"resultOld" : [ ],
"scenarioName" : null,
"machineStr" : "1,1,1"
} ]
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -12,6 +12,7 @@ import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
@UtilityClass
......@@ -241,4 +242,25 @@ public class ParamValidator {
})
.toArray(Double[]::new);
}
public static List<Integer> convertToIntArray(List<?> sourceList, String fieldName) {
requireNotEmpty(sourceList, fieldName);
return sourceList.stream()
.map(item -> {
if (item instanceof Number) {
return ((Integer) item);
} else if (item instanceof String) {
try {
return Integer.parseInt(((String) item).trim());
} catch (NumberFormatException e) {
throw new IllegalArgumentException(fieldName + "包含无效的数字: " + item);
}
} else {
throw new IllegalArgumentException(fieldName + "包含不支持的数据类型: " +
(item != null ? item.getClass().getSimpleName() : "null"));
}
})
.collect(Collectors.toList());
}
}
\ No newline at end of file
......@@ -144,15 +144,17 @@ public class ResourceGanttController {
// 1. 提取参数
String sceneId = ParamValidator.getString(params, "sceneId", "场景ID");
Integer opid = ParamValidator.getInteger(params, "id", "操作ID");
List<?> opid = ParamValidator.getList(params, "id", "操作ID");
LocalDateTime newStartTime = ParamValidator.getDateTime(params, "newStartTime", "新的开始时间");
Long newMachineId = ParamValidator.getLong(params, "newMachineId", "新机器ID");
// 2. 验证场景
ParamValidator.validateSceneExists(sceneService, sceneId);
List<Integer> opids = ParamValidator.convertToIntArray(opid, "操作IDS");
// 3. 执行业务
Chromosome result = planResultService.Move(sceneId, opid, newStartTime, newMachineId);
Chromosome result = planResultService.Move(sceneId, opids, newStartTime, newMachineId);
return R.ok(result);
}
......
......@@ -66,7 +66,7 @@ public class GeneticAlgorithm {
}
System.out.println("开始");
Initialization initialization = new Initialization(_GlobalParam,allOperations,orders);
Initialization initialization = new Initialization(_GlobalParam,allOperations,orders,machines);
GeneticOperations geneticOps = new GeneticOperations(_GlobalParam,allOperations,param);
......@@ -183,8 +183,7 @@ public class GeneticAlgorithm {
}
}
best.setBaseTime(param.getBaseTime());
best.setInitMachines(ProductionDeepCopyUtil.deepCopyList(machines));
best.setOrders(orders);
best.setOrderMaterials(orderMaterials);
best.setOperatRel(_entryRel);
// 步骤3:返回最优解
......
......@@ -78,7 +78,7 @@ public class GeneticDecoder {
chromosome.setTotalChangeoverTime(cachedResult.getTotalChangeoverTime());
chromosome.setMachineLoadStd(cachedResult.getMachineLoadStd());
chromosome.setDelayTime(cachedResult.getDelayTime());
chromosome.setResult(ProductionDeepCopyUtil.deepCopy(cachedResult.getResult()));
chromosome.setResult(cachedResult.getResult());
// Chromosome chromosomen= ProductionDeepCopyUtil.deepCopy(cachedResult);
return chromosome;
......
......@@ -136,11 +136,13 @@ public class GeneticOperations {
Chromosome child1 = new Chromosome();
child1.setOrders(parent1.getOrders());
child1.setMachines(parent1.getMachines());
child1.setMachineSelection(child1Ms);
child1.setOperationSequencing(child1Os);
Chromosome child2 = new Chromosome();
child2.setOrders(parent1.getOrders());
child2.setMachines(parent1.getMachines());
child2.setMachineSelection(child2Ms);
child2.setOperationSequencing(child2Os);
......
package com.aps.service.Algorithm;
import com.aps.common.util.ProductionDeepCopyUtil;
import com.aps.entity.Algorithm.Chromosome;
import com.aps.entity.Algorithm.GlobalOperationInfo;
import com.aps.entity.Algorithm.ScheduleParams;
import com.aps.entity.basic.Entry;
import com.aps.entity.basic.GlobalParam;
import com.aps.entity.basic.MachineOption;
import com.aps.entity.basic.Order;
import com.aps.entity.basic.*;
import java.util.*;
import java.util.stream.Collectors;
......@@ -22,10 +20,13 @@ public class Initialization {
private static List<Order> orders;
public Initialization(GlobalParam globalParam,List<Entry> allOperations,List<Order> _orders) {
private static List<Machine> machines;
public Initialization(GlobalParam globalParam,List<Entry> allOperations,List<Order> _orders,List<Machine> _machines) {
Initialization.allOperations = allOperations;
_globalParam= globalParam;
orders=_orders;
machines=_machines;
}
/**
* 预生成全局工序列表(按“订单0→订单1→…+订单内工序1→2→…”排序,分配GlobalOpId)
......@@ -59,7 +60,7 @@ int populationSize=param.getPopulationSize();
.parallel() // 开启并行
.forEach(i -> {
Chromosome chromo = new Chromosome(); // 初始化染色体
chromo.setInitMachines(ProductionDeepCopyUtil.deepCopyList(machines));
chromo.setOrders(orders);
// 全局选择(GS):按GlobalOpId顺序生成MachineSelection
if (i < gsCount) {
......
package com.aps.service.Algorithm;
import com.aps.common.util.ProductionDeepCopyUtil;
import com.aps.entity.Algorithm.Chromosome;
import com.aps.entity.Algorithm.GAScheduleResult;
import com.aps.entity.basic.Machine;
......@@ -128,7 +129,7 @@ public class KpiCalculator {
private void calculateMachine() {
// 按设备ID分组工序列表(对应C# GroupBy + ToList)
List<GAScheduleResult> list= chromosome.getResult();
List<GAScheduleResult> list= chromosome.getResult() ;
Map<Long, List<GAScheduleResult>> machineTasks = list.stream()
.collect(Collectors.groupingBy(GAScheduleResult::getMachineId));
......
......@@ -27,55 +27,83 @@ public class ScheduleOperationService {
/**
* 移动工序方法
* 移动工序方法
* @param chromosome 染色体对象
* @param opId 工序ID
* @param newStartTime 新开始时间
* @param newMachineId 新设备ID
*/
public void moveOperation(Chromosome chromosome, int opId, int newStartTime,
public void moveOperation(Chromosome chromosome, List<Integer> opIds, int newStartTime,
Long newMachineId, GlobalParam globalParam) {
List<Entry> allOperations = chromosome.getAllOperations();
// 获取目标结果和工序
GAScheduleResult targetResult = chromosome.getResult().stream()
.filter(r -> r.getOperationId() == opId)
.findFirst()
.orElseThrow(() -> new NoSuchElementException("Operation not found: " + opId));
Entry targetOp = allOperations.stream()
.filter(o -> o.getId() == opId)
.findFirst()
.orElseThrow(() -> new NoSuchElementException("Operation not found: " + opId));
Map<Integer, Integer> opTimeMap = chromosome.getResult().stream()
.collect(Collectors.toMap(
GAScheduleResult::getOperationId,
r -> r.getStartTime()
));
int machineOptionIndex = targetOp.getMachineOptions().stream()
.map(MachineOption::getMachineId)
.collect(Collectors.toList())
.indexOf(newMachineId) + 1;
for (Integer opId:opIds) {
if (machineOptionIndex == 0) {
throw new NoSuchElementException("Machine not found: " + newMachineId);
}
// 设置约束
targetResult.setDesignatedStartTime(newStartTime);
targetResult.setForcedMachineId(newMachineId);
// 获取目标结果和工序
GAScheduleResult targetResult = chromosome.getResult().stream()
.filter(r -> r.getOperationId() == opId)
.findFirst()
.orElseThrow(() -> new NoSuchElementException("Operation not found: " + opId));
// 更新设备选择序列
int globalOpIndex = chromosome.getGlobalOpList().stream()
.filter(g -> g.getOp().getId() == opId)
.findFirst()
.map(GlobalOperationInfo::getGlobalOpId)
.orElseThrow(() -> new NoSuchElementException("Global operation not found: " + opId));
Entry targetOp = allOperations.stream()
.filter(o -> o.getId() == opId)
.findFirst()
.orElseThrow(() -> new NoSuchElementException("Operation not found: " + opId));
int machineOptionIndex = targetOp.getMachineOptions().stream()
.map(MachineOption::getMachineId)
.collect(Collectors.toList())
.indexOf(newMachineId) + 1;
if (machineOptionIndex == 0) {
throw new NoSuchElementException("Machine not found: " + newMachineId);
}
// 设置约束
targetResult.setDesignatedStartTime(newStartTime);
targetResult.setForcedMachineId(newMachineId);
// 更新设备选择序列
int globalOpIndex = chromosome.getGlobalOpList().stream()
.filter(g -> g.getOp().getId() == opId)
.findFirst()
.map(GlobalOperationInfo::getGlobalOpId)
.orElseThrow(() -> new NoSuchElementException("Global operation not found: " + opId));
chromosome.getMachineSelection().set(globalOpIndex, machineOptionIndex);
chromosome.getMachineSelection().set(globalOpIndex, machineOptionIndex);
if(targetOp.getSequence()==1) {
opTimeMap.put(opId, newStartTime);
}else {
Entry targetOp1 = allOperations.stream()
.filter(o -> o.getGroupId() == targetOp.getGroupId()
&&o.getSequence()==targetOp.getSequence()-1)
.findFirst()
.orElseThrow(() -> new NoSuchElementException("Operation not found: " + opId));
GAScheduleResult targetResult1 = chromosome.getResult().stream()
.filter(r -> r.getOperationId() == targetOp1.getId())
.findFirst()
.orElseThrow(() -> new NoSuchElementException("Operation not found: " + opId));
if(targetResult1.getStartTime()<newStartTime)
{
opTimeMap.put(opId, newStartTime);
}else {
opTimeMap.put(opId, targetResult1.getStartTime()+1);
}
}
newStartTime=newStartTime+(int)targetResult.getProcessingTime();
}
// 生成新的工序顺序
Map<Integer, Integer> opTimeMap = chromosome.getResult().stream()
.collect(Collectors.toMap(
GAScheduleResult::getOperationId,
r -> r.getOperationId() == opId ? newStartTime : r.getStartTime()
));
List<Integer> operationSequencing = allOperations.stream()
.sorted((op1, op2) -> {
......@@ -96,7 +124,6 @@ public class ScheduleOperationService {
}
public void SpiltOperation(Chromosome chromosome, int opId,Double[] splitCounts, GlobalParam globalParam)
{
List<Entry> allOperations = chromosome.getAllOperations();
......@@ -693,9 +720,10 @@ public class ScheduleOperationService {
public void redecode(Chromosome chromosome,LocalDateTime baseTime, GlobalParam globalParam)
{
MachineSchedulerService machineScheduler = new MachineSchedulerService(baseTime);
chromosome.setMachines(chromosome.getInitMachines());
GeneticDecoder decoder = new GeneticDecoder(globalParam,baseTime, chromosome.getInitMachines(),
chromosome.getOrders(), null, machineScheduler,chromosome.getOrderMaterials());
chromosome.setMachines(chromosome.getInitMachines());
chromosome.setResultOld(ProductionDeepCopyUtil.deepCopyList(chromosome.getResult()));
chromosome.getResult().clear();
......
......@@ -301,6 +301,7 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
public Chromosome execute2(String SceneId) {
try {
SceneId="6AF8001449FC4D20A3C9992EC24CBF05";
ScheduleParams param = new ScheduleParams();
param.setBaseTime(LocalDateTime.of(2025, 11, 1, 0, 0, 0));
......@@ -325,7 +326,7 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
// 3. 构建订单-工序数据
List<Order> orders=InitOrder(ProdLaunchOrders);
List<Material> Materials= InitMaterial();
List<Material> Materials= null;//InitMaterial();
Map<Integer,Object> list= InitEntrys(SceneId,ProdEquipments,orders);
List<Entry> entrys=(List<Entry>)list.get(1);
......@@ -404,7 +405,7 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
return chromosome;
}
public Chromosome Move(String SceneId,int opId, LocalDateTime newStartTime,
public Chromosome Move(String SceneId,List<Integer> opId, LocalDateTime newStartTime,
Long newMachineId) {
......@@ -604,7 +605,7 @@ order.setDueDate(LocalDateTime.of(2025, 12, 1,0,0,0));
public void WriteScheduleSummary(Chromosome schedule) {
// 写入日志
FileHelper.writeLogFile(String.format("\n=== Schedule Summary === %f", schedule.getFitness()));
FileHelper.writeLogFile("\n=== Schedule Summary === ");
FileHelper.writeLogFile(String.format("Operation: %s", schedule.getOperationStr()));
FileHelper.writeLogFile(String.format("Makespan: %f minutes", schedule.getMakespan()));
FileHelper.writeLogFile(String.format("Total Tardiness: %f hours", schedule.getDelayTime()));
......
......@@ -26,9 +26,14 @@ public class PlanResultServiceTest {
@Test
public void testExecute() {
LocalDateTime t= LocalDateTime.of(2025, 10, 31, 6, 51, 11);
// planResultService.execute2("");
planResultService.Move("86ED02C9BAB54BB6B8F413938A3F2869",1,t,3402L);
LocalDateTime t= LocalDateTime.of(2025, 11, 15, 6, 51, 11);
List<Integer> opids=new ArrayList<>();
opids.add(1);
planResultService.Move("B571EF6682DB463AB2977B1055A74112",opids,t,3403L);
// planResultService.Move("B571EF6682DB463AB2977B1055A74112",2,t,3243L);
}
@Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment