Example usage for java.util Collections nCopies

List of usage examples for java.util Collections nCopies

Introduction

In this page you can find the example usage for java.util Collections nCopies.

Prototype

public static <T> List<T> nCopies(int n, T o) 

Source Link

Document

Returns an immutable list consisting of n copies of the specified object.

Usage

From source file:org.um.feri.ears.problems.unconstrained.ProblemEasom.java

public ProblemEasom() {
    super(2, 0);/* w  ww.  jav  a2 s. c  o m*/

    lowerLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, -100.0));
    upperLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, 100.0));

    name = "Easom";
}

From source file:org.um.feri.ears.problems.unconstrained.ProblemBeale.java

public ProblemBeale() {
    super(2, 0);/*from w w  w.jav a 2 s.c  o m*/

    lowerLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, -4.5));
    upperLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, 4.5));

    name = "Beale function";
}

From source file:org.um.feri.ears.problems.unconstrained.ProblemSphere.java

public ProblemSphere(int d) {
    super(d, 0);/*www.  j  a va  2  s  . co  m*/

    lowerLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, -100.0));
    upperLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, 100.0));

    name = "Sphere";
}

From source file:org.um.feri.ears.problems.unconstrained.ProblemSchwefel.java

public ProblemSchwefel(int d) {
    super(d, 0);/*from ww  w.  ja v a 2 s . co m*/

    lowerLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, -500.0));
    upperLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, 500.0));

    name = "Schwefel 2.26";
}

From source file:com.syncnapsis.data.model.Empire.java

@Transient
@Override
public List<Player> getOwners() {
    return Collections.nCopies(1, getPlayer());
}

From source file:org.um.feri.ears.problems.unconstrained.ProblemMartinAndGaddy.java

public ProblemMartinAndGaddy() {
    super(2, 0);//from   w  w  w . ja  va2s .c  o m

    lowerLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, 0.0));
    upperLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, 10.0));

    name = "Martin And Gaddy";
}

From source file:org.um.feri.ears.problems.unconstrained.ProblemGriewank.java

public ProblemGriewank(int d) {
    super(d, 0);//from  w w w . j  a va 2  s.  co m

    lowerLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, -50.0));
    upperLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, 50.0));

    name = "Griewank";
}

From source file:org.um.feri.ears.problems.unconstrained.ProblemRastrigin.java

public ProblemRastrigin(int d) {
    super(d, 0);/*  ww  w .  j av  a2  s  .c om*/

    lowerLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, -5.12));
    upperLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, 5.12));

    name = "Rastrigin";
}

From source file:org.um.feri.ears.problems.unconstrained.ProblemGoldSteinAndPrice.java

public ProblemGoldSteinAndPrice() {
    super(2, 0);//from w w w .  ja v  a  2s .  co m

    lowerLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, -2.0));
    upperLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, 2.0));

    //Collections.fill(lowerLimit, -2.0);
    //Collections.fill(upperLimit, 4.0);

    name = "Goldstein And Price";
}

From source file:org.um.feri.ears.problems.unconstrained.ProblemPowellBadlyScaledFunction.java

public ProblemPowellBadlyScaledFunction() {
    super(2, 0);//from ww w. j a  va 2s.  co m

    lowerLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, -50.0));
    upperLimit = new ArrayList<Double>(Collections.nCopies(numberOfDimensions, 50.0));

    name = "Powell badly scaled function";

}