<commit_before>#ifndef FUEL_H_
#define FUEL_H_

#include <math.h>
#include <map>

#include "phys/object.h"

namespace phys {

class Fuel : public Object {
 public:
  Fuel(double scat_p, double fiss_p, double avg_yield)
    : avg_yield_(avg_yield), nom_fiss_prob_(fiss_p), scat_prob_(scat_p) { };

  Fuel(const Fuel* f) : Object(f) {
    avg_yield_ = f->avg_yield_;
    nom_fiss_prob_ = f->nom_fiss_prob_;
    scat_prob_ = f->scat_prob_;
    rand_gen_ = f->rand_gen_;
    uniform_ = f->uniform_;
  }

  virtual double fiss_prob(double speed) {
    return Neutron::kMinSpeed / speed * nom_fiss_prob_;
  };

  virtual double scatter_prob(double speed) {
    return scat_prob_;
  };

  virtual bool React(Rxn rx, double x, double y) {
    int fuel_per_px = 10000;
    if (rx != RxFission) {
      return true;
    }

    Rect r = rect();
    double relx = x - r.x;
    double rely = y - r.y;
    std::pair<int, int> p = std::make_pair((int)(relx), (int)(rely));
    if (voids_[p] > fuel_per_px) {
      return false;
    }

    if (voids_.count(p) == 0) {
      voids_[p] = 0;
    }
<commit_msg>return fissile atom density closer to normal<commit_after>#ifndef FUEL_H_
#define FUEL_H_

#include <math.h>
#include <map>

#include "phys/object.h"

namespace phys {

class Fuel : public Object {
 public:
  Fuel(double scat_p, double fiss_p, double avg_yield)
    : avg_yield_(avg_yield), nom_fiss_prob_(fiss_p), scat_prob_(scat_p) { };

  Fuel(const Fuel* f) : Object(f) {
    avg_yield_ = f->avg_yield_;
    nom_fiss_prob_ = f->nom_fiss_prob_;
    scat_prob_ = f->scat_prob_;
    rand_gen_ = f->rand_gen_;
    uniform_ = f->uniform_;
  }

  virtual double fiss_prob(double speed) {
    return Neutron::kMinSpeed / speed * nom_fiss_prob_;
  };

  virtual double scatter_prob(double speed) {
    return scat_prob_;
  };

  virtual bool React(Rxn rx, double x, double y) {
    int fuel_per_px = 500;
    if (rx != RxFission) {
      return true;
    }

    Rect r = rect();
    double relx = x - r.x;
    double rely = y - r.y;
    std::pair<int, int> p = std::make_pair((int)(relx), (int)(rely));
    if (voids_[p] > fuel_per_px) {
      return false;
    }

    if (voids_.count(p) == 0) {
      voids_[p] = 0;
    }

{'fraction_non_alphanumeric': 0.13387607417458164, 'fraction_numerical': 0.005427408412483039, 'mean_word_length': 3.0587155963302752, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, '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': '6498499', 'n_tokens_mistral': 915, 'n_tokens_neox': 870, 'n_words': 198}