You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to alternate a bit algorithm with my poor understanding of it by changing function Wave::set to accept true values:
bool Wave::set(unsigned index, unsigned pattern, bool value) noexcept
{
bool old_value = data.get(index, pattern);
// If the value isn't changed, nothing needs to be done.
if (old_value == value)
{
return false;
}
// Otherwise, the memoisation should be updated.
data.get(index, pattern) = value;
if(!value){
memoisation.plogp_sum[index] -= plogp_patterns_frequencies[pattern];
memoisation.sum[index] -= patterns_frequencies[pattern];
memoisation.log_sum[index] = log(memoisation.sum[index]);
memoisation.nb_patterns[index]--;
memoisation.entropy[index] = memoisation.log_sum[index] - memoisation.plogp_sum[index] / memoisation.sum[index];
}else{
memoisation.plogp_sum[index] += plogp_patterns_frequencies[pattern];
memoisation.sum[index] += patterns_frequencies[pattern];
memoisation.log_sum[index] = log(memoisation.sum[index]);
memoisation.nb_patterns[index]++;
memoisation.entropy[index] = memoisation.log_sum[index] - memoisation.plogp_sum[index] / memoisation.sum[index];
}
// If there is no patterns possible in the cell, then there is a
// contradiction.
if (memoisation.nb_patterns[index] == 0)
{
is_impossible = true;
//todo: print imposible pattern
}
return is_impossible;
}
Idea is after removing some wave patterns manually, to be able to add some waves patterns, if needed.
But no matter what i do, even if I call this before propagate, algorithm always fails.
Can this work at all? Maybe someone can point or give a hint why this wont work?
The text was updated successfully, but these errors were encountered:
RonYanDaik
changed the title
Set Wave True causes alwais algorithm to fail.
Set Wave True causes algorithm always to fail.
Nov 6, 2023
I've tried to alternate a bit algorithm with my poor understanding of it by changing function Wave::set to accept true values:
Idea is after removing some wave patterns manually, to be able to add some waves patterns, if needed.
But no matter what i do, even if I call this before propagate, algorithm always fails.
Can this work at all? Maybe someone can point or give a hint why this wont work?
The text was updated successfully, but these errors were encountered: