<commit_before>package engine;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @author <NAME>
 *         Date: 27/07/13
 *         Time: 15:52
 */
public class Engine {

    private List<Model> models;
    private Random random;
    private BitstringGenerator bitstringGenerator;
    private ModelGenerator modelGenerator;

    private Problem problem;

    public Engine() {

        models = new ArrayList<>();
        random = new Random();
        bitstringGenerator = new BitstringGenerator(random, 8);
        modelGenerator = new ModelGenerator(random, 8, models);

        problem = new TwoHundredProblem();

    }

    public void tick() {

        Bitstring randomBitstring = bitstringGenerator.generateRandomBitstring();

        Model randomModel1 = modelGenerator.createRandomModel();
        Model randomModel2 = modelGenerator.createRandomModel();

        models.add(randomModel1);
        models.add(randomModel2);

        doTokens(randomBitstring);

    }

    private void doTokens(Bitstring randomBitstring) {

        final int actualFitness = problem.fitness(randomBitstring);

        Model worstModel = models.iterator().next();
        int maxDelta = Math.abs(actualFitness - worstModel.getPredictedFitness(randomBitstring));

        for (Model model : models) {
            int modelPredictedFitness = model.getPredictedFitness(randomBitstring);<commit_msg>Converted a field to a local variable.<commit_after>package engine;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @author <NAME>
 *         Date: 27/07/13
 *         Time: 15:52
 */
public class Engine {

    private List<Model> models;
    private BitstringGenerator bitstringGenerator;
    private ModelGenerator modelGenerator;

    private Problem problem;

    public Engine() {

        models = new ArrayList<>();
        Random random = new Random();
        bitstringGenerator = new BitstringGenerator(random, 8);
        modelGenerator = new ModelGenerator(random, 8, models);

        problem = new TwoHundredProblem();

    }

    public void tick() {

        Bitstring randomBitstring = bitstringGenerator.generateRandomBitstring();

        Model randomModel1 = modelGenerator.createRandomModel();
        Model randomModel2 = modelGenerator.createRandomModel();

        models.add(randomModel1);
        models.add(randomModel2);

        doTokens(randomBitstring);

    }

    private void doTokens(Bitstring randomBitstring) {

        final int actualFitness = problem.fitness(randomBitstring);

        Model worstModel = models.iterator().next();
        int maxDelta = Math.abs(actualFitness - worstModel.getPredictedFitness(randomBitstring));

        for (Model model : models) {
            int modelPredictedFitness = model.getPredictedFitness(randomBitstring);
{'fraction_non_alphanumeric': 0.09126009126009126, 'fraction_numerical': 0.011232011232011231, 'mean_word_length': 3.106628242074928, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5874955', 'n_tokens_mistral': 771, 'n_tokens_neox': 722, 'n_words': 181}