<commit_before>package scorex.perma

import akka.actor.{ActorRef, Props, ActorSystem}
import org.slf4j.LoggerFactory
import scorex.perma.actors.MinerSpec.Initialize
import scorex.perma.actors.{Miner, TrustedDealer}
import scorex.perma.merkle.{HashImpl, MerkleTree}

import scala.util.Random

object TestApp extends App {

  val log = LoggerFactory.getLogger(this.getClass)

  import Parameters._

  log.info("Generating random data set")
  val rnd = new Random()
  val dataSet = (1 to segmentSize).map(x => Random.alphanumeric.take(n).mkString).toArray.map(_.getBytes)

  log.info("Calculate tree")
  val tree = MerkleTree.create(dataSet)

  log.info("start actor system")
  protected lazy val actorSystem = ActorSystem("lagonaki")
  val dealer = actorSystem.actorOf(Props(classOf[TrustedDealer], dataSet))
  val miners: Seq[ActorRef] = (1 to 10).map(x => actorSystem.actorOf(Props(classOf[Miner], dealer, tree.hash)))

  log.info("start sending requests")
  miners.head ! Initialize
//  miners.map { m =>
//    m ! Initialize
//  }


}<commit_msg>send message to all miners<commit_after>package scorex.perma

import akka.actor.{ActorRef, Props, ActorSystem}
import org.slf4j.LoggerFactory
import scorex.perma.actors.MinerSpec.Initialize
import scorex.perma.actors.{Miner, TrustedDealer}
import scorex.perma.merkle.{HashImpl, MerkleTree}

import scala.util.Random

object TestApp extends App {

  val log = LoggerFactory.getLogger(this.getClass)

  import Parameters._

  log.info("Generating random data set")
  val rnd = new Random()
  val dataSet = (1 to segmentSize).map(x => Random.alphanumeric.take(n).mkString).toArray.map(_.getBytes)

  log.info("Calculate tree")
  val tree = MerkleTree.create(dataSet)

  log.info("start actor system")
  protected lazy val actorSystem = ActorSystem("lagonaki")
  val dealer = actorSystem.actorOf(Props(classOf[TrustedDealer], dataSet))
  val miners: Seq[ActorRef] = (1 to 10).map(x => actorSystem.actorOf(Props(classOf[Miner], dealer, tree.hash)))

  log.info("start sending requests")
//  miners.head ! Initialize
  miners.map { m =>
    m ! Initialize
  }


}
{'fraction_non_alphanumeric': 0.12351543942992874, 'fraction_numerical': 0.004750593824228029, 'mean_word_length': 4.833795013850415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5040484', 'n_tokens_mistral': 726, 'n_tokens_neox': 705, 'n_words': 156}