2 * Description: provide the information for goodness evaluation of a target
4 * @ Author Create/Modi Note
5 * Xiaofeng Xie Mar 1, 2003
6 * Xiaofeng Xie May 3, 2004 Add grain value
7 * Xiaofeng Xie May 11, 2004 Add crowd distance
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * Please acknowledge the author(s) if you use this code in any way.
22 package net
.adaptivebox
.space
;
23 import net
.adaptivebox
.global
.*;
25 public class DesignDim
{
26 // To discrete space with the given step. For example, for an integer variable,
27 // The grain value can be set as 1.
28 public double grain
= 0;
29 public BasicBound paramBound
= new BasicBound(); //the range of a parameter
32 public void importData(DesignDim ipr
) {
33 this.grain
= ipr
.grain
;
34 this.paramBound
= ipr
.paramBound
;
37 public boolean isDiscrete() {
41 public double getGrainedValue(double value
) {
45 return paramBound
.minValue
+Math
.rint((value
-paramBound
.minValue
)/grain
)*grain
;
47 return paramBound
.maxValue
-Math
.rint((paramBound
.maxValue
-value
)/grain
)*grain
;