at.tuwien.ifs.somtoolbox.input
Class SOMLibFormatInputReader

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.input.AbstractSOMInputReader
      extended by at.tuwien.ifs.somtoolbox.input.SOMLibFormatInputReader
All Implemented Interfaces:
SOMInputReader
Direct Known Subclasses:
MnemonicSOMLibFormatInputReader

public class SOMLibFormatInputReader
extends AbstractSOMInputReader

Provides the functionality to read a saved network model in SOMLib format.

Version:
$Id: SOMLibFormatInputReader.java 3889 2010-11-03 12:45:46Z frank $
Author:
Michael Dittenbach, Rudolf Mayer

Nested Class Summary
 
Nested classes/interfaces inherited from class at.tuwien.ifs.somtoolbox.input.AbstractSOMInputReader
AbstractSOMInputReader.UnitInformation
 
Field Summary
private  String mapDescriptionFileName
           
static String mapFileNameSuffix
          The suffix of the map description files
private  String unitDescriptionFileName
           
static String unitFileNameSuffix
          The suffix of the unit description files
static String weightFileNameSuffix
          The suffix of the weight vector files
private  String weightVectorFileName
           
 
Fields inherited from class at.tuwien.ifs.somtoolbox.input.AbstractSOMInputReader
allVectorNames, commonLabelPrefix, dim, gridLayout, gridTopology, labelled, metricName, unitInfo, xSize, ySize, zSize
 
Fields inherited from interface at.tuwien.ifs.somtoolbox.input.SOMInputReader
MAP_FILE, UNIT_FILE, WEIGHT_VECTOR
 
Constructor Summary
SOMLibFormatInputReader(String weightVectorFileName, String unitDescriptionFileName, String mapDescriptionFileName)
          Sole constructor taking the name of the weight vector file, the unit description file and the map description file as arguments.
 
Method Summary
 String getFilePath()
          Returns the name of the path where the files are located.
static String getFormatName()
           
 String getMapDescriptionFileName()
          Returns the name of the map description file, or null if not loaded.
 String getUnitDescriptionFileName()
          Returns the name of the unit description file, or null if not loaded.
 String getWeightVectorFileName()
          Returns the name of the weight vector file, or null if not loaded.
protected  void processUnitElement(String line, int k, int j, int i)
           
protected  void readMapDescriptionFile(String fileName)
          Reads a SOMLib map description file with the given name.
protected  void readUnitDescriptionFile(String fileName)
          Reads a SOMLib unit description file with the given name.
private  void readWeightVectorFile(String fileName)
          Reads a SOMLib weight vector file with the given name.
 
Methods inherited from class at.tuwien.ifs.somtoolbox.input.AbstractSOMInputReader
getBestContextUnitLabels, getBestContextUnitLabels, getCommonVectorLabelPrefix, getContextGateUnitLabels, getContextGateUnitLabels, getDim, getGridLayout, getGridTopology, getKaskiGateUnitLabels, getKaskiGateUnitLabels, getKaskiGateUnitLabelsWgt, getKaskiGateUnitLabelsWgt, getKaskiUnitLabels, getKaskiUnitLabels, getKaskiUnitLabelsWgt, getKaskiUnitLabelsWgt, getMappedVecs, getMappedVecs, getMappedVecsDist, getMappedVecsDist, getMetricName, getNrBestContext, getNrBestContext, getNrContextGateLabels, getNrContextGateLabels, getNrGateWeights, getNrGateWeights, getNrKaskiGateLabels, getNrKaskiGateLabels, getNrKaskiLabels, getNrKaskiLabels, getNrKaskiWeights, getNrKaskiWeights, getNrSomsMapped, getNrSomsMapped, getNrUnitLabels, getNrUnitLabels, getNrVecMapped, getNrVecMapped, getQuantErrorUnit, getQuantErrorUnit, getQuantErrorUnitAvg, getQuantErrorUnitAvg, getUnitLabels, getUnitLabels, getUnitLabelsQe, getUnitLabelsQe, getUnitLabelsWgt, getUnitLabelsWgt, getUrlMappedSoms, getUrlMappedSoms, getVectors, getXSize, getYSize, getZSize, initUnitInformation, isLabelled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapFileNameSuffix

public static final String mapFileNameSuffix
The suffix of the map description files

See Also:
Constant Field Values

weightFileNameSuffix

public static final String weightFileNameSuffix
The suffix of the weight vector files

See Also:
Constant Field Values

unitFileNameSuffix

public static final String unitFileNameSuffix
The suffix of the unit description files

See Also:
Constant Field Values

mapDescriptionFileName

private String mapDescriptionFileName

unitDescriptionFileName

private String unitDescriptionFileName

weightVectorFileName

private String weightVectorFileName
Constructor Detail

SOMLibFormatInputReader

public SOMLibFormatInputReader(String weightVectorFileName,
                               String unitDescriptionFileName,
                               String mapDescriptionFileName)
                        throws FileNotFoundException,
                               SOMLibFileFormatException
Sole constructor taking the name of the weight vector file, the unit description file and the map description file as arguments.

Parameters:
weightVectorFileName - the name of the weight vector file.
unitDescriptionFileName - the name of the unit description file.
mapDescriptionFileName - the name of the map description file.
Throws:
FileNotFoundException - if one of the files with the given name is not found.
SOMLibFileFormatException - if the format of one of the file is corrupt.
Method Detail

getFilePath

public String getFilePath()
Description copied from interface: SOMInputReader
Returns the name of the path where the files are located.

Returns:
the name of the path where the files are located.
See Also:
SOMInputReader.getFilePath()

getMapDescriptionFileName

public String getMapDescriptionFileName()
Description copied from interface: SOMInputReader
Returns the name of the map description file, or null if not loaded.

Returns:
the name of the map description file, or null if not loaded.

getUnitDescriptionFileName

public String getUnitDescriptionFileName()
Description copied from interface: SOMInputReader
Returns the name of the unit description file, or null if not loaded.

Returns:
the name of the unit description file, or null if not loaded.

getWeightVectorFileName

public String getWeightVectorFileName()
Description copied from interface: SOMInputReader
Returns the name of the weight vector file, or null if not loaded.

Returns:
the name of the weight vector file, or null if not loaded.

readMapDescriptionFile

protected void readMapDescriptionFile(String fileName)
                               throws FileNotFoundException,
                                      SOMLibFileFormatException
Reads a SOMLib map description file with the given name.

Parameters:
fileName - the name of the file to open.
Throws:
FileNotFoundException
SOMLibFileFormatException

readUnitDescriptionFile

protected void readUnitDescriptionFile(String fileName)
                                throws FileNotFoundException,
                                       SOMLibFileFormatException
Reads a SOMLib unit description file with the given name.

Parameters:
fileName - the name of the file to open.
Throws:
FileNotFoundException
SOMLibFileFormatException

readWeightVectorFile

private void readWeightVectorFile(String fileName)
                           throws FileNotFoundException,
                                  SOMLibFileFormatException
Reads a SOMLib weight vector file with the given name.

Parameters:
fileName - the name of the file to open.
Throws:
FileNotFoundException
SOMLibFileFormatException

processUnitElement

protected void processUnitElement(String line,
                                  int k,
                                  int j,
                                  int i)

getFormatName

public static String getFormatName()