Skip to content

Commit

Permalink
'Coloring' of MPC codes in interactive Find_Orb should result in a sl…
Browse files Browse the repository at this point in the history
…ightly better distribution of colors, on average.
  • Loading branch information
Bill-Gray committed Nov 16, 2023
1 parent a33af00 commit 45c2d96
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions elem_out.cpp
Expand Up @@ -4123,16 +4123,17 @@ static void improve_mpc_colors( const int n_obs, const OBSERVE FAR *obs,
}
}
for( j = 0; j < max_n_colors; j++)
if( counts[j] < counts[color])
if( counts[j] < counts[color] ||
(counts[j] == counts[color] && !(rand( ) % 3)))
{
if( counts[j] < counts[color])
changes_made = 1;
color = j;
sdata[i].color = (char)color;
changes_made = 1;
}
assert( color >=0 && color < max_n_colors);
}
n_iterations++;
assert( n_iterations < 10);
}
}

Expand Down

0 comments on commit 45c2d96

Please sign in to comment.