Package jcgp.backend.parameters

Examples of jcgp.backend.parameters.DoubleParameter


    super(resources);
    setFunctionSet(new SymbolicRegressionFunctions());
    setName("Symbolic regression");
    setFileExtension(".dat");
   
    errorThreshold = new DoubleParameter(0.01, "Error threshold") {
      @Override
      public void validate(Number newValue) {
        if (newValue.doubleValue() < 0) {
          status = ParameterStatus.INVALID;
          status.setDetails("Error threshold must be a positive value.");
        } else if (newValue.doubleValue() == 0) {
          status = ParameterStatus.WARNING;
          status.setDetails("An error threshold of 0 is very rigorous and difficult to achieve.");
        } else {
          status = ParameterStatus.VALID;
        }
      }
    };
   
    perfectionThreshold = new DoubleParameter(0.000001, "Perfection threshold") {
      @Override
      public void validate(Number newValue) {
        if (newValue.doubleValue() < 0) {
          status = ParameterStatus.INVALID;
          status.setDetails("Perfection threshold must be a positive value.");
View Full Code Here


   * @param resources a reference to the experiment's resources.
   */
  public ProbabilisticMutator(Resources resources) {
    super(resources);
   
    mutationProbability = new DoubleParameter(10, "Mutation probability", false, false) {
      @Override
      public void validate(Number newValue) {
        if (newValue.doubleValue() <= 0 || newValue.doubleValue() > 100) {
          status = ParameterStatus.INVALID;
          status.setDetails("Mutation rate must be > 0 and <= 100");
View Full Code Here

   *
   * @param resources a reference to the experiment's resources.
   */
  public PercentPointMutator(final Resources resources) {
    super(resources);
    mutationRate = new DoubleParameter(10, "Percent mutation", false, false) {
      @Override
      public void validate(Number newValue) {

        int totalGenes = (resources.nodes() * (resources.arity() + 1)) + resources.outputs();
        int mutations = (int) (newValue.doubleValue() * (double) (totalGenes / 100.0));
View Full Code Here

TOP

Related Classes of jcgp.backend.parameters.DoubleParameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.