Skip to content

Commit

Permalink
Extra scoring changes, mark expert recipes as difficult
Browse files Browse the repository at this point in the history
  • Loading branch information
WorkingRobot committed Jul 29, 2024
1 parent 03eb60e commit 1bc7c46
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions Craftimizer/Windows/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ ref isDirty
"Amount of weight to give to the craft's progress.",
config.ScoreProgress,
0,
1,
100,
v => config = config with { ScoreProgress = v },
ref isDirty
);
Expand All @@ -684,7 +684,7 @@ ref isDirty
"Amount of weight to give to the craft's quality.",
config.ScoreQuality,
0,
1,
100,
v => config = config with { ScoreQuality = v },
ref isDirty
);
Expand All @@ -694,7 +694,7 @@ ref isDirty
"Amount of weight to give to the craft's remaining durability.",
config.ScoreDurability,
0,
1,
100,
v => config = config with { ScoreDurability = v },
ref isDirty
);
Expand All @@ -704,7 +704,7 @@ ref isDirty
"Amount of weight to give to the craft's remaining CP.",
config.ScoreCP,
0,
1,
100,
v => config = config with { ScoreCP = v },
ref isDirty
);
Expand All @@ -715,7 +715,7 @@ ref isDirty
"the step count, the higher the score.",
config.ScoreSteps,
0,
1,
100,
v => config = config with { ScoreSteps = v },
ref isDirty
);
Expand Down
2 changes: 1 addition & 1 deletion Solver/Simulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private bool ShouldUseAction(ActionType action, BaseAction baseAction)
if (action == ActionType.TrainedEye)
return baseAction.CouldUse(this);

var isDifficult = Input.Stats.Level - Input.Recipe.ClassJobLevel < 10;
var isDifficult = Input.Stats.Level - Input.Recipe.ClassJobLevel < 10 || Input.Recipe.IsExpert;

// don't allow quality moves under Muscle Memory for difficult crafts
if (isDifficult &&
Expand Down
14 changes: 7 additions & 7 deletions Solver/SolverConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ public SolverConfig()
ExplorationConstant = 4;
MaxStepCount = 30;
MaxRolloutStepCount = 99;
// Use 80% of all cores if less than 20 cores are available, otherwise use all but 4 cores. Keep at least 1 core.
MaxThreadCount = Math.Max(1, Math.Max(Environment.ProcessorCount - 4, (int)MathF.Floor(Environment.ProcessorCount * 0.8f)));
// Use 75% of all cores if less than 12 cores are available, otherwise use all but 4 cores. Keep at least 1 core.
MaxThreadCount = Math.Max(1, Math.Max(Environment.ProcessorCount - 4, (int)MathF.Floor(Environment.ProcessorCount * 0.75f)));
// Use 32 forks at minimum, or the number of cores, whichever is higher.
ForkCount = Math.Max(Environment.ProcessorCount, 32);
FurcatedActionCount = ForkCount / 2;
StrictActions = true;

ScoreProgress = .20f;
ScoreQuality = .65f;
ScoreDurability = .05f;
ScoreCP = .05f;
ScoreSteps = .05f;
ScoreProgress = 10;
ScoreQuality = 80;
ScoreDurability = 2;
ScoreCP = 3;
ScoreSteps = 5;

ActionPool = DeterministicActionPool;
Algorithm = SolverAlgorithm.StepwiseGenetic;
Expand Down

1 comment on commit 1bc7c46

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 1bc7c46 Previous: 1622902 Ratio
Craftimizer.Benchmark.Bench.Solve(State: 6C371D74, Config: AC411E5B) 96504438.88888888 ns (± 888658.544703237)
Craftimizer.Benchmark.Bench.Solve(State: D9461E47, Config: AC411E5B) 75262181.90476188 ns (± 485558.29123051895)

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.