package ec.gp.semantic.library;

import ec.EvolutionState;
import ec.gp.semantic.DesiredSemanticsBase;
import ec.util.Parameter;
import library.distance.IDistanceTo;
import library.semantics.BitSet;

public class BooleanPopulationLibraryFactory implements ILibraryFactory<Boolean>, IDistanceToFactory<BitSet> {

	@Override
	public IDistanceTo<BitSet> getDistanceToSet(EvolutionState state, DesiredSemanticsBase<?> desired, DesiredSemanticsBase<?>... forbidden) {
		return new BooleanDistanceToSet(state, (DesiredSemanticsBase<Boolean>) desired, (DesiredSemanticsBase<Boolean>[]) forbidden);
	}

	@Override
	public ILibrary<Boolean> getLibrary(EvolutionState state, Parameter base) {
		return new PopulationLibrary<Boolean, boolean[]>(state, this, new BooleanConstantGenerator(state));
	}

}
