<commit_before>'use strict';

var main = function () {
   $('#early-end-tooltip').tooltip();
   $('#max-fish-tooltip').tooltip();
   $('#available-mystery-tooltip').tooltip();
   $('#reported-mystery-tooltip').tooltip();
   $('#spawn-factor-tooltip').tooltip();
   $('#chance-catch-tooltip').tooltip();
   $('#show-fisher-status-tooltip').tooltip();
   $('#erratic-tooltip').tooltip();
};

$(document).ready(main);<commit_msg>Starting validation for simulation types<commit_after>'use strict';

function readyTooltips() {
   $('#early-end-tooltip').tooltip();
   $('#max-fish-tooltip').tooltip();
   $('#available-mystery-tooltip').tooltip();
   $('#reported-mystery-tooltip').tooltip();
   $('#spawn-factor-tooltip').tooltip();
   $('#chance-catch-tooltip').tooltip();
   $('#show-fisher-status-tooltip').tooltip();
   $('#erratic-tooltip').tooltip();
}

function validate() {
   var errors = [];

   if ($('#name').value().length < 1) {
      errors.push('The simulation type name is missing.');
   }

   var numFishers = parseInt($('#num-fishers').value(), 10);
   if (numFishers < 1) {
      errors.push('There must be at least one fisher per simulation');
   }

   if (numFishers > 12) {
      errors.push('The maximum number of fishers per simulation is twelve.');
   }

   var numHumans = parseInt($('#num-humans').value(), 10);
   if (numHumans < 0) {
      errors.push('There must be zero or more humans per simulation.');
   }

   if (numHumans > numFishers) {
      errors.push('There cannot be more human fishers than total fishers.');
   }

   if (parseInt($('#num-seasons').value(), 10) < 1) {
      errors.push('There must be at least one season per simulation.');
   }

   if (parseInt($('#season-duration').value(), 10) < 1) {
      errors.push('Seasons must have a duration of at least one second.');
   }

   if (parseInt($('#initial-delay').value(), 10) < 1) {
      errors.push('The initial delay must be at least one second long.');
   }
      
   if (parseInt($('#season-delay').value(), 10) < 1) {
      errors.push('The delay between seasons must be at least one second.');
   }

   if (parseFloat($('#fish-value').value()) < 0) {
      errors.push('The value per fish cannot be negative');
   }

   if (parseFloat($('#cost-cast').value()) < 0) {
      errors.push('The cost to attempt to fish cannot be negative.');
   }

   if (parseFloat($('#cost-departure').value()) < 0) {
      errors.push('The cost to set sail cannot be negative.');
   }

   if (parseFloat($('#cost-second').value()) < 0) {
      errors.push('The cost per second at sea cannot be negative.');
   }

   // Remaining fields to validate:
   //
   // Certain fish
   // Available mystery fish
   // Reported mystery fish
   // Maximum fish capacity of ocean
   // Spawn factor
   // Chance of catch
   // Bot names
   // Bot greeds
   // Bot probability of action
   // Bot attempts per second
   // Preparation text
   // End (by time) text
   // End (by depletion) text
}

function main() {
   readyTooltips();
}

$(document).ready(main);
{'fraction_non_alphanumeric': 0.18840579710144928, 'fraction_numerical': 0.008234519104084322, 'mean_word_length': 3.1774415405777168, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 5, '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': '6398920', 'n_tokens_mistral': 939, 'n_tokens_neox': 912, 'n_words': 251}