weka.core.setupgenerator.Space Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multisearch-weka-package Show documentation
Show all versions of multisearch-weka-package Show documentation
Parameter optimization similar to GridSearch.
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
/*
* Space.java
* Copyright (C) 2008-2016 University of Waikato, Hamilton, New Zealand
*/
package weka.core.setupgenerator;
import java.io.Serializable;
import java.util.Enumeration;
import java.util.Vector;
/**
* Represents a multidimensional value space.
*
* @author fracpete (fracpete at waikato dot ac dot nz)
* @version $Revision: 4521 $
*/
public class Space
implements Serializable {
/** for serialization. */
private static final long serialVersionUID = -481830810204401148L;
/** the dimensions. */
protected SpaceDimension[] m_Dimensions;
/**
* Initializes the space.
*
* @param dimensions the dimensions of the space
*/
public Space(SpaceDimension[] dimensions) {
super();
m_Dimensions = dimensions.clone();
}
/**
* Returns the number of dimensions of this space.
*
* @return the number of dimensions
*/
public int dimensions() {
return m_Dimensions.length;
}
/**
* Returns the specified dimension.
*
* @param dimension the dimension index
* @return the dimension
*/
public SpaceDimension getDimension(int dimension) {
return m_Dimensions[dimension];
}
/**
* Returns the type of the dimension.
*
* @param dimension the dimension index
* @return the type of the dimension
*/
public int getType(int dimension) {
return getDimension(dimension).getType();
}
/**
* Returns the double values (or list values) for the given position.
*
* @param locations the location to get the double values for
* @return the double values (or list values) at the
* specified position
*/
public Point