Skip to content

Commit

Permalink
增加自定义急救阈值
Browse files Browse the repository at this point in the history
  • Loading branch information
Anyk00 authored and Shawnsdaddy committed Jan 27, 2025
1 parent 2abbad9 commit 5601f01
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arknights_mower/solvers/base_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@ def resting(self):
self.ideal_resting_count = (
4
if self.op_data.average_mood()
> self.op_data.config.resting_threshold * 0.75
> self.op_data.config.resting_threshold * config.conf.rescue_threshold
else len(self.op_data.dorm)
)
logger.debug(f"当前理想休息人数是{self.ideal_resting_count}")
Expand Down
2 changes: 2 additions & 0 deletions arknights_mower/utils/config/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ class RunOrderGrandetModeConf(ConfModel):
"菲亚防呆"
fia_threshold: float = 0.9
"菲亚阈值"
rescue_threshold: float = 0.75
"急救阈值"
merge_interval: float = 10
"不养闲人合并间隔"
flexible_shift_mode: bool = False
Expand Down
21 changes: 21 additions & 0 deletions ui/src/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const {
theme,
resting_threshold,
fia_threshold,
rescue_threshold,
tap_to_launch_game,
exit_game_when_idle,
close_simulator_when_idle,
Expand Down Expand Up @@ -569,6 +570,26 @@ const onSelectionChange = (newValue) => {
</n-input-number>
</div>
</n-form-item>
<n-form-item>
<template #label>
<span>急救阈值</span>
<help-text>
<div>整体心情低于换班阈值乘急救阈值后,将忽视高优人数安排休息任务。</div>
</help-text>
</template>
<div class="threshold">
<n-slider
v-model:value="rescue_threshold"
:step="5"
:min="0"
:max="90"
:format-tooltip="(v) => `${v}%`"
/>
<n-input-number v-model:value="rescue_threshold" :step="5" :min="0" :max="90">
<template #suffix>%</template>
</n-input-number>
</div>
</n-form-item>
</n-form>
</n-card>
</div>
Expand Down
4 changes: 4 additions & 0 deletions ui/src/stores/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const useConfigStore = defineStore('config', () => {
const simulator = ref({ name: '', index: -1 })
const resting_threshold = ref(50)
const fia_threshold = ref(90)
const rescue_threshold = ref(75)
const theme = ref('light')
const tap_to_launch_game = ref(false)
const exit_game_when_idle = ref(true)
Expand Down Expand Up @@ -131,6 +132,7 @@ export const useConfigStore = defineStore('config', () => {
simulator.value = response.data.simulator
resting_threshold.value = response.data.resting_threshold * 100
fia_threshold.value = response.data.fia_threshold * 100
rescue_threshold.value = response.data.rescue_threshold * 100
theme.value = response.data.theme
tap_to_launch_game.value = response.data.tap_to_launch_game
tap_to_launch_game.value.enable = tap_to_launch_game.value.enable ? 'tap' : 'adb'
Expand Down Expand Up @@ -215,6 +217,7 @@ export const useConfigStore = defineStore('config', () => {
theme: theme.value,
resting_threshold: resting_threshold.value / 100,
fia_threshold: fia_threshold.value / 100,
rescue_threshold: rescue_threshold.value / 100,
tap_to_launch_game: {
enable: tap_to_launch_game.value.enable == 'tap',
x: tap_to_launch_game.value.x,
Expand Down Expand Up @@ -315,6 +318,7 @@ export const useConfigStore = defineStore('config', () => {
simulator,
resting_threshold,
fia_threshold,
rescue_threshold,
theme,
tap_to_launch_game,
exit_game_when_idle,
Expand Down

0 comments on commit 5601f01

Please sign in to comment.