diff --git a/Craftimizer/Windows/Settings.cs b/Craftimizer/Windows/Settings.cs index 44c9103..4ec59c7 100644 --- a/Craftimizer/Windows/Settings.cs +++ b/Craftimizer/Windows/Settings.cs @@ -669,9 +669,6 @@ ref isDirty using (var panel = ImRaii2.GroupPanel("Score Weights (Advanced)", -1, out _)) { - ImGui.TextWrapped("All values should add up to 1."); - ImGuiHelpers.ScaledDummy(10); - DrawOption( "Progress", "Amount of weight to give to the craft's progress.", @@ -722,26 +719,6 @@ ref isDirty v => config = config with { ScoreSteps = v }, ref isDirty ); - - if (ImGui.Button("Normalize Weights", OptionButtonSize)) - { - var total = config.ScoreProgress + - config.ScoreQuality + - config.ScoreDurability + - config.ScoreCP + - config.ScoreSteps; - config = config with - { - ScoreProgress = config.ScoreProgress / total, - ScoreQuality = config.ScoreQuality / total, - ScoreDurability = config.ScoreDurability / total, - ScoreCP = config.ScoreCP / total, - ScoreSteps = config.ScoreSteps / total - }; - isDirty = true; - } - if (ImGui.IsItemHovered()) - ImGuiUtils.Tooltip("Normalize all weights to sum up to 1"); } if (isDirty) diff --git a/Solver/MCTSConfig.cs b/Solver/MCTSConfig.cs index 2778a13..9f56eaf 100644 --- a/Solver/MCTSConfig.cs +++ b/Solver/MCTSConfig.cs @@ -32,11 +32,17 @@ public MCTSConfig(in SolverConfig config) MaxScoreWeightingConstant = config.MaxScoreWeightingConstant; ExplorationConstant = config.ExplorationConstant; - ScoreProgress = config.ScoreProgress; - ScoreQuality = config.ScoreQuality; - ScoreDurability = config.ScoreDurability; - ScoreCP = config.ScoreCP; - ScoreSteps = config.ScoreSteps; + var total = config.ScoreProgress + + config.ScoreQuality + + config.ScoreDurability + + config.ScoreCP + + config.ScoreSteps; + + ScoreProgress = config.ScoreProgress / total; + ScoreQuality = config.ScoreQuality / total; + ScoreDurability = config.ScoreDurability / total; + ScoreCP = config.ScoreCP / total; + ScoreSteps = config.ScoreSteps / total; ActionPool = config.ActionPool; }