Skip to content

Commit

Permalink
fixed some compile errors but now get an OoM kill :/
Browse files Browse the repository at this point in the history
  • Loading branch information
aoeixsz4 committed Oct 18, 2020
1 parent d5ff935 commit 5b1a44a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions TNNT/Tracker/Conduct.pm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ sub add_game
$n_ascs += 1;
}

my @zscores, @sorted_keys = greedy_zscore(\@conduct_grid, $cond_multi_array, $conds_max, $n_ascs, \@game_keys);
my (@zscores, @sorted_keys) = greedy_zscore(\@conduct_grid, $cond_multi_array, $conds_max, $n_ascs, \@game_keys);

for (my $i = 0; $i < @sorted_keys; $i++) {
my $se = new TNNT::ScoringEntry(
Expand Down Expand Up @@ -147,21 +147,22 @@ sub greedy_zscore {
$multipliers,
$m_conds,
$n_ascs,
$inial_order) = @_;
$initial_order) = @_;
my @zfactors = (1) x $m_conds;
my @zscores;
my @final_order = @$initial_order;

for (my $i = 0; $i < $n_ascs; $i++) {
my $temp_best = 0;
my $best_index = 0;
my $score;
for (my $j = $i; $j < $n_ascs; $j++) {
# compute a trial conduct Z-score for each game, to see which is best
# j loops through each game and i will steadily increase as we find best games
my $score = 1;
$score = 1;
for (my $k = 0; $k < $m_conds; $k++) {
if ($grid->[$i][$j] != 0) {
$score *= $multipliers[$k];
$score *= $multipliers->[$k];
}
}

Expand Down

0 comments on commit 5b1a44a

Please sign in to comment.