<commit_before>"use strict";

import {Scenario} from "./model/scenario.js";
import {Settings} from "../settings/model/settings.js";
import {Range} from "../settings/model/range.js";

/**
 * Applies and manages scenarios.
 */ 
class ScenarioService {

    /* ngInject */

    /**
     * @constructor 
     * @param {SettingsService} settingsService
     * @param {DataService} dataService
     */
    constructor(settingsService, dataService) {

        /**
         * @type {SettingsService}
         */
        this.settingsService = settingsService;

        /**
         * @type {DataService}
         */
        this.dataService = dataService;

    }

    /**
     * Applies a given scenario to the current codecharta session.
     * @param {Scenario} scenario
     */
    applyScenario(scenario) {
        this.settingsService.applySettings(scenario.settings);
    }

    /**
     * Returns an array of all scenarios.
     * @returns {Scenario[]} all scenarios
     */
    getScenarios() {
        return [this.getDefaultScenario()];
    }

    /**
     * Returns the default scenario.
     * @returns {Scenario} the scenario
     */
    getDefaultScenario() {
        let defaultRange = new Range(2,4,false);
        let defaultSettings = new Settings(this.settingsService.settings.map, defaultRange, "RLOC", "MCC", "MCC", false, false,1);
        return new Scenario("RLOC/MCC/MCC(2,4)", defaultSettings);
    }

}<commit_msg>delta cubes enabled by default<commit_after>"use strict";

import {Scenario} from "./model/scenario.js";
import {Settings} from "../settings/model/settings.js";
import {Range} from "../settings/model/range.js";

/**
 * Applies and manages scenarios.
 */ 
class ScenarioService {

    /* ngInject */

    /**
     * @constructor 
     * @param {SettingsService} settingsService
     * @param {DataService} dataService
     */
    constructor(settingsService, dataService) {

        /**
         * @type {SettingsService}
         */
        this.settingsService = settingsService;

        /**
         * @type {DataService}
         */
        this.dataService = dataService;

    }

    /**
     * Applies a given scenario to the current codecharta session.
     * @param {Scenario} scenario
     */
    applyScenario(scenario) {
        this.settingsService.applySettings(scenario.settings);
    }

    /**
     * Returns an array of all scenarios.
     * @returns {Scenario[]} all scenarios
     */
    getScenarios() {
        return [this.getDefaultScenario()];
    }

    /**
     * Returns the default scenario.
     * @returns {Scenario} the scenario
     */
    getDefaultScenario() {
        let defaultRange = new Range(2,4,false);
        let defaultSettings = new Settings(this.settingsService.settings.map, defaultRange, "RLOC", "MCC", "MCC", true, false,1);
        return new Scenario("RLOC/MCC/MCC(2,4)", defaultSettings);
    }

}
{'fraction_non_alphanumeric': 0.131852879944483, 'fraction_numerical': 0.0034698126301179735, 'mean_word_length': 2.411834319526627, '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': '6078107', 'n_tokens_mistral': 838, 'n_tokens_neox': 819, 'n_words': 188}