Skip to content

Commit bb0fe41

Browse files
committed
Add: island production planner
1 parent 286cb55 commit bb0fe41

13 files changed

Lines changed: 1690 additions & 4 deletions

File tree

alas.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,10 @@ def event_story(self):
443443
from module.eventstory.eventstory import EventStory
444444
EventStory(config=self.config, device=self.device, task="EventStory").run()
445445

446+
def island_production_planner(self):
447+
from module.island_handler.production_planner import IslandProductionPlanner
448+
IslandProductionPlanner(config=self.config, device=self.device, task="IslandProductionPlanner").run()
449+
446450
def azur_lane_uncensored(self):
447451
from module.daemon.uncensored import AzurLaneUncensored
448452
AzurLaneUncensored(config=self.config, device=self.device, task="AzurLaneUncensored").run()

config/template.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,6 +2038,19 @@
20382038
"Storage": {}
20392039
}
20402040
},
2041+
"IslandProductionPlanner": {
2042+
"IslandProductionPlanner": {
2043+
"RescanIslandTechnology": false,
2044+
"DailyProfitLowerLimit": 50000,
2045+
"DailyBufferSafetyMargin": 0,
2046+
"FieldsEfficiency": 0,
2047+
"OrchardEfficiency": 0,
2048+
"NurseryEfficiency": 0
2049+
},
2050+
"Storage": {
2051+
"Storage": {}
2052+
}
2053+
},
20412054
"Benchmark": {
20422055
"Benchmark": {
20432056
"DeviceType": "emulator",

module/config/argument/args.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9693,6 +9693,57 @@
96939693
}
96949694
}
96959695
},
9696+
"IslandProductionPlanner": {
9697+
"IslandProductionPlanner": {
9698+
"RescanIslandTechnology": {
9699+
"type": "checkbox",
9700+
"value": false
9701+
},
9702+
"DailyProfitLowerLimit": {
9703+
"type": "input",
9704+
"value": 50000
9705+
},
9706+
"DailyBufferSafetyMargin": {
9707+
"type": "input",
9708+
"value": 0
9709+
},
9710+
"FieldsEfficiency": {
9711+
"type": "select",
9712+
"value": 0,
9713+
"option": [
9714+
0,
9715+
0.04,
9716+
0.12
9717+
]
9718+
},
9719+
"OrchardEfficiency": {
9720+
"type": "select",
9721+
"value": 0,
9722+
"option": [
9723+
0,
9724+
0.04,
9725+
0.12
9726+
]
9727+
},
9728+
"NurseryEfficiency": {
9729+
"type": "select",
9730+
"value": 0,
9731+
"option": [
9732+
0,
9733+
0.04,
9734+
0.12
9735+
]
9736+
}
9737+
},
9738+
"Storage": {
9739+
"Storage": {
9740+
"type": "storage",
9741+
"value": {},
9742+
"valuetype": "ignore",
9743+
"display": "disabled"
9744+
}
9745+
}
9746+
},
96969747
"Benchmark": {
96979748
"Benchmark": {
96989749
"DeviceType": {

module/config/argument/argument.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,19 @@ EventStory:
820820
type: checkbox
821821
value: false
822822
option: [ true, false ]
823+
IslandProductionPlanner:
824+
RescanIslandTechnology: false
825+
DailyProfitLowerLimit: 50000
826+
DailyBufferSafetyMargin: 0
827+
FieldsEfficiency:
828+
value: 0
829+
option: [ 0, 0.04, 0.12 ]
830+
OrchardEfficiency:
831+
value: 0
832+
option: [ 0, 0.04, 0.12 ]
833+
NurseryEfficiency:
834+
value: 0
835+
option: [ 0, 0.04, 0.12 ]
823836
Benchmark:
824837
DeviceType:
825838
value: emulator

module/config/argument/menu.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"Daemon",
116116
"OpsiDaemon",
117117
"EventStory",
118+
"IslandProductionPlanner",
118119
"Benchmark",
119120
"AzurLaneUncensored",
120121
"GameManager"

module/config/argument/task.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ Tool:
359359
- OpsiDaemon
360360
EventStory:
361361
- EventStory
362+
IslandProductionPlanner:
363+
- IslandProductionPlanner
362364
Benchmark:
363365
- Benchmark
364366
AzurLaneUncensored:

module/config/config_generated.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,14 @@ class GeneratedConfig:
474474
# Group `EventStory`
475475
EventStory_SkipBattle = False # True, False
476476

477+
# Group `IslandProductionPlanner`
478+
IslandProductionPlanner_RescanIslandTechnology = False
479+
IslandProductionPlanner_DailyProfitLowerLimit = 50000
480+
IslandProductionPlanner_DailyBufferSafetyMargin = 0
481+
IslandProductionPlanner_FieldsEfficiency = 0 # 0, 0.04, 0.12
482+
IslandProductionPlanner_OrchardEfficiency = 0 # 0, 0.04, 0.12
483+
IslandProductionPlanner_NurseryEfficiency = 0 # 0, 0.04, 0.12
484+
477485
# Group `Benchmark`
478486
Benchmark_DeviceType = 'emulator' # emulator, plone_cloud_with_adb, phone_cloud_without_adb, android_phone, android_phone_vmos
479487
Benchmark_TestScene = 'screenshot_click' # screenshot_click, screenshot, click

module/config/i18n/en-US.json

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@
294294
"name": "Event Story",
295295
"help": ""
296296
},
297+
"IslandProductionPlanner": {
298+
"name": "Island Production Planner",
299+
"help": "Planner for optimizing island production plan to earn pt subject to given daily profit.\nWill export bootstrap inventory stock quantities and accumulating item quantities to config after running, which can be used for production planning in the future without scanning technology again.\nNote: The production plan is optimized based on the technology status at the time of scanning, if there are changes in technology status, it is recommended to run the planner again to get an updated production plan."
300+
},
297301
"Benchmark": {
298302
"name": "Performance Test",
299303
"help": ""
@@ -2590,7 +2594,7 @@
25902594
},
25912595
"StockFloorItems": {
25922596
"name": "Stock Floor Items",
2593-
"help": "Hard stock floor for each item\nNormal orders and recipe ingredient usage will not spend below this amount\nExample format:\n(item name on the current server): (quantity)"
2597+
"help": "Hard stock floor for each item\nNormal orders and recipe ingredient usage will not spend below this amount\nPlanner-exported restaurant dishes are kept at least at restaurant capacity\nExample format:\n(item name on the current server): (quantity)"
25942598
},
25952599
"DailyBufferItems": {
25962600
"name": "Daily Buffer Items",
@@ -2774,6 +2778,45 @@
27742778
"False": "False"
27752779
}
27762780
},
2781+
"IslandProductionPlanner": {
2782+
"_info": {
2783+
"name": "Island Production Planner",
2784+
"help": "Will use linear programming to optimize the production plan for the island based on the parameters you set and generate the config for Island Production module.\nPlease set Island Restaurant config and Island Production Preserved Items first.\nClear Task status to rerun Island Technology Scanner."
2785+
},
2786+
"RescanIslandTechnology": {
2787+
"name": "Rescan Island Technology this time",
2788+
"help": "Alas will rescan the island technology and update the config for Island Production module with the new technology levels\nThis is useful when you have just upgraded your island technology and want to update the production plan accordingly."
2789+
},
2790+
"DailyProfitLowerLimit": {
2791+
"name": "Daily Profit Lower Limit",
2792+
"help": "Negative value means accepting a daily loss, 0 means breaking even, and positive value means profit."
2793+
},
2794+
"DailyBufferSafetyMargin": {
2795+
"name": "Daily Buffer Safety Margin",
2796+
"help": "Multiplier margin applied to planner-generated daily buffer. 0.2 means exporting 120% of the calculated daily demand."
2797+
},
2798+
"FieldsEfficiency": {
2799+
"name": "Faircrop Fields Efficiency",
2800+
"help": "See character collecting reward for your value",
2801+
"0": "0",
2802+
"0.04": "0.04",
2803+
"0.12": "0.12"
2804+
},
2805+
"OrchardEfficiency": {
2806+
"name": "Sweetscent Orchard Efficiency",
2807+
"help": "See character collecting reward for your value",
2808+
"0": "0",
2809+
"0.04": "0.04",
2810+
"0.12": "0.12"
2811+
},
2812+
"NurseryEfficiency": {
2813+
"name": "Newsprout Nursery Efficiency",
2814+
"help": "See character collecting reward for your value",
2815+
"0": "0",
2816+
"0.04": "0.04",
2817+
"0.12": "0.12"
2818+
}
2819+
},
27772820
"Benchmark": {
27782821
"_info": {
27792822
"name": "Performance Test",

module/config/i18n/ja-JP.json

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@
294294
"name": "Event Story",
295295
"help": ""
296296
},
297+
"IslandProductionPlanner": {
298+
"name": "離島生産ソルバー",
299+
"help": "線形計画法を使用して、指定した日次利益を満たしつつ ポイントを獲得します。\n実行後、ブートストラップの在庫数量と累積アイテム数量をコンフィグに出力します。これは、再度技術をスキャンしなくても将来の生産計画に使用できます。\n注意: 生産計画はスキャン時点の技術状況に基づいて最適化されるため、技術状況に変更がある場合は、更新された生産計画を得るために再度プランナーを実行することを推奨します。"
300+
},
297301
"Benchmark": {
298302
"name": "機能テスト",
299303
"help": ""
@@ -2590,7 +2594,7 @@
25902594
},
25912595
"StockFloorItems": {
25922596
"name": "在庫下限品目",
2593-
"help": "各品目の厳格な在庫下限です。\n通常注文とレシピの素材消費はこの数量を下回らないようにします。\n形式例:\n(現在のサーバーでの品目名): (数量)"
2597+
"help": "各品目の厳格な在庫下限です。\n通常注文とレシピの素材消費はこの数量を下回らないようにします。\nプランナーが出力するレストラン料理は少なくともレストラン容量分を保持します。\n形式例:\n(現在のサーバーでの品目名): (数量)"
25942598
},
25952599
"DailyBufferItems": {
25962600
"name": "日次バッファ品目",
@@ -2774,6 +2778,45 @@
27742778
"False": "False"
27752779
}
27762780
},
2781+
"IslandProductionPlanner": {
2782+
"_info": {
2783+
"name": "離島生産ソルバー",
2784+
"help": "設定したパラメータに基づいて線形計画法で離島の生産計画を最適化し、離島生産モジュール用の設定を生成します。\nグルメ運営と離島生産の要望品目のコンフィグ設定を先に行ってください。\n任務状態を初期化すれば、離島技術を再度スキャンできます。"
2785+
},
2786+
"RescanIslandTechnology": {
2787+
"name": "離島技術を再スキャン",
2788+
"help": "離島技術のスキャンをやり直し、離島生産プランナーの設定を更新します。"
2789+
},
2790+
"DailyProfitLowerLimit": {
2791+
"name": "日次利益下限",
2792+
"help": "負の値は日次損失を許容、0は収支トントン、正の値は利益を意味します。"
2793+
},
2794+
"DailyBufferSafetyMargin": {
2795+
"name": "日次バッファ安全マージン",
2796+
"help": "生産プランナーが生成する日次バッファに適用する倍率マージンです。0.2 は計算された日次需要の 120% を出力します。"
2797+
},
2798+
"FieldsEfficiency": {
2799+
"name": "豊穣の畑の効率",
2800+
"help": "キャラの収集報酬を参照してください",
2801+
"0": "0",
2802+
"0.04": "0.04",
2803+
"0.12": "0.12"
2804+
},
2805+
"OrchardEfficiency": {
2806+
"name": "薫る果樹園の効率",
2807+
"help": "キャラの収集報酬を参照してください",
2808+
"0": "0",
2809+
"0.04": "0.04",
2810+
"0.12": "0.12"
2811+
},
2812+
"NurseryEfficiency": {
2813+
"name": "青々苗場の効率",
2814+
"help": "キャラの収集報酬を参照してください",
2815+
"0": "0",
2816+
"0.04": "0.04",
2817+
"0.12": "0.12"
2818+
}
2819+
},
27772820
"Benchmark": {
27782821
"_info": {
27792822
"name": "Benchmark._info.name",

module/config/i18n/zh-CN.json

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@
294294
"name": "活动剧情",
295295
"help": ""
296296
},
297+
"IslandProductionPlanner": {
298+
"name": "岛屿生产规划器",
299+
"help": "将根据用户设置的参数使用线性规划优化岛屿的生产计划,并生成岛屿生产模块的配置"
300+
},
297301
"Benchmark": {
298302
"name": "性能测试",
299303
"help": ""
@@ -2590,7 +2594,7 @@
25902594
},
25912595
"StockFloorItems": {
25922596
"name": "库存下限物品",
2593-
"help": "每种物品的硬库存下限\n普通订单和配方原料消耗不会低于该数量\n格式示例:\n(物品在当前服务器的名称): (数量)"
2597+
"help": "每种物品的硬库存下限\n普通订单和配方原料消耗不会低于该数量\n生产规划器导出的餐厅菜品至少保持为餐厅容量\n格式示例:\n(物品在当前服务器的名称): (数量)"
25942598
},
25952599
"DailyBufferItems": {
25962600
"name": "每日缓冲物品",
@@ -2774,6 +2778,45 @@
27742778
"False": "False"
27752779
}
27762780
},
2781+
"IslandProductionPlanner": {
2782+
"_info": {
2783+
"name": "岛屿生产规划器",
2784+
"help": "将使用线性规划根据用户设置的参数优化岛屿生产计划,并为岛屿生产模块生成配置。\n需要先配置好岛屿餐厅管理的参数和岛屿生产的追加需求物品。\n清除任务状态以重新扫描岛屿科技树。"
2785+
},
2786+
"RescanIslandTechnology": {
2787+
"name": "本次重新扫描岛屿科技",
2788+
"help": "如果你的岛屿科技树有变动,请勾选此项以重新扫描岛屿科技树并生成新的生产计划\n如果不勾选,Alas将使用上次扫描的结果,可能会导致生产计划不合理"
2789+
},
2790+
"DailyProfitLowerLimit": {
2791+
"name": "每日利润下限",
2792+
"help": "负值表示接受每日亏损,0表示收支平衡,正值表示利润"
2793+
},
2794+
"DailyBufferSafetyMargin": {
2795+
"name": "每日缓冲安全余量",
2796+
"help": "应用于生产规划器生成的每日缓冲的倍率余量。0.2 表示导出计算每日需求的 120%。"
2797+
},
2798+
"FieldsEfficiency": {
2799+
"name": "丰壤农田效率",
2800+
"help": "参见角色收集奖励中的数值",
2801+
"0": "0",
2802+
"0.04": "0.04",
2803+
"0.12": "0.12"
2804+
},
2805+
"OrchardEfficiency": {
2806+
"name": "坠香果园效率",
2807+
"help": "参见角色收集奖励中的数值",
2808+
"0": "0",
2809+
"0.04": "0.04",
2810+
"0.12": "0.12"
2811+
},
2812+
"NurseryEfficiency": {
2813+
"name": "青芽苗圃效率",
2814+
"help": "参见角色收集奖励中的数值",
2815+
"0": "0",
2816+
"0.04": "0.04",
2817+
"0.12": "0.12"
2818+
}
2819+
},
27772820
"Benchmark": {
27782821
"_info": {
27792822
"name": "性能测试",

0 commit comments

Comments
 (0)