com.github.chen0040.gp.services.Tutorials Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-genetic-programming Show documentation
Show all versions of java-genetic-programming Show documentation
Genetic Programming in Java, including packages on Linear Genetic Programming
package com.github.chen0040.gp.services;
import com.github.chen0040.gp.commons.BasicObservation;
import com.github.chen0040.gp.commons.Observation;
import java.util.ArrayList;
import java.util.List;
import java.util.function.BiFunction;
/**
* Created by xschen on 20/6/2017.
*/
public class Tutorials {
public static List mexican_hat(){
List result = new ArrayList<>();
BiFunction mexican_hat_func = (x1, x2) -> (1 - x1 * x1 / 4 - x2 * x2 / 4) * Math.exp(- x1 * x2 / 8 - x2 * x2 / 8);
double lower_bound=-4;
double upper_bound=4;
int period=16;
double interval=(upper_bound - lower_bound) / period;
for(int i=0; i