<commit_before>/*
 * Parameters.java
 *
 * Copyright (C) 2008  <NAME>
 *
 * This file is part of Open-NARS.
 *
 * Open-NARS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * Open-NARS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Open-NARS.  If not, see <http://www.gnu.org/licenses/>.
 */
package nars.config;

import nars.language.Interval.PortableDouble;


/**
 * NAR operating parameters.
 * All static values will be removed so that this is an entirely dynamic class.
 */
public class Parameters {
    
    public static boolean SHOW_REASONING_ERRORS=false; //currently false because the sentence constructor is the only one
                                                       //who creates them but is not doing it because of an error.
    
    /** 
       Cycles per duration.
       Past/future tense usage convention;
       How far away "past" and "future" is from "now", in cycles.         
       The range of "now" is [-DURATION/2, +DURATION/2];      */
    public static int DURATION = 5;
    
    /** use this for advanced error checking, at the expense of lower performance.
        it is enabled for unit tests automatically regardless of the value here.    */
    public static boolean DEBUG = false;

    /** for thorough bag debugging (slow) */
    public static boolean DEBUG_BAG = false;
    public static boolean DEBUG_INVALID_SENTENCES = true;

    //FIELDS BELOW ARE BEING CONVERTED TO DYNAMIC, NO MORE STATIC: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //
    //Pei comments: parameters will be separated into a dynamic group and a static group
    //              and the latter contains "personality parameters" that cannot be changed
    //              in the lifetime of the system, though different systems may take different
    //              values. For example, to change HORIZON dynamically will cause inconsistency 
    //              in evidence evaluation.
        


    /* ---------- logical parameters ---------- */
    /** Evidential Horizon, the amount of future evidence to be considered. 
     * Must be >=1.0, usually 1 .. 2
     */
    public static float HORIZON = 1;
    


    
    /** determines the internal precision used for TruthValue calculations.
     *  a value of 0.01 gives 100 truth value states between 0 and 1.0.
     *  other values may be used, for example, 0.02 for 50, 0.10 for 10, etc.
     *  Change at your own risk
     */
    public static final float TRUTH_EPSILON = 0.01f;
    public static final float TRUTH_PRECISION = 1.0f / TRUTH_EPSILON;
    public static float MAX_CONFIDENCE = 1.0f - TRUTH_EPSILON;

    public static final float BUDGET_EPSILON = 0.0001f;
    
    /* ---------- budget thresholds ---------- */
    /** The budget threshold rate for task to be accepted. */
    public static final float BUDGET_THRESHOLD = (float) 0.01;

    /* ---------- default input values ---------- */
    /** Default expectation for confirmation. */
    public static final float DEFAULT_CONFIRMATION_EXPECTATION = (float) 0.6;
    /** Default expectation for creation of concept. */
    public static final float DEFAULT_CREATION_EXPECTATION = (float) 0.66; //0.66
     /** Default expectation for creation of concept for goals. */
    public static final float DEFAULT_CREATION_EXPECTATION_GOAL = (float) 0.6; //0.66
    /** Default confidence of input judgment. */
    public static final float DEFAULT_JUDGMENT_CONFIDENCE = (float) 0.9;
    /** Default priority of input judgment */
    public static float DEFAULT_JUDGMENT_PRIORITY = (float) 0.8;
    /** Default durability of input judgment */
    public static float DEFAULT_JUDGMENT_DURABILITY = (float) 0.5; //was 0.8 in 1.5.5; 0.5 after
    /** Default priority of input question */
    public static final float DEFAULT_QUESTION_PRIORITY = (float) 0.9;
    /** Default durability of input question */
    public static final float DEFAULT_QUESTION_DURABILITY = (float) 0.9;

    
     /** Default confidence of input goal. */
     public static final float DEFAULT_GOAL_CONFIDENCE = (float) 0.9;
     /** Default priority of input judgment */
     public static final float DEFAULT_GOAL_PRIORITY = (float) 0.9;
     /** Default durability of input judgment */
     public static final float DEFAULT_GOAL_DURABILITY = (float) 0.9;
     /** Default priority of input question */
     public static final float DEFAULT_QUEST_PRIORITY = (float) 0.9;
     /** Default durability of input question */
     public static final float DEFAULT_QUEST_DURABILITY = (float) 0.9;
 
    
    /* ---------- space management ---------- */
    
    /** Level separation in LevelBag, one digit, for display (run-time adjustable) and management (fixed)
     */
    public static final float BAG_THRESHOLD = 1.0f;

    /** (see its use in budgetfunctions iterative forgetting) */
    public static float FORGET_QUALITY_RELATIVE = 0.1f;
    
    public static int REVISION_MAX_OCCURRENCE_DISTANCE = 10;

    /** Size of ConceptBag and level amount */
    public static final int CONCEPT_BAG_SIZE = 10000;
    public static final int CONCEPT_BAG_LEVELS = 1000;
    /** Size of TaskLinkBag */
    public static final int TASK_LINK_BAG_SIZE = 100;  //was 200 in new experiment
    public static final int TASK_LINK_BAG_LEVELS = 10;
    /** Size of TermLinkBag */
    public static final int TERM_LINK_BAG_SIZE = 100;  //was 1000 in new experiment
    public static final int TERM_LINK_BAG_LEVELS = 10;
    /** Maximum TermLinks checked for novelty for each TaskLink in TermLinkBag */
    public static final int TERM_LINK_MAX_MATCHED = 10;
    /** Size of Novel Task Buffer */
    public static final int NOVEL_TASK_BAG_SIZE = 100;
    public static final int NOVEL_TASK_BAG_LEVELS = 10;
    /*  Size of derived sequence and input event bag */
    public static int SEQUENCE_BAG_SIZE = 30;
    public static final int SEQUENCE_BAG_LEVELS = 10;
    /*  Size of remembered last operation tasks */
    public static int OPERATION_BAG_SIZE = 10;
    public static final int OPERATION_BAG_LEVELS = 10;
    public static int OPERATION_SAMPLES = 6; //should be at least 2 to not only consider last decision
    public static int TARGET_GOAL_BAG_SIZE = 10;
    public static final int TARGET_GOAL_BAG_LEVELS = 10;
    public static int TARGET_GOAL_SAMPLES = 2;
    
    /** How fast events decay in confidence **/
    public static final PortableDouble projectionDecay = new PortableDouble(0.1);
    
    /* ---------- avoiding repeated reasoning ---------- */
        /** Maximum length of the evidental base of the Stamp, a power of 2 */
    public static final int MAXIMUM_EVIDENTAL_BASE_LENGTH = 20000;
    
    /** Maximum length of Stamp, a power of 2 */
    //public static final int MAXIMUM_STAMP_LENGTH = 8;
    
    /** Maximum TermLinks used in reasoning for each Task in Concept */
    public static final int TERMLINK_MAX_REASONED = 3;
    
    <commit_msg>Target goal samples subject to deletion. Seems unnecessary it suffices to happen when a goal is processed.<commit_after>/*
 * Parameters.java
 *
 * Copyright (C) 2008  <NAME>
 *
 * This file is part of Open-NARS.
 *
 * Open-NARS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * Open-NARS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Open-NARS.  If not, see <http://www.gnu.org/licenses/>.
 */
package nars.config;

import nars.language.Interval.PortableDouble;


/**
 * NAR operating parameters.
 * All static values will be removed so that this is an entirely dynamic class.
 */
public class Parameters {
    
    public static boolean SHOW_REASONING_ERRORS=false; //currently false because the sentence constructor is the only one
                                                       //who creates them but is not doing it because of an error.
    
    /** 
       Cycles per duration.
       Past/future tense usage convention;
       How far away "past" and "future" is from "now", in cycles.         
       The range of "now" is [-DURATION/2, +DURATION/2];      */
    public static int DURATION = 5;
    
    /** use this for advanced error checking, at the expense of lower performance.
        it is enabled for unit tests automatically regardless of the value here.    */
    public static boolean DEBUG = false;

    /** for thorough bag debugging (slow) */
    public static boolean DEBUG_BAG = false;
    public static boolean DEBUG_INVALID_SENTENCES = true;

    //FIELDS BELOW ARE BEING CONVERTED TO DYNAMIC, NO MORE STATIC: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //
    //Pei comments: parameters will be separated into a dynamic group and a static group
    //              and the latter contains "personality parameters" that cannot be changed
    //              in the lifetime of the system, though different systems may take different
    //              values. For example, to change HORIZON dynamically will cause inconsistency 
    //              in evidence evaluation.
        


    /* ---------- logical parameters ---------- */
    /** Evidential Horizon, the amount of future evidence to be considered. 
     * Must be >=1.0, usually 1 .. 2
     */
    public static float HORIZON = 1;
    


    
    /** determines the internal precision used for TruthValue calculations.
     *  a value of 0.01 gives 100 truth value states between 0 and 1.0.
     *  other values may be used, for example, 0.02 for 50, 0.10 for 10, etc.
     *  Change at your own risk
     */
    public static final float TRUTH_EPSILON = 0.01f;
    public static final float TRUTH_PRECISION = 1.0f / TRUTH_EPSILON;
    public static float MAX_CONFIDENCE = 1.0f - TRUTH_EPSILON;

    public static final float BUDGET_EPSILON = 0.0001f;
    
    /* ---------- budget thresholds ---------- */
    /** The budget threshold rate for task to be accepted. */
    public static final float BUDGET_THRESHOLD = (float) 0.01;

    /* ---------- default input values ---------- */
    /** Default expectation for confirmation. */
    public static final float DEFAULT_CONFIRMATION_EXPECTATION = (float) 0.6;
    /** Default expectation for creation of concept. */
    public static final float DEFAULT_CREATION_EXPECTATION = (float) 0.66; //0.66
     /** Default expectation for creation of concept for goals. */
    public static final float DEFAULT_CREATION_EXPECTATION_GOAL = (float) 0.6; //0.66
    /** Default confidence of input judgment. */
    public static final float DEFAULT_JUDGMENT_CONFIDENCE = (float) 0.9;
    /** Default priority of input judgment */
    public static float DEFAULT_JUDGMENT_PRIORITY = (float) 0.8;
    /** Default durability of input judgment */
    public static float DEFAULT_JUDGMENT_DURABILITY = (float) 0.5; //was 0.8 in 1.5.5; 0.5 after
    /** Default priority of input question */
    public static final float DEFAULT_QUESTION_PRIORITY = (float) 0.9;
    /** Default durability of input question */
    public static final float DEFAULT_QUESTION_DURABILITY = (float) 0.9;

    
     /** Default confidence of input goal. */
     public static final float DEFAULT_GOAL_CONFIDENCE = (float) 0.9;
     /** Default priority of input judgment */
     public static final float DEFAULT_GOAL_PRIORITY = (float) 0.9;
     /** Default durability of input judgment */
     public static final float DEFAULT_GOAL_DURABILITY = (float) 0.9;
     /** Default priority of input question */
     public static final float DEFAULT_QUEST_PRIORITY = (float) 0.9;
     /** Default durability of input question */
     public static final float DEFAULT_QUEST_DURABILITY = (float) 0.9;
 
    
    /* ---------- space management ---------- */
    
    /** Level separation in LevelBag, one digit, for display (run-time adjustable) and management (fixed)
     */
    public static final float BAG_THRESHOLD = 1.0f;

    /** (see its use in budgetfunctions iterative forgetting) */
    public static float FORGET_QUALITY_RELATIVE = 0.1f;
    
    public static int REVISION_MAX_OCCURRENCE_DISTANCE = 10;

    /** Size of ConceptBag and level amount */
    public static final int CONCEPT_BAG_SIZE = 10000;
    public static final int CONCEPT_BAG_LEVELS = 1000;
    /** Size of TaskLinkBag */
    public static final int TASK_LINK_BAG_SIZE = 100;  //was 200 in new experiment
    public static final int TASK_LINK_BAG_LEVELS = 10;
    /** Size of TermLinkBag */
    public static final int TERM_LINK_BAG_SIZE = 100;  //was 1000 in new experiment
    public static final int TERM_LINK_BAG_LEVELS = 10;
    /** Maximum TermLinks checked for novelty for each TaskLink in TermLinkBag */
    public static final int TERM_LINK_MAX_MATCHED = 10;
    /** Size of Novel Task Buffer */
    public static final int NOVEL_TASK_BAG_SIZE = 100;
    public static final int NOVEL_TASK_BAG_LEVELS = 10;
    /*  Size of derived sequence and input event bag */
    public static int SEQUENCE_BAG_SIZE = 30;
    public static final int SEQUENCE_BAG_LEVELS = 10;
    /*  Size of remembered last operation tasks */
    public static int OPERATION_BAG_SIZE = 10;
    public static final int OPERATION_BAG_LEVELS = 10;
    public static int OPERATION_SAMPLES = 6; //should be at least 2 to not only consider last decision
    public static int TARGET_GOAL_BAG_SIZE = 10;
    public static final int TARGET_GOAL_BAG_LEVELS = 10;
    public static int TARGET_GOAL_SAMPLES = 0;
    
    /** How fast events decay in confidence **/
    public static final PortableDouble projectionDecay = new PortableDouble(0.1);
    
    /* ---------- avoiding repeated reasoning ---------- */
        /** Maximum length of the evidental base of the Stamp, a power of 2 */
    public static final int MAXIMUM_EVIDENTAL_BASE_LENGTH = 20000;
    
    /** Maximum length of Stamp, a power of 2 */
    //public static final int MAXIMUM_STAMP_LENGTH = 8;
    
    /** Maximum TermLinks used in reasoning for each Task in Concept */
    public static final int TERMLINK_MAX_REASONED = 3;
    
    
{'fraction_non_alphanumeric': 0.08822931490140272, 'fraction_numerical': 0.02060039303381446, 'mean_word_length': 2.6647628507573877, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7304337', 'n_tokens_mistral': 4339, 'n_tokens_neox': 3987, 'n_words': 1672}