/******************************************************************************* * Copyright (c) 2010-2014, Miklos Foldenyi, Andras Szabolcs Nagy, Abel Hegedus, Akos Horvath, Zoltan Ujhelyi and Daniel Varro * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at * http://www.eclipse.org/legal/epl-v20.html. * * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ package org.eclipse.viatra.dse.objectives; import java.util.Comparator; import org.eclipse.viatra.dse.base.ThreadContext; /** * * Implementation of this interface represents a single objective of the DSE problem, which can assess a solution * (trajectory) in a single number. It has a name and a comparator which orders two solution based on the calculated * value. *
* Objectives can be either hard or soft objectives. Hard objectives can be satisfied or unsatisfied. If all of the hard * objectives are satisfied on a single solution, then it is considered to be a valid (or goal) solution. *
* Certain objectives can have inner state for calculating the fitness value. In this case a new instance is necessary
* for every new thread, and the {@code createNew} method should not return the same instance more than once.
*
* @author Andras Szabolcs Nagy
*
*/
public interface IObjective {
/**
* Returns the name of the objective.
*
* @return The name of the objective.
*/
String getName();
/**
* Sets the {@link Comparator} which is used to compare fitness (doubles). It determines whether the objective is to
* minimize or maximize (or minimize or maximize a delta from a given number).
*
* @param comparator The comparator.
*/
void setComparator(Comparator