Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified gradlew
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions src/main/java/com/bobrust/generator/HillClimbGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static State getHillClimbSA(State state, int maxAge) {

// Estimate initial temperature from sample mutations
float temperature = estimateTemperature(state);
int totalIterations = maxAge * 10;
int totalIterations = maxAge * 3; // 3x hill climb iterations balances exploration vs speed
float coolingRate = computeCoolingRate(temperature, maxAge);
Comment on lines 90 to 93
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

totalIterations is computed here as maxAge * 3, but computeCoolingRate(temperature, maxAge) recomputes its own totalIterations internally. This duplication is easy to let drift (e.g., future tuning changes one but not the other). Consider passing totalIterations into computeCoolingRate (or defining a shared constant/multiplier) so the loop count and cooling schedule can’t diverge.

Copilot uses AI. Check for mistakes.

State undo = state.getCopy();
Expand Down Expand Up @@ -145,7 +145,7 @@ static float estimateTemperature(State state) {
State probe = state.getCopy();
State undo = probe.getCopy();
float totalDelta = 0;
int samples = 30;
int samples = 10; // fewer probes for faster temperature estimation

for (int i = 0; i < samples; i++) {
float before = probe.getEnergy();
Expand All @@ -167,7 +167,7 @@ static float estimateTemperature(State state) {
* {@code initialTemp} to near-zero (0.001) over {@code maxAge * 10} iterations.
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

The Javadoc says the cooling schedule decays over maxAge * 10 iterations, but the implementation now uses maxAge * 3. Please update the Javadoc (and any related comments) so it matches the actual iteration count.

Suggested change
* {@code initialTemp} to near-zero (0.001) over {@code maxAge * 10} iterations.
* {@code initialTemp} to near-zero (0.001) over {@code maxAge * 3} iterations.

Copilot uses AI. Check for mistakes.
*/
static float computeCoolingRate(float initialTemp, int maxAge) {
int totalIterations = maxAge * 10;
int totalIterations = maxAge * 3; // 3x hill climb iterations balances exploration vs speed
float finalTemp = 0.001f;
if (initialTemp <= finalTemp) {
return 0.99f; // fallback if temperature is already tiny
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/bobrust/generator/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Worker getWorker() {

private static final int max_random_states = 1000;
private static final int age = 100;
private static final int times = Math.max(1, Runtime.getRuntime().availableProcessors() / 2);
private static final int times = 1; // SA explores well enough without multiple chains; keeps speed comparable to original

Comment on lines 99 to 102
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

times is used for both SA and classic hill climbing (getBestHillClimbState(..., times, ...)), but the new comment only justifies this change for SA. If USE_SIMULATED_ANNEALING is toggled off, this also removes the previous multi-chain behavior for classic hill climbing. Consider making times conditional on USE_SIMULATED_ANNEALING (or splitting into separate constants) to avoid an unintended regression for the classic path.

Copilot uses AI. Check for mistakes.
private List<State> randomStates;

Expand Down
Binary file modified test-results/proposal3/edges_adaptive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal3/edges_diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal3/edges_uniform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal3/nature_adaptive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal3/nature_diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal3/nature_uniform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal3/photo_detail_adaptive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal3/photo_detail_diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal3/photo_detail_uniform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal6/nature_diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal6/nature_multi_res.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal6/nature_single_res.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal6/photo_detail_diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal6/photo_detail_multi_res.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test-results/proposal6/photo_detail_single_res.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading