パッケージ mechanics.optimization
クラス IterativeSimulator
java.lang.Object
mechanics.optimization.IterativeSimulator
Provides two independent iterative optimization loops:
optimizeER(java.util.function.Function<java.util.Map<java.lang.String, java.lang.Double>, simulation.CombatSimulator>, java.util.function.Consumer<simulation.CombatSimulator>, int)– converges on the minimum Energy Recharge needed for each character to burst on rotation. It re-runs the full rotation simulation each pass, reads actual energy deltas viaEnergyAnalyzer, and updates the per-character ER targets until consecutive passes agree within 1%.optimizeJointPartyCrit(java.util.function.Function<java.util.Map<java.lang.String, java.util.Map<model.type.StatType, java.lang.Integer>>, simulation.CombatSimulator>, java.util.function.Consumer<simulation.CombatSimulator>, java.util.Map<java.lang.String, java.util.List<model.type.StatType>>, java.util.Map<java.lang.String, java.lang.Integer>)– a coordinated hill-climbing loop over all DPS characters. ER rolls are pre-reserved (excluded from the hill-climbing budget) so the optimizer cannot trade away ER to gain more crit. Each character is optimized in turn while the rest of the party holds their current best rolls; the outer loop repeats until no further improvement is found.
-
コンストラクタの概要
コンストラクタ -
メソッドの概要
修飾子とタイプメソッド説明optimizeER(Function<Map<String, Double>, CombatSimulator> simFactory, Consumer<CombatSimulator> rotationRunner, int maxIterations) Runs an iterative simulation to converge on Energy Recharge requirements.optimizeJointPartyCrit(Function<Map<String, Map<StatType, Integer>>, CombatSimulator> simFactory, Consumer<CombatSimulator> rotationRunner, Map<String, List<StatType>> targetCharsMap, Map<String, Integer> erRollsPerChar) Optimizes DPS substat distribution for multiple characters simultaneously.optimizeSubstatsNDim(Function<Map<StatType, Integer>, CombatSimulator> simFactory, Consumer<CombatSimulator> rotationRunner, String charName, List<StatType> statsToOptimize, int totalRolls) Finds the optimal liquid roll distribution for a single character using balanced initialization followed by single-roll hill-climbing swaps.
-
コンストラクタの詳細
-
IterativeSimulator
public IterativeSimulator()
-
-
メソッドの詳細
-
optimizeER
public static Map<String,Double> optimizeER(Function<Map<String, Double>, CombatSimulator> simFactory, Consumer<CombatSimulator> rotationRunner, int maxIterations) Runs an iterative simulation to converge on Energy Recharge requirements.Each iteration:
- Builds a fresh
CombatSimulatorwith the current ER targets viasimFactory. - Executes the full rotation via
rotationRunner. - Derives the next ER targets from actual energy data using
EnergyAnalyzer.calculateERRequirements(simulation.CombatSimulator). - Stops early when every character's ER target changes by less than 1% (absolute) between two consecutive iterations.
- パラメータ:
simFactory- factory that accepts a map ofcharName -> minERand returns a configured simulatorrotationRunner- consumer that drives a complete rotation on the simulatormaxIterations- upper bound on iterations before returning unconverged- 戻り値:
- converged (or best-so-far) map of
charName -> required ER
- Builds a fresh
-
optimizeJointPartyCrit
public static Map<String,Map<StatType, optimizeJointPartyCritInteger>> (Function<Map<String, Map<StatType, Integer>>, CombatSimulator> simFactory, Consumer<CombatSimulator> rotationRunner, Map<String, List<StatType>> targetCharsMap, Map<String, Integer> erRollsPerChar) Optimizes DPS substat distribution for multiple characters simultaneously.ER pre-reservation: The liquid roll budget for each character is
20 - erRollsPerChar[charName]. ER rolls are merged back into the full roll map before every simulation call so the resulting artifact stats are always correct, but the hill-climber never considers ER as a swap candidate. Characters absent fromerRollsPerCharretain the full 20-roll budget.Hill-climbing strategy: Characters are optimized one at a time in the order defined by
targetCharsMap. While one character is being optimized, all others use their current best rolls. The outer loop repeats up to 3 times until a full pass produces no change across any character.- パラメータ:
simFactory- factory that accepts the full party roll map and returns a configured simulatorrotationRunner- consumer that drives a complete rotation on the simulatortargetCharsMap- map ofcharName -> stats to optimizedefining which characters participate and which substats to varyerRollsPerChar- pre-computed liquid ER roll counts per character; characters absent from this map receive the full 20-roll budget; may benull- 戻り値:
- map of
charName -> optimal liquid roll distribution(ER rolls are NOT included here; merge them separately for the final simulation)
-
optimizeSubstatsNDim
public static Map<StatType,Integer> optimizeSubstatsNDim(Function<Map<StatType, Integer>, CombatSimulator> simFactory, Consumer<CombatSimulator> rotationRunner, String charName, List<StatType> statsToOptimize, int totalRolls) Finds the optimal liquid roll distribution for a single character using balanced initialization followed by single-roll hill-climbing swaps.Algorithm:
- Initialization – rolls are spread as evenly as possible across
all stats in
statsToOptimize(remainder goes to the first stats in list order). - Hill climbing – every possible (source, target) pair is evaluated
by moving one roll from source to target. The best-improving swap is
committed, and the loop repeats until no swap improves DPS or
maxSteps(100) is reached. Each stat is capped at 10 rolls.
- パラメータ:
simFactory- factory that accepts a roll map and returns a configured simulator; receives only the DPS rolls (ER excluded)rotationRunner- consumer that drives a complete rotation on the simulatorcharName- name of the character being optimized (for logging)statsToOptimize- the substats the hill-climber is allowed to varytotalRolls- liquid roll budget available (20 minus pre-reserved ER rolls)- 戻り値:
- optimal roll distribution across
statsToOptimize
- Initialization – rolls are spread as evenly as possible across
all stats in
-