真完美了
This commit is contained in:
parent
6fdae8acf3
commit
0feb3c70b6
@ -582,7 +582,7 @@
|
||||
" for l in LandName:\n",
|
||||
" for y in years:\n",
|
||||
" for s in SeasonNum:\n",
|
||||
" if is_feasible(c, l, y, s):\n",
|
||||
" if is_feasible(c, l, y, s): # 最小面积约束和加强版01约束\n",
|
||||
" model += X[c, l, y, s] <= LandArea[l] * Y[c, l, y, s], f\"LandAreaConstraint_{c}_{l}_{y}_{s}\"\n",
|
||||
" model += X[c, l, y, s] >= min_area * (\n",
|
||||
" 1 if Y[c, l, y, s] else 0), f\"MinAreaConstraint_{c}_{l}_{y}_{s}\""
|
||||
@ -631,26 +631,6 @@
|
||||
"outputs": [],
|
||||
"execution_count": 25
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"ExecuteTime": {
|
||||
"end_time": "2024-09-08T08:14:19.193505Z",
|
||||
"start_time": "2024-09-08T08:14:19.178490Z"
|
||||
}
|
||||
},
|
||||
"cell_type": "code",
|
||||
"source": [
|
||||
"# # 添加需求约束\n",
|
||||
"# for c in CropName:\n",
|
||||
"# for y in years:\n",
|
||||
"# model += lpSum(\n",
|
||||
"# X[c, l, y, s] for l in LandName for s in SeasonNum if is_feasible(c, l, y, s)\n",
|
||||
"# ) <= crop_demand[c] + Excess[c, y], f\"demand_constraint_{c}_{y}\""
|
||||
],
|
||||
"id": "a2fe5874538f1596",
|
||||
"outputs": [],
|
||||
"execution_count": 26
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"id": "7e13de7700d38f19",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user