<commit_before>package com.thales.ga;

import java.util.function.Function;

import org.jenetics.EnumGene;
import org.jenetics.Genotype;

import com.thales.model.Item;
import com.thales.model.Vessel;

public class ManifestFitnessFunction implements Function<Genotype<EnumGene<Item>>, Double> {

	private final Vessel vessel;

	public ManifestFitnessFunction(Vessel vessel) {
		this.vessel = vessel;
	}

	@Override
	public Double apply(Genotype<EnumGene<Item>> gt) {
		double cost = 0.0;
		for (EnumGene<Item> c : gt.getChromosome().toSeq()) {
			Item item = c.getAllele();
			int x = c.getAlleleIndex() % vessel.getDimension().width;
			int y = c.getAlleleIndex() / vessel.getDimension().width;
			cost += (item.getPriority().getValue() + item.getUrgency().getValue());
//			fitness += ((Priority.LOWEST.getValue() - item.getPriority().getValue())
//					* (Urgency.ROUTINE.getValue() - item.getUrgency().getValue()));
		}
		return cost;
	}

}<commit_msg>Modified fitness function eq<commit_after>package com.thales.ga;

import java.util.function.Function;

import org.jenetics.EnumGene;
import org.jenetics.Genotype;

import com.thales.model.Item;
import com.thales.model.Vessel;

public class ManifestFitnessFunction implements Function<Genotype<EnumGene<Item>>, Double> {

	private final Vessel vessel;

	public ManifestFitnessFunction(Vessel vessel) {
		this.vessel = vessel;
	}

	@Override
	public Double apply(Genotype<EnumGene<Item>> gt) {
		double cost = 0.0;
		for (EnumGene<Item> c : gt.getChromosome().toSeq()) {
			Item item = c.getAllele();
			int x = c.getAlleleIndex() % vessel.getDimension().width;
			int y = c.getAlleleIndex() / vessel.getDimension().width;
			cost += (item.getPriority().getValue() * item.getUrgency().getValue());
//			fitness += ((Priority.LOWEST.getValue() - item.getPriority().getValue())
//					* (Urgency.ROUTINE.getValue() - item.getUrgency().getValue()));
		}
		return cost;
	}

}
{'fraction_non_alphanumeric': 0.1518460738429537, 'fraction_numerical': 0.0020800832033281333, 'mean_word_length': 4.593023255813954, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '6717144', 'n_tokens_mistral': 712, 'n_tokens_neox': 652, 'n_words': 123}