Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Main extends App{
- val startDate: Int = 7 // Days from 29 Jun 2018 (can't be 0)
- val targetDate: Int = 695 // Total days from 29 June 2028 to 25 May 2020
- val deplenishRate: Int = 70
- val rewards: Seq[Float] = Seq[Float](60, 54, 48, 42, 36, 30, 24, 24, 18, 12, 6, 0.00075f)
- val maxPhase: Int = 14
- val startQty: Float = 1000000
- val startMn: Int = 100
- val targetNumberOfMN = Seq(1800,2200,2600) // Tweakable
- val blocksPerDay: Float = 1440
- for(j <- 0 until 3) {
- val initialValueOfMN = 1400 // As 30 June2018
- var curMn: Int = startMn
- var curQty: Float = startQty
- var rewardIndex: Int = 0
- var curPhase = 3
- def totalNumberOfMN(day: Float, iteration: Int) = Math.ceil(initialValueOfMN + (targetNumberOfMN(iteration) - initialValueOfMN)*(day/targetDate)).toInt
- println(s"iteration: $j, number of MN raising to ${targetNumberOfMN(j)}")
- println(s"Starting from $startDate days after 29 Jun 2018 with $curMn MN and $curQty QTY")
- for(i <- startDate until targetDate) {
- curQty += (rewards(Math.min(rewardIndex, rewards.size-1)) *curMn)*(blocksPerDay/totalNumberOfMN(i, j))
- if(curQty >= 10000*(curMn +1)) {
- curMn+=1
- }
- if(i%deplenishRate == 0 && curPhase != maxPhase){
- rewardIndex+=1
- println(s"Day $i, End of phase $curPhase, curMn: $curMn, total gain: $curQty")
- println(s"Projected total number of MN in the world: ${totalNumberOfMN(i, j)}")
- curPhase+=1
- }
- }
- println(s"Final total amount of MN in the world: ${targetNumberOfMN(j)}")
- println(s"Final MN count after ${targetDate - startDate} days: $curMn")
- println(s"Final QTY count after ${targetDate - startDate} days: $curQty")
- println("//===============================================================//")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement