<commit_before>/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.algorithm;

import com.google.common.base.Stopwatch;
import com.google.common.collect.Multimap;
import es.usc.citius.hipster.model.HeuristicNode;
import es.usc.citius.hipster.model.function.NodeExpander;

import java.util.*;

/**
 * <p>Implementation of the multi-objective label setting algorithm described
 * by Martins and Santos.</p>
 *
 * Original paper:
 * <NAME>., & <NAME>. (1999). <b>"The labeling algorithm for the multiobjective shortest path problem"</b>. <i>Departamento de Matematica, Universidade de Coimbra, Portugal, Tech. Rep. TR-99/005</i>.
 *
 * @param <S> type of the states used by the algorithm
 * @author <NAME> <<a href="mailto:<EMAIL>"><EMAIL></a>>
 */
public class MultiobjectiveLS<A,S,C extends Comparable<C>,N extends HeuristicNode<A,S,C,N>> extends Algorithm<A,S,N> {
    private NodeExpander<A,S,N> nodeExpander;

    public class MOLSIter implements Iterator<N> {
        private Queue<N> queue = new LinkedList<N>();
        public Multimap<S, N> nonDominated;

        public boolean hasNext() {
            return !this.queue.isEmpty();
        }

        @Override
        public N next() {<commit_msg>Fixed data initialization in MultiobjectiveLS<commit_after>/*
 * Copyright 2014 CITIUS <http://citius.usc.es>, University of Santiago de Compostela.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package es.usc.citius.hipster.algorithm;

import com.google.common.base.Stopwatch;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import es.usc.citius.hipster.model.HeuristicNode;
import es.usc.citius.hipster.model.function.NodeExpander;

import java.util.*;

/**
 * <p>Implementation of the multi-objective label setting algorithm described
 * by Martins and Santos.</p>
 *
 * Original paper:
 * <NAME>., & <NAME>. (1999). <b>"The labeling algorithm for the multiobjective shortest path problem"</b>. <i>Departamento de Matematica, Universidade de Coimbra, Portugal, Tech. Rep. TR-99/005</i>.
 *
 * @param <S> type of the states used by the algorithm
 * @author <NAME> <<a href="mailto:<EMAIL>.<EMAIL>"><EMAIL></a>>
 */
public class MultiobjectiveLS<A,S,C extends Comparable<C>,N extends HeuristicNode<A,S,C,N>> extends Algorithm<A,S,N> {
    private N initialNode;
    private NodeExpander<A,S,N> nodeExpander;

    public MultiobjectiveLS(N initialNode, NodeExpander<A, S, N> nodeExpander) {
        this.initialNode = initialNode;
        this.nodeExpander = nodeExpander;
    }

    public class MOLSIter implements Iterator<N> {
        private Queue<N> queue = new LinkedList<N>();
        public Multimap<S, N> nonDominated;

        public MOLSIter(){
            queue = new PriorityQueue<N>();
            this.nonDominated = HashMultimap.create();
            this.queue.add(initialNode);
        }

        public boolean hasNext() {
            return !this.queue.isEmpty();
        }

        @Override
        public N next() {
{'fraction_non_alphanumeric': 0.11103151862464183, 'fraction_numerical': 0.008118433619866285, 'mean_word_length': 3.4422057264050903, 'pattern_counts': {'":': 0, '<': 56, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2280240', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1224, 'n_words': 398}