<commit_before>angular.module('ZoumProfiler')
    .directive('fight', function() {
        return {
            restrict: 'E',
            templateUrl: 'fight/fight.html'
        };
    })
    .controller('FightController', ['$scope', 'base', 'fight', function ($scope, base, fight) {

        $scope.fightCapabilities = [];
        $scope.fight = { armP:0, armM:0 };

        $scope._refreshFightCapabilities = function() {
            $scope.fightCapabilities = fight.getFightCapabilities(base, $scope.profile);

            angular.forEach($scope.fightCapabilities, function (compOrSort) {
                var arm = fight.getAppliedArmForFight(compOrSort, $scope.fight.armP, $scope.fight.armM);
                compOrSort.DEG_AA = Math.max(compOrSort.DEG - arm, 1);
                if (compOrSort.DEG_CRITIQ) {
                    compOrSort.DEG_CRITIQ_AA = Math.max(compOrSort.DEG_CRITIQ - arm, 1);
                }
                if (compOrSort.DEG_RESIST) {
                    compOrSort.DEG_RESIST_AA = Math.max(compOrSort.DEG_RESIST - arm, 1);
                }
                if (compOrSort.DEG_RESIST_CRITIQ) {
                    compOrSort.DEG_RESIST_CRITIQ_AA = Math.max(compOrSort.DEG_RESIST_CRITIQ - arm, 1);
                }
            });
        };

        $scope.armChanged = function() {
            $scope._refreshFightCapabilities();
        };

        $scope.$on('_startRefreshFightCapabilities', function() {
            $scope._refreshFightCapabilities();
        });

        /* ********************************************* */
        /* **                 Startup                 ** */
        /* ********************************************* */

        $scope._refreshFightCapabilities();

    }]);<commit_msg>Fix refresh trigger for fight capabilities simulation<commit_after>angular.module('ZoumProfiler')
    .directive('fight', function() {
        return {
            restrict: 'E',
            templateUrl: 'fight/fight.html'
        };
    })
    .controller('FightController', ['$scope', 'base', 'fight', function ($scope, base, fight) {

        $scope.fightCapabilities = [];
        $scope.fight = { armP:0, armM:0 };

        $scope._refreshFightCapabilitiesVersusArm  = function() {
            angular.forEach($scope.fightCapabilities, function (compOrSort) {
                var arm = fight.getAppliedArmForFight(compOrSort, $scope.fight.armP, $scope.fight.armM);
                compOrSort.DEG_AA = Math.max(compOrSort.DEG - arm, 1);
                if (compOrSort.DEG_CRITIQ) {
                    compOrSort.DEG_CRITIQ_AA = Math.max(compOrSort.DEG_CRITIQ - arm, 1);
                }
                if (compOrSort.DEG_RESIST) {
                    compOrSort.DEG_RESIST_AA = Math.max(compOrSort.DEG_RESIST - arm, 1);
                }
                if (compOrSort.DEG_RESIST_CRITIQ) {
                    compOrSort.DEG_RESIST_CRITIQ_AA = Math.max(compOrSort.DEG_RESIST_CRITIQ - arm, 1);
                }
            });
        };

        $scope._refreshFightCapabilities = function() {
            $scope.fightCapabilities = fight.getFightCapabilities(base, $scope.profile);
            $scope._refreshFightCapabilitiesVersusArm();
        };

        $scope.armChanged = function() {
            $scope._refreshFightCapabilitiesVersusArm();
        };

        $scope.$on('_startRefreshFightCapabilities', function() {
            $scope._refreshFightCapabilities();
        });

        /* ********************************************* */
        /* **                 Startup                 ** */
        /* ********************************************* */

        $scope._refreshFightCapabilities();

    }]);
{'fraction_non_alphanumeric': 0.16988312041315576, 'fraction_numerical': 0.0032617559119325905, 'mean_word_length': 1.9725363489499192, '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': '5602587', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1048, 'n_words': 135}