@Override public void readFields(DataInput input) throws IOException { setThreadCount(input.readInt()); int n = input.readInt(); population = Lists.newArrayList(); for (int i = 0; i < n; i++) { State<T, U> state = (State<T, U>) PolymorphicWritable.read(input, State.class); population.add(state); } } }
/** * Creates an evolutionary optimization framework with specified threadiness, * population size and initial state. * @param threadCount How many threads to use in parallelDo * @param populationSize How large a population to use * @param seed An initial population member */ public EvolutionaryProcess(int threadCount, int populationSize, State<T, U> seed) { this.populationSize = populationSize; setThreadCount(threadCount); initializePopulation(populationSize, seed); }
@Override public void readFields(DataInput input) throws IOException { setThreadCount(input.readInt()); int n = input.readInt(); population = new ArrayList<>(); for (int i = 0; i < n; i++) { State<T, U> state = (State<T, U>) PolymorphicWritable.read(input, State.class); population.add(state); } } }
/** * Creates an evolutionary optimization framework with specified threadiness, * population size and initial state. * @param threadCount How many threads to use in parallelDo * @param populationSize How large a population to use * @param seed An initial population member */ public EvolutionaryProcess(int threadCount, int populationSize, State<T, U> seed) { this.populationSize = populationSize; setThreadCount(threadCount); initializePopulation(populationSize, seed); }
@Override public void readFields(DataInput input) throws IOException { setThreadCount(input.readInt()); int n = input.readInt(); population = Lists.newArrayList(); for (int i = 0; i < n; i++) { State<T, U> state = (State<T, U>) PolymorphicWritable.read(input, State.class); population.add(state); } } }
/** * Creates an evolutionary optimization framework with specified threadiness, * population size and initial state. * @param threadCount How many threads to use in parallelDo * @param populationSize How large a population to use * @param seed An initial population member */ public EvolutionaryProcess(int threadCount, int populationSize, State<T, U> seed) { this.populationSize = populationSize; setThreadCount(threadCount); initializePopulation(populationSize, seed); }