@ -264,6 +264,10 @@ class Calculator {
val totalBuyin = computables . sum ( ComputableResult . Field . RATED _BUYIN . identifier ) . toDouble ( )
results . addStat ( TOTAL _BUYIN , totalBuyin )
val totalTips = computables . sum ( ComputableResult . Field . RATED _TIPS . identifier ) . toDouble ( )
results . addStat ( TOTAL _TIPS , totalTips )
// Timber.d("########## totalBuyin = ${totalBuyin} ### sum = ${sum}")
val maxNetResult = computables . max ( ComputableResult . Field . RATED _NET . identifier ) ?. toDouble ( )
@ -283,12 +287,12 @@ class Calculator {
results . addStat ( ROI , roi )
}
val shouldComputeITMRatio = options . stats . contains ( TOURNAMENT _ITM _RATIO ) || computableGroup . displayedStats ?. contains ( TOURNAMENT _ITM _RATIO ) == true
if ( shouldComputeITMRatio ) {
val itmCount = computables . count { it . session ?. result ?. cashout ?: 0.0 > 0.0 } // should we add a property inside ComputableResult for better performance?
val itmRatio = itmCount . toDouble ( ) / computables . size . toDouble ( )
results . addStat ( TOURNAMENT _ITM _RATIO , itmRatio )
}
// val shouldComputeITMRatio = options.stats.contains(TOURNAMENT_ITM_RATIO) || computableGroup.displayedStats?.contains(TOURNAMENT_ITM_RATIO) == true
// if (shouldComputeITMRatio) {
// val itmCount = computables.count { it.session?.result?.cashout ?: 0.0 > 0.0 } // should we add a property inside ComputableResult for better performance?
// val itmRatio = itmCount.toDouble() / computables.size.toDouble( )
// results.addStat(TOURNAMENT_ITM_RATIO, itmRatio )
// }
if ( options . computeLocationsPlayed ) {
results . addStat ( LOCATIONS _PLAYED , computables . distinctBy { it . session ?. location ?. id } . size . toDouble ( ) )
@ -298,12 +302,14 @@ class Calculator {
if ( computables . size > 0 ) {
average = sum / computables . size . toDouble ( )
val winRatio = winningSessionCount . toDouble ( ) / computables . size . toDouble ( )
val itmRatio = winningSessionCount . toDouble ( ) / computables . size . toDouble ( )
val avgBuyin = totalBuyin / computables . size . toDouble ( )
results . addStats (
setOf (
ComputedStat ( AVERAGE , average ) ,
ComputedStat ( WIN _RATIO , winRatio ) ,
ComputedStat ( TOURNAMENT _ITM _RATIO , itmRatio ) ,
ComputedStat ( AVERAGE _BUYIN , avgBuyin )
)
)
@ -338,11 +344,9 @@ class Calculator {
tBBSum += computable . bbNet
tBBSessionCount += computable . hasBigBlind
tWinningSessionCount += computable . isPositive
tITMCount += computable . isPositive
tBuyinSum += computable . ratedBuyin
tHands += computable . estimatedHands
if ( shouldComputeITMRatio && computable . session ?. result ?. cashout ?: 0.0 > 0.0 ) {
tITMCount ++
}
if ( computable . isPositive == 1 ) { // positive result
if ( currentStreak >= 0 ) { // currently positive streak