diff --git a/lib/nn.cpp b/lib/nn.cpp index f4bc73d..a21e97a 100644 --- a/lib/nn.cpp +++ b/lib/nn.cpp @@ -244,7 +244,17 @@ void Computation::clear() float Computation::qVal(int index) const { Q_ASSERT(index < m_positions); - return m_computation->GetQVal(index); + auto q = m_computation->GetQVal(index); + //Apply trade penalty if not very winning or losing. + //TODO: Try only if Allie losing + if (q < 0.7 && q > 0.3) { + auto trade_penalty = .003; + auto penalty = trade_penalty * (bitboard>piececount - 30); + if(depth % 2 == 1) + penalty = -penalty; + return q + penalty; + } + return q; } void Computation::setPVals(int index, Node *node) const