<commit_before>class RootSegment {
  constructor(x, y, parent){
    this.pos = createVector(x, y);
    this.parent = parent;
    this.nutrientDectionRange = 50;
  }

  get x(){ return this.pos.x; }
  get y(){ return this.pos.y; }

  detectionArea(){
    return new Rect(this.x - this.nutrientDectionRange / 2, 
                    this.y - this.nutrientDectionRange / 2,
                    this.nutrientDectionRange,
                    this.nutrientDectionRange);
  }

  static setStyle(){
    stroke(230);
  }

  draw(){
    fill(50,200,50,80);
    P5JsUtils.drawRect(this.detectionArea());
    line(this.parent.x, this.parent.y, this.x, this.y);
  }
}
<commit_msg>p5js/space-colonization - Refactor RootSegment to determine detection area once<commit_after>class RootSegment {
  constructor(x, y, parent){
    this.pos = createVector(x, y);
    this.parent = parent;
    this.nutrientDectionRange = 50;
    this.detectionArea = new Rect(this.x - this.nutrientDectionRange / 2, 
                                  this.y - this.nutrientDectionRange / 2,
                                  this.nutrientDectionRange,
                                  this.nutrientDectionRange);
  }

  get x(){ return this.pos.x; }
  get y(){ return this.pos.y; }

  static setStyle(){
    stroke(230);
  }

  draw(){
    fill(50,200,50,80);
    P5JsUtils.drawRect(this.detectionArea);
    line(this.parent.x, this.parent.y, this.x, this.y);
  }
}

{'fraction_non_alphanumeric': 0.12918994413407822, 'fraction_numerical': 0.024441340782122904, 'mean_word_length': 2.2202247191011235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3139169', 'n_tokens_mistral': 505, 'n_tokens_neox': 464, 'n_words': 88}