All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.numenta.nupic.encoders.DecodeResult Maven / Gradle / Ivy

There is a newer version: 0.6.13
Show newest version
/* ---------------------------------------------------------------------
 * Numenta Platform for Intelligent Computing (NuPIC)
 * Copyright (C) 2014, Numenta, Inc.  Unless you have an agreement
 * with Numenta, Inc., for a separate license for this software code, the
 * following terms and conditions apply:
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * 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 http://www.gnu.org/licenses.
 *
 * http://numenta.org/licenses/
 * ---------------------------------------------------------------------
 */

package org.numenta.nupic.encoders;

import java.util.List;
import java.util.Map;

import org.numenta.nupic.util.DecodeTuple;
import org.numenta.nupic.util.MinMax;

/**
 * Tuple to contain the results of an {@link Encoder}'s decoded
 * values.
 * 
 * @author David Ray
 */
public class DecodeResult extends DecodeTuple, List> {
	
	/**
	 * Constructs a new {@code Decode}
	 * @param m		Map of field names to {@link RangeList} object
	 * @param l		List of comma-separated descriptions for each list of ranges.
	 */
	public DecodeResult(Map m, List l) {
		super(m, l);
	}
	
	/**
	 * Returns the Map of field names to {@link RangeList} object
	 * @return
	 */
	public Map  getFields() {
		return fields;
	}
	
	/**
	 * Returns the List of comma-separated descriptions for each list of ranges.
	 * @return
	 */
	public List getDescriptions() {
		return fieldDescriptions;
	}

	/**
	 * Returns the {@link RangeList} associated with the specified field.
	 * @param fieldName		the name of the field
	 * @return
	 */
	public RangeList getRanges(String fieldName) {
		return fields.get(fieldName);
	}
	
	/**
	 * Returns a specific range ({@link MinMax}) for the specified field.
	 * @param fieldName		the name of the field
	 * @param index			the index of the range to return
	 * @return
	 */
	public MinMax getRange(String fieldName, int index) {
		return fields.get(fieldName).getRange(index);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy