<commit_before>import java.util.*;
import java.io.*;

public class NanoRefinery
{
    public NanoRefinery (Vector<Reaction> reactions, boolean debug)
    {
        _debug = debug;
        _reactions = reactions;
        _storage = new Vector<ChemicalQuantity>();  // where we will store excess ChemicalQuantities
        _amountOfOre = 0;

        if (_debug)
        {
            Enumeration<Reaction> iter = reactions.elements();

            while (iter.hasMoreElements())
                System.out.println(iter.nextElement());
        }
    }

    /*
     * Create the most amount of fuel from the given amount of ore.
     */

    public final long createMaxFuelFromOre (long oreAvailable)
    {
        Reaction fuel = findReaction(Chemical.FUEL);
        long fuelCreated = 0L;

        /*
         * Look at the reactions needed to create the amount
         * of fuel. Work backwards from there.
         */

        if (fuel != null)
        {
            long lastRoundFuel = 0L;  // remember the fuel we created last iteration

            _amountOfOre = 0L;

            while (_amountOfOre < oreAvailable)
            {
                lastRoundFuel = fuelCreated;

                Vector<ChemicalQuantity> fuelChemicalQuantities = fuel.getChemicalQuantities();    // maybe not all reactions loaded are needed
                Enumeration<ChemicalQuantity> iter = fuelChemicalQuantities.elements();                

                while (iter.hasMoreElements())
                {
                    ChemicalQuantity reaction = iter.nextElement();

                    synthesiseChemical(reaction);
                }

                lastRoundFuel = fuelCreated;

                fuelCreated += fuel.chemicalCreated().getAmount();
            }

            if (_amountOfOre > oreAvailable)  // if we used more ore than available, report the previous fuel amount
                fuelCreated = lastRoundFuel;
        }
        else
            System.out.println("Error! No fuel required?!");
<commit_msg>Update NanoRefinery.java<commit_after>import java.util.*;
import java.io.*;

public class NanoRefinery
{
    public NanoRefinery (Vector<Reaction> reactions, boolean debug)
    {
        _debug = debug;
        _reactions = reactions;
        _storage = new Vector<ChemicalQuantity>();  // where we will store excess ChemicalQuantities
        _amountOfOre = 0;

        if (_debug)
        {
            Enumeration<Reaction> iter = reactions.elements();

            while (iter.hasMoreElements())
                System.out.println(iter.nextElement());
        }
    }

    /*
     * Create the most amount of fuel from the given amount of ore.
     */

    public final long createMaxFuelFromOre (long oreAvailable)
    {
        Reaction fuel = findReaction(Chemical.FUEL);
        long fuelCreated = 0L;

        /*
         * Look at the reactions needed to create the amount
         * of fuel. Work backwards from there.
         */

        if (fuel != null)
        {
            long lastRoundFuel = 0L;  // remember the fuel we created last iteration

            _amountOfOre = 0L;

            while (_amountOfOre < oreAvailable)
            {
                lastRoundFuel = fuelCreated;

                if (_debug)
                {
                    System.out.println("Fuel created so far: "+lastRoundFuel);
                    System.out.println("Ore used so far: "+_amountOfOre);

                Vector<ChemicalQuantity> fuelChemicalQuantities = fuel.getChemicalQuantities();    // maybe not all reactions loaded are needed
                Enumeration<ChemicalQuantity> iter = fuelChemicalQuantities.elements();                

                while (iter.hasMoreElements())
                {
                    ChemicalQuantity reaction = iter.nextElement();

                    synthesiseChemical(reaction);
                }

                lastRoundFuel = fuelCreated;

                fuelCreated += fuel.chemicalCreated().getAmount();
            }

            if (_amountOfOre > oreAvailable)  // if we used more ore than available, report the previous fuel amount
                fuelCreated = lastRoundFuel;
        }
        else
            System.out.println("Error! No fuel required?!");

{'fraction_non_alphanumeric': 0.08045165843330981, 'fraction_numerical': 0.0018819101387908728, 'mean_word_length': 1.7273893521488133, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '6337339', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1023, 'n_words': 293}