![JAR search and dependency download from the Maven repository](/logo.png)
net.sourceforge.cilib.entity.initialisation.RandomInitialisationStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cilib-library Show documentation
Show all versions of cilib-library Show documentation
A library of composable components enabling simpler Computational Intelligence
/** __ __
* _____ _/ /_/ /_ Computational Intelligence Library (CIlib)
* / ___/ / / / __ \ (c) CIRG @ UP
* / /__/ / / / /_/ / http://cilib.net
* \___/_/_/_/_.___/
*/
package net.sourceforge.cilib.entity.initialisation;
import net.sourceforge.cilib.entity.Entity;
import net.sourceforge.cilib.type.types.Randomisable;
import net.sourceforge.cilib.type.types.Type;
/**
*
* @param
*/
public class RandomInitialisationStrategy implements InitialisationStrategy {
private static final long serialVersionUID = 5630272366805104400L;
@Override
public RandomInitialisationStrategy getClone() {
return this;
}
@Override
public void initialise(Enum> key, E entity) {
Type type = entity.getProperties().get(key);
if (type instanceof Randomisable) {
Randomisable randomisable = (Randomisable) type;
randomisable.randomise();
return;
}
throw new UnsupportedOperationException("Cannot initialise a non Randomisable instance.");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy