Skip to content

Commit 5e2fe41

Browse files
committed
Add: island production planner
1 parent a995ba1 commit 5e2fe41

13 files changed

Lines changed: 1685 additions & 0 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
@@ -2040,6 +2040,19 @@
20402040
"Storage": {}
20412041
}
20422042
},
2043+
"IslandProductionPlanner": {
2044+
"IslandProductionPlanner": {
2045+
"RescanIslandTechnology": false,
2046+
"DailyProfitLowerLimit": 50000,
2047+
"MinStockSafetyMargin": 0,
2048+
"FieldsEfficiency": 0,
2049+
"OrchardEfficiency": 0,
2050+
"NurseryEfficiency": 0
2051+
},
2052+
"Storage": {
2053+
"Storage": {}
2054+
}
2055+
},
20432056
"Benchmark": {
20442057
"Benchmark": {
20452058
"DeviceType": "emulator",

module/config/argument/args.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9695,6 +9695,57 @@
96959695
}
96969696
}
96979697
},
9698+
"IslandProductionPlanner": {
9699+
"IslandProductionPlanner": {
9700+
"RescanIslandTechnology": {
9701+
"type": "checkbox",
9702+
"value": false
9703+
},
9704+
"DailyProfitLowerLimit": {
9705+
"type": "input",
9706+
"value": 50000
9707+
},
9708+
"MinStockSafetyMargin": {
9709+
"type": "input",
9710+
"value": 0
9711+
},
9712+
"FieldsEfficiency": {
9713+
"type": "select",
9714+
"value": 0,
9715+
"option": [
9716+
0,
9717+
0.04,
9718+
0.12
9719+
]
9720+
},
9721+
"OrchardEfficiency": {
9722+
"type": "select",
9723+
"value": 0,
9724+
"option": [
9725+
0,
9726+
0.04,
9727+
0.12
9728+
]
9729+
},
9730+
"NurseryEfficiency": {
9731+
"type": "select",
9732+
"value": 0,
9733+
"option": [
9734+
0,
9735+
0.04,
9736+
0.12
9737+
]
9738+
}
9739+
},
9740+
"Storage": {
9741+
"Storage": {
9742+
"type": "storage",
9743+
"value": {},
9744+
"valuetype": "ignore",
9745+
"display": "disabled"
9746+
}
9747+
}
9748+
},
96989749
"Benchmark": {
96999750
"Benchmark": {
97009751
"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+
MinStockSafetyMargin: 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
@@ -360,6 +360,8 @@ Tool:
360360
- OpsiDaemon
361361
EventStory:
362362
- EventStory
363+
IslandProductionPlanner:
364+
- IslandProductionPlanner
363365
Benchmark:
364366
- Benchmark
365367
AzurLaneUncensored:

module/config/config_generated.py

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

479+
# Group `IslandProductionPlanner`
480+
IslandProductionPlanner_RescanIslandTechnology = False
481+
IslandProductionPlanner_DailyProfitLowerLimit = 50000
482+
IslandProductionPlanner_MinStockSafetyMargin = 0
483+
IslandProductionPlanner_FieldsEfficiency = 0 # 0, 0.04, 0.12
484+
IslandProductionPlanner_OrchardEfficiency = 0 # 0, 0.04, 0.12
485+
IslandProductionPlanner_NurseryEfficiency = 0 # 0, 0.04, 0.12
486+
479487
# Group `Benchmark`
480488
Benchmark_DeviceType = 'emulator' # emulator, plone_cloud_with_adb, phone_cloud_without_adb, android_phone, android_phone_vmos
481489
Benchmark_TestScene = 'screenshot_click' # screenshot_click, screenshot, click

module/config/i18n/en-US.json

Lines changed: 43 additions & 0 deletions
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": ""
@@ -2780,6 +2784,45 @@
27802784
"False": "False"
27812785
}
27822786
},
2787+
"IslandProductionPlanner": {
2788+
"_info": {
2789+
"name": "Island Production Planner",
2790+
"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."
2791+
},
2792+
"RescanIslandTechnology": {
2793+
"name": "Rescan Island Technology this time",
2794+
"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."
2795+
},
2796+
"DailyProfitLowerLimit": {
2797+
"name": "Daily Profit Lower Limit",
2798+
"help": "Negative value means accepting a daily loss, 0 means breaking even, and positive value means profit."
2799+
},
2800+
"MinStockSafetyMargin": {
2801+
"name": "Minimum Stock Safety Margin",
2802+
"help": "Multiplier margin applied to planner-generated minimum stock. 0.2 means exporting 120% of the calculated stock. Restaurant dishes are kept at least at capacity."
2803+
},
2804+
"FieldsEfficiency": {
2805+
"name": "Faircrop Fields Efficiency",
2806+
"help": "See character collecting reward for your value",
2807+
"0": "0",
2808+
"0.04": "0.04",
2809+
"0.12": "0.12"
2810+
},
2811+
"OrchardEfficiency": {
2812+
"name": "Sweetscent Orchard Efficiency",
2813+
"help": "See character collecting reward for your value",
2814+
"0": "0",
2815+
"0.04": "0.04",
2816+
"0.12": "0.12"
2817+
},
2818+
"NurseryEfficiency": {
2819+
"name": "Newsprout Nursery Efficiency",
2820+
"help": "See character collecting reward for your value",
2821+
"0": "0",
2822+
"0.04": "0.04",
2823+
"0.12": "0.12"
2824+
}
2825+
},
27832826
"Benchmark": {
27842827
"_info": {
27852828
"name": "Performance Test",

module/config/i18n/ja-JP.json

Lines changed: 43 additions & 0 deletions
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": ""
@@ -2780,6 +2784,45 @@
27802784
"False": "False"
27812785
}
27822786
},
2787+
"IslandProductionPlanner": {
2788+
"_info": {
2789+
"name": "離島生産ソルバー",
2790+
"help": "設定したパラメータに基づいて線形計画法で離島の生産計画を最適化し、離島生産モジュール用の設定を生成します。\nグルメ運営と離島生産の要望品目のコンフィグ設定を先に行ってください。\n任務状態を初期化すれば、離島技術を再度スキャンできます。"
2791+
},
2792+
"RescanIslandTechnology": {
2793+
"name": "離島技術を再スキャン",
2794+
"help": "離島技術のスキャンをやり直し、離島生産プランナーの設定を更新します。"
2795+
},
2796+
"DailyProfitLowerLimit": {
2797+
"name": "日次利益下限",
2798+
"help": "負の値は日次損失を許容、0は収支トントン、正の値は利益を意味します。"
2799+
},
2800+
"MinStockSafetyMargin": {
2801+
"name": "最低在庫安全マージン",
2802+
"help": "生産プランナーが生成する最低在庫に適用する倍率マージンです。0.2 は計算在庫の 120% を出力します。レストラン料理は少なくとも容量分を保持します。"
2803+
},
2804+
"FieldsEfficiency": {
2805+
"name": "豊穣の畑の効率",
2806+
"help": "キャラの収集報酬を参照してください",
2807+
"0": "0",
2808+
"0.04": "0.04",
2809+
"0.12": "0.12"
2810+
},
2811+
"OrchardEfficiency": {
2812+
"name": "薫る果樹園の効率",
2813+
"help": "キャラの収集報酬を参照してください",
2814+
"0": "0",
2815+
"0.04": "0.04",
2816+
"0.12": "0.12"
2817+
},
2818+
"NurseryEfficiency": {
2819+
"name": "青々苗場の効率",
2820+
"help": "キャラの収集報酬を参照してください",
2821+
"0": "0",
2822+
"0.04": "0.04",
2823+
"0.12": "0.12"
2824+
}
2825+
},
27832826
"Benchmark": {
27842827
"_info": {
27852828
"name": "Benchmark._info.name",

module/config/i18n/zh-CN.json

Lines changed: 43 additions & 0 deletions
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": ""
@@ -2780,6 +2784,45 @@
27802784
"False": "False"
27812785
}
27822786
},
2787+
"IslandProductionPlanner": {
2788+
"_info": {
2789+
"name": "岛屿生产规划器",
2790+
"help": "将使用线性规划根据用户设置的参数优化岛屿生产计划,并为岛屿生产模块生成配置。\n需要先配置好岛屿餐厅管理的参数和岛屿生产的追加需求物品。\n清除任务状态以重新扫描岛屿科技树。"
2791+
},
2792+
"RescanIslandTechnology": {
2793+
"name": "本次重新扫描岛屿科技",
2794+
"help": "如果你的岛屿科技树有变动,请勾选此项以重新扫描岛屿科技树并生成新的生产计划\n如果不勾选,Alas将使用上次扫描的结果,可能会导致生产计划不合理"
2795+
},
2796+
"DailyProfitLowerLimit": {
2797+
"name": "每日利润下限",
2798+
"help": "负值表示接受每日亏损,0表示收支平衡,正值表示利润"
2799+
},
2800+
"MinStockSafetyMargin": {
2801+
"name": "最低库存安全余量",
2802+
"help": "应用于生产规划器生成的最低库存的倍率余量。0.2 表示导出计算库存的 120%。餐厅菜品至少保持为容量。"
2803+
},
2804+
"FieldsEfficiency": {
2805+
"name": "丰壤农田效率",
2806+
"help": "参见角色收集奖励中的数值",
2807+
"0": "0",
2808+
"0.04": "0.04",
2809+
"0.12": "0.12"
2810+
},
2811+
"OrchardEfficiency": {
2812+
"name": "坠香果园效率",
2813+
"help": "参见角色收集奖励中的数值",
2814+
"0": "0",
2815+
"0.04": "0.04",
2816+
"0.12": "0.12"
2817+
},
2818+
"NurseryEfficiency": {
2819+
"name": "青芽苗圃效率",
2820+
"help": "参见角色收集奖励中的数值",
2821+
"0": "0",
2822+
"0.04": "0.04",
2823+
"0.12": "0.12"
2824+
}
2825+
},
27832826
"Benchmark": {
27842827
"_info": {
27852828
"name": "性能测试",

0 commit comments

Comments
 (0)