@Test(invocationCount = 10) public void createFromTree() { final TreeNode<Op<Double>> tree = Program.of( 6, OPERATIONS, TERMINALS ); final ProgramChromosome<Double> chromosome = ProgramChromosome .of(tree, OPERATIONS, TERMINALS); Assert.assertTrue(Tree.equals(tree, chromosome.root())); }
public static <A> ProgramChromosome<A> of( final Tree<? extends Op<A>, ?> program, final Predicate<? super ProgramChromosome<A>> validator, final ISeq<? extends Op<A>> operations, final ISeq<? extends Op<A>> terminals ) { Program.check(program); checkOperations(operations); checkTerminals(terminals); return create(program, validator, operations, terminals); }
ProgramChromosome extends AbstractTreeChromosome<Op<A>, ProgramGene<A>> implements Function<A[], A> { public static <A> ProgramChromosome<A> of( final Tree<? extends Op<A>, ?> program, final Predicate<? super ProgramChromosome<A>> validator, final ISeq<? extends Op<A>> operations, final ISeq<? extends Op<A>> terminals ) { Program.check(program); checkOperations(operations); checkTerminals(terminals); return create(program, validator, operations, terminals); } }
ProgramChromosome extends AbstractTreeChromosome<Op<A>, ProgramGene<A>> implements Function<A[], A> { public static <A> ProgramChromosome<A> of( final Tree<? extends Op<A>, ?> program, final Predicate<? super ProgramChromosome<A>> validator, final ISeq<? extends Op<A>> operations, final ISeq<? extends Op<A>> terminals ) { Program.check(program); checkOperations(operations); checkTerminals(terminals); return create(program, validator, operations, terminals); } protected  ProgramChromosome(
		final ISeq<ProgramGene<A>> program,
		final Predicate<? super ProgramChromosome<A>> validator,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); }
ProgramChromosome extends AbstractTreeChromosome<Op<A>, ProgramGene<A>> implements Function<A[], A> { public static <A> ProgramChromosome<A> of( final Tree<? extends Op<A>, ?> program, final Predicate<? super ProgramChromosome<A>> validator, final ISeq<? extends Op<A>> operations, final ISeq<? extends Op<A>> terminals ) { Program.check(program); checkOperations(operations); checkTerminals(terminals); return create(program, validator, operations, terminals); } protected  ProgramChromosome(
		final ISeq<ProgramGene<A>> program,
		final Predicate<? super ProgramChromosome<A>> validator,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); ISeq<Op<A>> operations(); ISeq<Op<A>> terminals(); @Override boolean isValid(); @Override A apply(final A[] args); @SafeVarargs final A eval(final A... args); @Override ProgramChromosome<A> newInstance(final ISeq<ProgramGene<A>> genes); @Override ProgramChromosome<A> newInstance(); static ProgramChromosome<A> of(
		final Tree<? extends Op<A>, ?> program,
		final Predicate<? super ProgramChromosome<A>> validator,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); static ProgramChromosome<A> of(
		final Tree<? extends Op<A>, ?> program,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); static ProgramChromosome<A> of(
		final int depth,
		final Predicate<? super ProgramChromosome<A>> validator,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); static ProgramChromosome<A> of(
		final int depth,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); static ProgramChromosome<A> of(
		final ISeq<ProgramGene<A>> genes,
		final Predicate<? super ProgramChromosome<A>> validator,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); static ProgramChromosome<A> of(
		final ISeq<ProgramGene<A>> genes,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); }
ProgramChromosome extends AbstractTreeChromosome<Op<A>, ProgramGene<A>> implements Function<A[], A> { public static <A> ProgramChromosome<A> of( final Tree<? extends Op<A>, ?> program, final Predicate<? super ProgramChromosome<A>> validator, final ISeq<? extends Op<A>> operations, final ISeq<? extends Op<A>> terminals ) { Program.check(program); checkOperations(operations); checkTerminals(terminals); return create(program, validator, operations, terminals); } protected  ProgramChromosome(
		final ISeq<ProgramGene<A>> program,
		final Predicate<? super ProgramChromosome<A>> validator,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); ISeq<Op<A>> operations(); ISeq<Op<A>> terminals(); @Override boolean isValid(); @Override A apply(final A[] args); @SafeVarargs final A eval(final A... args); @Override ProgramChromosome<A> newInstance(final ISeq<ProgramGene<A>> genes); @Override ProgramChromosome<A> newInstance(); static ProgramChromosome<A> of(
		final Tree<? extends Op<A>, ?> program,
		final Predicate<? super ProgramChromosome<A>> validator,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); static ProgramChromosome<A> of(
		final Tree<? extends Op<A>, ?> program,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); static ProgramChromosome<A> of(
		final int depth,
		final Predicate<? super ProgramChromosome<A>> validator,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); static ProgramChromosome<A> of(
		final int depth,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); static ProgramChromosome<A> of(
		final ISeq<ProgramGene<A>> genes,
		final Predicate<? super ProgramChromosome<A>> validator,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	); static ProgramChromosome<A> of(
		final ISeq<ProgramGene<A>> genes,
		final ISeq<? extends Op<A>> operations,
		final ISeq<? extends Op<A>> terminals
	);  }