<commit_before>package simulations

import math.random

class EpidemySimulator extends Simulator {

  def randomBelow(i: Int) = (random * i).toInt

  protected[simulations] object SimConfig {
    val population: Int = 300
    val roomRows: Int = 8
    val roomColumns: Int = 8

    // to complete: additional parameters of simulation
  }

  import SimConfig._

  val persons: List[Person] = for (
      i <- List.range(1, SimConfig.population)
    ) yield { new Person(i) }

  agenda = List(
      new WorkItem(1, () => { println("action") } )
    )

  class Person (val id: Int) {
    var infected = randomBelow(100) < 10
    var sick = false
    var immune = false
    var dead = false

    // demonstrates random number generation
    var row: Int = randomBelow(roomRows)
    var col: Int = randomBelow(roomColumns)

    //
    // to complete with simulation logic
    //
  }
}<commit_msg>Prevalence working altough I don't like it<commit_after>package simulations

import math.random

class EpidemySimulator extends Simulator {

  def randomBelow(i: Int) = (random * i).toInt

  protected[simulations] object SimConfig {
    val population: Int = 300
    val roomRows: Int = 8
    val roomColumns: Int = 8

    // to complete: additional parameters of simulation
  }

  import SimConfig._

  val PrevalenceRate = 0.01
  val persons: List[Person] = for (
      i <- List.range(1, SimConfig.population+1)
    ) yield { new Person(i) }

  class Person (val id: Int) {
    val MoveDays = 5
    var infected = id <= (SimConfig.population * PrevalenceRate).toInt
    var sick = false
    var immune = false
    var dead = false

    // demonstrates random number generation
    var row: Int = randomBelow(roomRows)
    var col: Int = randomBelow(roomColumns)

    def moveAction {
      // println(s"I am moving $id")
    }

    afterDelay(randomBelow(MoveDays)+1)(moveAction)
  }
}
{'fraction_non_alphanumeric': 0.09627659574468085, 'fraction_numerical': 0.01276595744680851, 'mean_word_length': 2.8703703703703702, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6438581', 'n_tokens_mistral': 610, 'n_tokens_neox': 551, 'n_words': 182}