Пример #1
0
 /**
  * Adds a new int parameter to be altered for the model being tuned.
  *
  * @param param the model parameter
  * @param initialSearchValues the values to try for the specified parameter
  */
 public void addParameter(IntParameter param, int... initialSearchValues) {
   searchParams.add(param);
   DoubleList dl = new DoubleList(initialSearchValues.length);
   for (double d : initialSearchValues) dl.add(d);
   Arrays.sort(dl.getBackingArray()); // convience, only really needed if param is warm
   if (param.isWarmParameter() && !param.preferredLowToHigh())
     Collections.reverse(dl); // put it in the prefered order
   if (param.isWarmParameter()) // put it at the front!
   searchValues.add(0, dl);
   else searchValues.add(dl);
 }
Пример #2
0
 /**
  * Adds a new double parameter to be altered for the model being tuned.
  *
  * @param param the model parameter
  * @param initialSearchValues the values to try for the specified parameter
  */
 public void addParameter(DoubleParameter param, double... initialSearchValues) {
   if (param == null) throw new IllegalArgumentException("null not allowed for parameter");
   searchParams.add(param);
   DoubleList dl = new DoubleList(initialSearchValues.length);
   for (double d : initialSearchValues) dl.add(d);
   Arrays.sort(dl.getBackingArray()); // convience, only really needed if param is warm
   if (param.isWarmParameter() && !param.preferredLowToHigh())
     Collections.reverse(dl); // put it in the prefered order
   if (param.isWarmParameter()) // put it at the front!
   searchValues.add(0, dl);
   else searchValues.add(dl);
 }