Package eas.users.fredy.tsp

Source Code of eas.users.fredy.tsp.ParameterClass

/*
* File name:        ParameterClass.java (package eas.users.fredy.tsp)
* Author(s):        jq0940
* Java version:     8.0 (at generation time)
* Generation date:  26.08.2014 (16:24:36)
*
* (c) This file and the EAS (Easy Agent Simulation) framework containing it
* is protected by Creative Commons by-nc-sa license. Any altered or
* further developed versions of this file have to meet the agreements
* stated by the license conditions.
*
* In a nutshell
* -------------
* You are free:
* - to Share -- to copy, distribute and transmit the work
* - to Remix -- to adapt the work
*
* Under the following conditions:
* - Attribution -- You must attribute the work in the manner specified by the
*   author or licensor (but not in any way that suggests that they endorse
*   you or your use of the work).
* - Noncommercial -- You may not use this work for commercial purposes.
* - Share Alike -- If you alter, transform, or build upon this work, you may
*   distribute the resulting work only under the same or a similar license to
*   this one.
*
* + Detailed license conditions (Germany):
*   http://creativecommons.org/licenses/by-nc-sa/3.0/de/
* + Detailed license conditions (unported):
*   http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en
*
* This header must be placed in the beginning of any version of this file.
*/


package eas.users.fredy.tsp;

import java.util.LinkedList;

import eas.startSetup.SingleParameter;
import eas.startSetup.parameterDatatypes.Datatypes;


/**
* @author jq0940
*/
public class ParameterClass {
   
    public static boolean resetRequested;
    private static int numberOfAnts;
    private static double q0;
    private static double beta;
    private static double alpha;
    private static double rho;
    //private static String storageFileName;
   
    public static LinkedList<SingleParameter> getParameters() {
        LinkedList<SingleParameter> list = new LinkedList<>();
       
        list.add(new SingleParameter(
                "numberOfAnts",
                Datatypes.integerRange(1, 10000),
                10,
                "The number of ants.",
                ParameterClass.class.getSimpleName().toUpperCase(),
                ParameterClass.class));
       
        list.add(new SingleParameter(
                "q0",
                Datatypes.DOUBLE,
                0.9,
                "Exploration/Exploitation Balance",
                ParameterClass.class.getSimpleName().toUpperCase(),
                ParameterClass.class));
       
        list.add(new SingleParameter(
                "beta",
                Datatypes.DOUBLE,
                5,
                "Relative weight of heuristic value",
                ParameterClass.class.getSimpleName().toUpperCase(),
                ParameterClass.class));
       
        list.add(new SingleParameter(
                "alpha",
                Datatypes.DOUBLE,
                1,
                "Relative weight of pheromone concentration",
                ParameterClass.class.getSimpleName().toUpperCase(),
                ParameterClass.class));
       
        list.add(new SingleParameter(
                "rho",
                Datatypes.DOUBLE,
                0.9,
                "Pheromone persistence rate",
                ParameterClass.class.getSimpleName().toUpperCase(),
                ParameterClass.class));

        return list;
    }
  
    /*public static String getStorageFileName() {
        return storageFileName;
    }*/
   
    public static int numberOfAnts() {
        return numberOfAnts;
    }
    public static double q0() {
        return q0;
    }

    /*public static void setStorageFileName(String renewableGeneration) {
        ParameterClass.storageFileName = renewableGeneration;
        resetRequested = true;
    }*/

    public static void numberOfAnts(int myIntegerParameter) {
        if (myIntegerParameter != ParameterClass.numberOfAnts) {
            System.out.println("\n\nI noticed that the parameter myIntegerParameter changed from "
                            + ParameterClass.numberOfAnts
                            + " to "
                            + myIntegerParameter);
            ParameterClass.numberOfAnts = myIntegerParameter;
            resetRequested = true;
        }
    }

    public static double getBeta() {
        return beta;
    }

    public static void setBeta(double beta) {
        ParameterClass.beta = beta;
    }

    public static double getAlpha() {
        return alpha;
    }

    public static void setAlpha(double alpha) {
        ParameterClass.alpha = alpha;
    }

    public static double getRho() {
        return rho;
    }

    public static void setRho(double rho) {
        ParameterClass.rho = rho;
    }
}
TOP

Related Classes of eas.users.fredy.tsp.ParameterClass

TOP
Copyright © 2018 www.massapi.com. 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.