<commit_before>package de.lessvoid.nifty.tools.pulsate.provider;

import java.util.Properties;

import de.lessvoid.nifty.tools.pulsate.PulsatorProvider;

/**
 * SinusPulsater.
 * @author void
 */
public class RectanglePulsator implements PulsatorProvider {

  /**
   * scale factor for the sinus.
   */
  private float scaleFactor;

  /**
   * start time.
   */
  private float startTime;

  /**
   * Initialize the Pulsater.
   * @param parameter the parameters
   */
  public void initialize(final Properties parameter) {
    this.scaleFactor = Float.parseFloat(parameter.getProperty("scaleFactor", "200"));
  }

  /**
   * Get current value for the given time.
   * @param msTime current time
   * @return the pulsate value in [0,1] intervall
   */
  public float getValue(final long msTime) {
    float value = (float) (Math.signum(Math.sin((msTime - startTime) * scaleFactor)) + 1.0f) / 2.0f;
    return value;
  }

  /**
   * Reset.
   * @param msTime current time in ms
   */
  public void reset(final long msTime) {
    this.startTime = msTime;
  }
}<commit_msg>added period instead of scaleFactor thing to the RectangularPulsator<commit_after>package de.lessvoid.nifty.tools.pulsate.provider;

import java.util.Properties;

import de.lessvoid.nifty.tools.pulsate.PulsatorProvider;

/**
 * SinusPulsater.
 * @author void
 */
public class RectanglePulsator implements PulsatorProvider {

  /**
   * period  for the sinus.
   */
  private float period;

  /**
   * start time.
   */
  private float startTime;

  /**
   * Initialize the Pulsater.
   * @param parameter the parameters
   */
  public void initialize(final Properties parameter) {
    this.period = Float.parseFloat(parameter.getProperty("period", "1000"));
  }

  /**
   * Get current value for the given time.
   * @param msTime current time
   * @return the pulsate value in [0,1] intervall
   */
  public float getValue(final long msTime) {
    return (float) (Math.signum(Math.sin(Math.PI * (msTime - startTime) / period)) + 1.0f) / 2.0f;
  }

  /**
   * Reset.
   * @param msTime current time in ms
   */
  public void reset(final long msTime) {
    this.startTime = msTime;
  }
}
{'fraction_non_alphanumeric': 0.11781076066790352, 'fraction_numerical': 0.008812615955473098, 'mean_word_length': 3.0929791271347247, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3143412', 'n_tokens_mistral': 717, 'n_tokens_neox': 694, 'n_words': 183}