app/models/PlayerAgent.js
//generate an amount to be paid by this bot
generate an amount to be paid by this bot
generate an amount to be paid by this bot
generateTopupAmount() {
    const agent = this
    const len = agent.topupRates.length
    let amount = 0
    let wtp_factor = 1
    for (let i = 0; i < len; i++) {
      const rate = agent.topupRates[i] * wtp_factor
      const range = agent.topupRanges[i]
      if (Math.random() < rate) {
        wtp_factor *= 0.6
        amount += nextDecimal(range[0], range[1])
      }
    }
    return amount
  }
generateTopupAmount ( ) { const agent = this const len = agent . topupRates . length let amount = 0 let wtp_factor = 1 for ( let i = 0 ; i < len ; i ++ ) { const rate = agent . topupRates [ i ] * wtp_factor const range = agent . topupRanges [ i ] if ( Math . random ( ) < rate ) { wtp_factor *= 0.6 amount += nextDecimal ( range [ 0 ] , range [ 1 ] ) } } return amount }
generate an amount to be paid by this bot
generate an amount to be paid by this bot