All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.libs.jaicore.search.algorithms.standard.random.RandomSearchFactory Maven / Gradle / Ivy

package ai.libs.jaicore.search.algorithms.standard.random;

import org.api4.java.ai.graphsearch.problem.IPathSearchInput;

import ai.libs.jaicore.search.core.interfaces.StandardORGraphSearchFactory;
import ai.libs.jaicore.search.model.other.SearchGraphPath;

public class RandomSearchFactory extends StandardORGraphSearchFactory, SearchGraphPath,N, A, Double, RandomSearch> {

	private String loggerName;
	private int seed;

	public RandomSearchFactory() {
		super();
	}

	@Override
	public RandomSearch getAlgorithm() {
		if (this.getInput().getGraphGenerator() == null) {
			throw new IllegalStateException("Cannot produce RandomSearch searches before the graph generator is set in the problem.");
		}
		return this.getAlgorithm(this.getInput());
	}

	@Override
	public RandomSearch getAlgorithm(final IPathSearchInput input) {
		return new RandomSearch<>(input, this.seed);
	}

	public int getSeed() {
		return this.seed;
	}

	public void setSeed(final int seed) {
		this.seed = seed;
	}

	public String getLoggerName() {
		return this.loggerName;
	}

	public void setLoggerName(final String loggerName) {
		this.loggerName = loggerName;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy