<commit_before>/*
 * Copyright 2014 <NAME>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * This code is part of the reference implementation of http://arxiv.org/abs/1409.6075
 * 
 * This is provided as an example to help in the understanding of the ITEM model system.
 */
package edu.columbia.tjw.item;

import edu.columbia.tjw.item.util.random.PrngType;
import edu.columbia.tjw.item.util.random.RandomTool;
import java.io.Serializable;
import java.util.Random;

/**
 *
 * Some general settings that control how curves are constructed and fit.
 *
 * Generally, don't change these unless you know what you're doing.
 *
 *
 * @author tyler
 */
public final class ItemSettings implements Serializable
{
    private static final double STANDARD_AIC_CUTOFF = -5.0;
    private static final int BLOCK_SIZE = 200 * 1000;
    private static final int THREAD_BLOCK_SIZE = 10 * 1000;
    private static final long serialVersionUID = 6850856502170239624L;

    private final Random _rand;
    private final boolean _randomShuffle;
    private final boolean _useThreading;
    private final boolean _approximateDerivatives;

    private final double _aicCutoff;

    private final int _blockSize;
    private final int _threadBlockSize;

    public ItemSettings()
    {
        this(true, STANDARD_AIC_CUTOFF, RandomTool.getRandom(PrngType.STANDARD), BLOCK_SIZE, THREAD_BLOCK_SIZE, true);
    }

    public ItemSettings(final boolean randomShuffle_, final double aicCutoff_, final Random rand_, final int blockSize_, final int threadBlockSize_, final boolean useThreading_)
    {
        if (aicCutoff_ > 0.0)
        {
            throw new IllegalArgumentException("The AIC cutoff must be negative: " + aicCutoff_);
        }

        if (threadBlockSize_ < 100)
        {
            throw new IllegalArgumentException("Thread block size should not be too small: " + threadBlockSize_);
        }
        if (blockSize_ < threadBlockSize_)
        {
            throw new IllegalArgumentException("Block size cannot be less than ThreadBlockSize: " + blockSize_);
        }

        _rand = rand_;
        _randomShuffle = randomShuffle_;
        _aicCutoff = aicCutoff_;
        _blockSize = blockSize_;
        _threadBlockSize = threadBlockSize_;
        _useThreading = useThreading_;
        _approximateDerivatives = false;
    }

    public boolean getUseThreading()
    {
        return _useThreading;
    }

    public int getBlockSize()
    {
        return _blockSize;
    }

    public int getThreadBlockSize()
    {
        return _threadBlockSize;
    }

    public double getAicCutoff()
    {
        return _aicCutoff;
    }

    public boolean isRandomShuffle()
    {
        return _randomShuffle;
    }

    public Random getRandom()
    {
        return _rand;
    }

}<commit_msg>Incrementing version number.<commit_after>/*
 * Copyright 2014 <NAME>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * This code is part of the reference implementation of http://arxiv.org/abs/1409.6075
 * 
 * This is provided as an example to help in the understanding of the ITEM model system.
 */
package edu.columbia.tjw.item;

import edu.columbia.tjw.item.util.random.PrngType;
import edu.columbia.tjw.item.util.random.RandomTool;
import java.io.Serializable;
import java.util.Random;

/**
 *
 * Some general settings that control how curves are constructed and fit.
 *
 * Generally, don't change these unless you know what you're doing.
 *
 *
 * @author tyler
 */
public final class ItemSettings implements Serializable
{
    private static final double STANDARD_AIC_CUTOFF = -5.0;
    private static final int BLOCK_SIZE = 200 * 1000;
    private static final int THREAD_BLOCK_SIZE = 10 * 1000;
    private static final long serialVersionUID = 6850856502170239624L;

    private final Random _rand;
    private final boolean _randomShuffle;
    private final boolean _useThreading;
    private final boolean _approximateDerivatives;

    private final double _aicCutoff;

    private final int _blockSize;
    private final int _threadBlockSize;

    public ItemSettings()
    {
        this(true, STANDARD_AIC_CUTOFF, RandomTool.getRandom(PrngType.STANDARD), BLOCK_SIZE, THREAD_BLOCK_SIZE, true);
    }

    public ItemSettings(final boolean randomShuffle_, final double aicCutoff_, final Random rand_, final int blockSize_, final int threadBlockSize_, final boolean useThreading_)
    {
        if (aicCutoff_ > 0.0)
        {
            throw new IllegalArgumentException("The AIC cutoff must be negative: " + aicCutoff_);
        }

        if (threadBlockSize_ < 100)
        {
            throw new IllegalArgumentException("Thread block size should not be too small: " + threadBlockSize_);
        }
        if (blockSize_ < threadBlockSize_)
        {
            throw new IllegalArgumentException("Block size cannot be less than ThreadBlockSize: " + blockSize_);
        }

        _rand = rand_;
        _randomShuffle = randomShuffle_;
        _aicCutoff = aicCutoff_;
        _blockSize = blockSize_;
        _threadBlockSize = threadBlockSize_;
        _useThreading = useThreading_;
        _approximateDerivatives = false;
    }

    public boolean getUseThreading()
    {
        return _useThreading;
    }

    public int getBlockSize()
    {
        return _blockSize;
    }

    public int getThreadBlockSize()
    {
        return _threadBlockSize;
    }

    public double getAicCutoff()
    {
        return _aicCutoff;
    }

    public boolean isRandomShuffle()
    {
        return _randomShuffle;
    }

    public Random getRandom()
    {
        return _rand;
    }

    public boolean approximateDerivatives()
    {
        return _approximateDerivatives;
    }
}
{'fraction_non_alphanumeric': 0.06865804725813643, 'fraction_numerical': 0.016347154109080102, 'mean_word_length': 2.924198250728863, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1212554', 'n_tokens_mistral': 1964, 'n_tokens_neox': 1839, 'n_words': 631}