Skip to content

Commit

Permalink
Allow disable trained-eye for raphael solver
Browse files Browse the repository at this point in the history
fix #18
  • Loading branch information
Tnze committed Oct 11, 2024
1 parent f1fdf0b commit 2e6da05
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src-libs/src/solver/raphael.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub fn solve(
use_manipultaion: bool,
use_heart_and_soul: bool,
use_quick_innovation: bool,
use_trained_eye: bool,
backload_progress: bool,
adversarial: bool,
unsound_branch_pruning: bool,
Expand All @@ -38,7 +39,7 @@ pub fn solve(
if !use_manipultaion {
allowed_actions = allowed_actions.remove(Action::Manipulation);
}
if status.is_action_allowed(Actions::TrainedEye).is_err() {
if !use_trained_eye || status.is_action_allowed(Actions::TrainedEye).is_err() {
allowed_actions = allowed_actions.remove(Action::TrainedEye);
}
let settings = Settings {
Expand Down
2 changes: 2 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ fn raphael_solve(
use_manipulation: bool,
use_heart_and_soul: bool,
use_quick_innovation: bool,
use_trained_eye: bool,
backload_progress: bool,
adversarial: bool,
unsound_branch_pruning: bool,
Expand All @@ -504,6 +505,7 @@ fn raphael_solve(
use_manipulation,
use_heart_and_soul,
use_quick_innovation,
use_trained_eye,
backload_progress,
adversarial,
unsound_branch_pruning,
Expand Down
2 changes: 2 additions & 0 deletions src-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ pub fn raphael_solve(
use_manipultaion: bool,
use_heart_and_soul: bool,
use_quick_innovation: bool,
use_trained_eye: bool,
backload_progress: bool,
adversarial: bool,
unsound_branch_pruning: bool,
Expand All @@ -131,6 +132,7 @@ pub fn raphael_solve(
use_manipultaion,
use_heart_and_soul,
use_quick_innovation,
use_trained_eye,
backload_progress,
adversarial,
unsound_branch_pruning,
Expand Down
3 changes: 3 additions & 0 deletions src/components/designer/solvers/RaphaelSolver.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const raphaelSolveIsSolving = ref(false)
const useManipulation = ref(false)
const useHeartAndSoul = ref(false)
const useQuickInnovation = ref(false)
const useTrainedEye = ref(true)
const backloadProgress = ref(true)
const unsoundBranchPruning = ref(true)
const adversarial = ref(false)
Expand All @@ -55,6 +56,7 @@ function runRaphaelSolver() {
useManipulation.value,
useHeartAndSoul.value,
useQuickInnovation.value,
useTrainedEye.value,
backloadProgress.value,
adversarial.value,
unsoundBranchPruning.value,
Expand All @@ -77,6 +79,7 @@ function runRaphaelSolver() {
</i18n>
</el-dialog>
<el-space direction="vertical" alignment="normal">
<el-checkbox v-model="useTrainedEye" :label="$t('enable-action', { action: $t('trained-eye') })" />
<el-space>
<el-checkbox v-model="useManipulation" :label="$t('enable-action', { action: $t('manipulation') })" />
<el-tag v-if="useManipulation" type="warning">{{ $t('need-learn-manipulation') }}</el-tag>
Expand Down
2 changes: 2 additions & 0 deletions src/libs/Solver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export async function raphael_solve(
useManipulation: boolean,
useHeartAndSoul: boolean,
useQuickInnovation: boolean,
useTrainedEye: boolean,
backloadProgress: boolean,
adversarial: boolean,
unsoundBranchPruning: boolean,
Expand All @@ -136,6 +137,7 @@ export async function raphael_solve(
useManipulation,
useHeartAndSoul,
useQuickInnovation,
useTrainedEye,
backloadProgress,
adversarial,
unsoundBranchPruning,
Expand Down
1 change: 1 addition & 0 deletions src/libs/SolverWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ onmessage = async (e) => {
args.useManipulation,
args.useHeartAndSoul,
args.useQuickInnovation,
args.useTrainedEye,
args.backloadProgress,
args.adversarial,
args.unsoundBranchPruning,
Expand Down

0 comments on commit 2e6da05

Please sign in to comment.