genopt.db
Class OptimizationIni

java.lang.Object
  extended by genopt.db.OptimizationIni
All Implemented Interfaces:
java.lang.Cloneable

public class OptimizationIni
extends java.lang.Object
implements java.lang.Cloneable

Object that stores the various file names that are used by the optimization program.

This project was carried out at:

and supported by

GenOpt Copyright (c) 1998-2011, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All rights reserved.

Version:
GenOpt(R) 3.1.0 (December 8, 2011)

Author:
Michael Wetter

Field Summary
protected static java.lang.String FS
          System dependent file separator
protected  int nInpFil
          number of input files
protected  int nLogFil
          number of simulation log files
protected  int nOutFil
          number of output files
protected  OrderedMap objFunMap
          delimiter of the objective function value in the output file
protected  boolean objFunMapIsSet
          flag indicating whether the objective function value is set or not
protected  java.lang.String OptComFilNam
          file name: Optimization command file
protected  java.lang.String OptComPat
          path name: Optimization command
protected  java.lang.String OptIniPat
          path name: Optimization initialization
protected  java.lang.String SimCalPre
          simulation call prefix
protected  java.lang.String SimCalSuf
          simulation call suffix
protected  java.lang.String SimConFilNam
          file name: Simulation program configuration
protected  java.lang.String SimConPat
          path name: Simulation program configuration
protected  java.lang.String[] SimInpFilNam
          file name: Simulation input
protected  java.lang.String[] SimInpPat
          path name: Simulation input
protected  java.lang.String[] SimInpSavPat
          path name of save directory: Simulation input (String "" indicates no save required)
protected  java.lang.String[] SimInpTemFilNam
          file name: Simulation input template
protected  java.lang.String[] SimInpTemPat
          path name: Simulation input template
protected  java.lang.String[] SimLogFilNam
          file name: Simulaton log file (contains error messages)
protected  java.lang.String[] SimLogPat
          path name: Simulaton log file (contains error messages)
protected  java.lang.String[] SimLogSavPat
          path name of save directory: Simulaton log file (String "" indicates no save required)
protected  java.lang.String[] SimOutFilNam
          file name: Simulation output
protected  java.lang.String[] SimOutPat
          path name: Simulation output
protected  java.lang.String[] SimOutSavPat
          path name of save directory: Simulation output (String "" indicates no save required)
 
Constructor Summary
OptimizationIni(java.lang.String[] SimulationInputTemplateFileName, java.lang.String[] SimulationInputTemplatePath, java.lang.String[] SimulationInputFileName, java.lang.String[] SimulationInputPath, java.lang.String[] SimulationInputSavePath, java.lang.String[] SimulationOutputFileName, java.lang.String[] SimulationOutputPath, java.lang.String[] SimulationOutputSavePath, java.lang.String[] SimulationLogFileName, java.lang.String[] SimulationLogPath, java.lang.String[] SimulationLogSavePath, java.lang.String SimulationConfigFileName, java.lang.String SimulationConfigPath, java.lang.String OptimizationInitializationPath, java.lang.String OptimizationCommandFileName, java.lang.String OptimizationCommandPath, java.lang.String SimulationCallPrefix, java.lang.String SimulationCallSuffix)
          constructor
 
Method Summary
 java.lang.String convertToTemporaryPath(java.lang.String path, java.lang.String dirName)
          converts the argument path to the temporary path that will be used for the simulation
 ObjectiveFunctionLocation[] getFunctionObjects()
          gets the function objects for the objective function
 int getNumberOfFunctionObjects()
          gets the number of function objects for the objective function
 int getNumberOfInputFiles()
          gets the number of simulation input files
 int getNumberOfLogFiles()
          gets the number of simulation log files
 int getNumberOfOutputFiles()
          gets the number of simulation output files
 java.lang.String getObjFunDel(java.lang.String name)
          gets the delimiter of the objective function in the simulation output file
 java.lang.String getObjFunFun(java.lang.String name)
          gets the function definining the objective function
 java.lang.String getOptComFilNam()
          gets the optimization command file name
 java.lang.String getOptComPat()
          gets the optimization command path
 java.lang.String getOptIniPat()
          gets the optimization initialization path
 java.lang.String getSimCalPre()
          gets the simulation call prefix
 java.lang.String getSimCalSuf()
          gets the simulation call suffix
 java.lang.String getSimConFilNam()
          gets the simulation configuration file name
 java.lang.String getSimConPat()
          gets the simulation configuration path
 java.lang.String[] getSimInpFilNam()
          gets the simulation input file names
 java.lang.String getSimInpFilNam(int i)
          gets the simulation input file name
 java.lang.String[] getSimInpPat()
          gets the simulation input path names
 java.lang.String getSimInpPat(int i)
          gets the simulation input path
 java.lang.String[] getSimInpSavPat()
          gets the simulation input save paths
 java.lang.String getSimInpSavPat(int i)
          gets the path where the simulation input file has to be saved
 java.lang.String getSimInpTemFilNam(int i)
          gets the simulation input template file name
 java.lang.String getSimInpTemPat(int i)
          gets the simulation input template path
 java.lang.String[] getSimLogFilNam()
          gets the simulation log file names
 java.lang.String getSimLogFilNam(int i)
          gets the simulation log file name
 java.lang.String[] getSimLogPat()
          gets the simulation log paths
 java.lang.String getSimLogPat(int i)
          gets the simulation log path
 java.lang.String[] getSimLogSavPat()
          gets the simulation log save paths
 java.lang.String getSimLogSavPat(int i)
          gets the path where the simulation log file has to be saved
 java.lang.String[] getSimOutFilNam()
          gets the simulation output file names
 java.lang.String getSimOutFilNam(int i)
          gets the simulation output file name
 java.lang.String[] getSimOutPat()
          gets the simulation output paths
 java.lang.String getSimOutPat(int i)
          gets the simulation output path
 java.lang.String[] getSimOutSavPat()
          gets the simulation output save paths
 java.lang.String getSimOutSavPat(int i)
          gets the path where the simulation output file has to be saved
 boolean isFunction(java.lang.String name)
          returns true if name is the name of an objective function that is defined by a function object, rather than by a direct simulation output
 boolean isObjectiveFunctionDelimiterSet()
          checks whether the objective function delimiter is set or not
 void setObjectiveFunctionLocation(OrderedMap objectiveFunctionDelimiter)
          Sets the entry of the section ObjectiveFunctionLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FS

protected static final java.lang.String FS
System dependent file separator


SimInpTemFilNam

protected java.lang.String[] SimInpTemFilNam
file name: Simulation input template


SimInpFilNam

protected java.lang.String[] SimInpFilNam
file name: Simulation input


SimOutFilNam

protected java.lang.String[] SimOutFilNam
file name: Simulation output


SimLogFilNam

protected java.lang.String[] SimLogFilNam
file name: Simulaton log file (contains error messages)


SimConFilNam

protected java.lang.String SimConFilNam
file name: Simulation program configuration


SimInpTemPat

protected java.lang.String[] SimInpTemPat
path name: Simulation input template


SimInpPat

protected java.lang.String[] SimInpPat
path name: Simulation input


SimInpSavPat

protected java.lang.String[] SimInpSavPat
path name of save directory: Simulation input (String "" indicates no save required)


SimOutPat

protected java.lang.String[] SimOutPat
path name: Simulation output


SimOutSavPat

protected java.lang.String[] SimOutSavPat
path name of save directory: Simulation output (String "" indicates no save required)


SimLogPat

protected java.lang.String[] SimLogPat
path name: Simulaton log file (contains error messages)


SimLogSavPat

protected java.lang.String[] SimLogSavPat
path name of save directory: Simulaton log file (String "" indicates no save required)


SimConPat

protected java.lang.String SimConPat
path name: Simulation program configuration


OptIniPat

protected java.lang.String OptIniPat
path name: Optimization initialization


OptComFilNam

protected java.lang.String OptComFilNam
file name: Optimization command file


OptComPat

protected java.lang.String OptComPat
path name: Optimization command


SimCalSuf

protected java.lang.String SimCalSuf
simulation call suffix


SimCalPre

protected java.lang.String SimCalPre
simulation call prefix


objFunMap

protected OrderedMap objFunMap
delimiter of the objective function value in the output file


objFunMapIsSet

protected boolean objFunMapIsSet
flag indicating whether the objective function value is set or not


nInpFil

protected int nInpFil
number of input files


nLogFil

protected int nLogFil
number of simulation log files


nOutFil

protected int nOutFil
number of output files

Constructor Detail

OptimizationIni

public OptimizationIni(java.lang.String[] SimulationInputTemplateFileName,
                       java.lang.String[] SimulationInputTemplatePath,
                       java.lang.String[] SimulationInputFileName,
                       java.lang.String[] SimulationInputPath,
                       java.lang.String[] SimulationInputSavePath,
                       java.lang.String[] SimulationOutputFileName,
                       java.lang.String[] SimulationOutputPath,
                       java.lang.String[] SimulationOutputSavePath,
                       java.lang.String[] SimulationLogFileName,
                       java.lang.String[] SimulationLogPath,
                       java.lang.String[] SimulationLogSavePath,
                       java.lang.String SimulationConfigFileName,
                       java.lang.String SimulationConfigPath,
                       java.lang.String OptimizationInitializationPath,
                       java.lang.String OptimizationCommandFileName,
                       java.lang.String OptimizationCommandPath,
                       java.lang.String SimulationCallPrefix,
                       java.lang.String SimulationCallSuffix)
                throws java.io.IOException
constructor

Parameters:
SimulationInputTemplateFileName - File name of the template input files of the simulation input
SimulationInputTemplatePath - Path where the template input files of the simulation are
SimulationInputFileName - File names of the input files of the simulation input
SimulationInputPath - Paths where the input files of the simulation are
SimulationInputSavePath - Path where the input files of the simulation have to be saved, or "" if they should not be saved
SimulationOutputFileName - File names of the output files of the simulation that contains the results
SimulationOutputPath - Path where the output files of the simulation are
SimulationOutputSavePath - Path where the output files of the simulation have to be saved, or "" if they should not be saved
SimulationLogFileName - File names of the log files of the simulation that contains the error messages
SimulationLogPath - Path where the log files of the simulation are
SimulationLogSavePath - Path where the log files of the simulation have to be saved, or "" if they should not be saved
SimulationConfigFileName - File name of the configuration file of the simulation program that is used by the optimization engine. This file contains specific informations about the simulation program
SimulationConfigPath - Path where the configuration file for the simulation engine is
OptimizationInitializationPath - Path where the optimization configuration file is
OptimizationCommandFileName - File name of the command file of the optimization
OptimizationCommandPath - Path where the command file of the optimization is
SimulationCallPrefix - prefix for simulation call might be a blank character
SimulationCallSuffix - suffix for simulation call might be a blank character
Throws:
java.io.IOException - If an I/O error occurs, which is possible because the construction of the canonical pathname may require filesystem queries
Method Detail

setObjectiveFunctionLocation

public void setObjectiveFunctionLocation(OrderedMap objectiveFunctionDelimiter)
Sets the entry of the section ObjectiveFunctionLocation

Parameters:
objectiveFunctionDelimiter - OrderedMap with objective function delimiters

getNumberOfInputFiles

public final int getNumberOfInputFiles()
gets the number of simulation input files

Returns:
the number of simulation input files

getNumberOfFunctionObjects

public final int getNumberOfFunctionObjects()
gets the number of function objects for the objective function

Returns:
the number of function objects for the objective function

getFunctionObjects

public final ObjectiveFunctionLocation[] getFunctionObjects()
gets the function objects for the objective function

Returns:
the function objects for the objective function

getNumberOfOutputFiles

public final int getNumberOfOutputFiles()
gets the number of simulation output files

Returns:
the number of simulation output files

getNumberOfLogFiles

public final int getNumberOfLogFiles()
gets the number of simulation log files

Returns:
the number of simulation log files

getSimInpTemFilNam

public final java.lang.String getSimInpTemFilNam(int i)
gets the simulation input template file name

Parameters:
i - the number of the file
Returns:
the simulation input template file name

getSimInpTemPat

public final java.lang.String getSimInpTemPat(int i)
gets the simulation input template path

Parameters:
i - the number of the file
Returns:
the simulation input template path

getSimInpFilNam

public final java.lang.String getSimInpFilNam(int i)
gets the simulation input file name

Parameters:
i - the number of the file
Returns:
the simulation input file name

getSimInpFilNam

public final java.lang.String[] getSimInpFilNam()
gets the simulation input file names

Returns:
the simulation input file names

getSimInpPat

public final java.lang.String getSimInpPat(int i)
gets the simulation input path

Parameters:
i - the number of the file
Returns:
the simulation input path

getSimInpPat

public final java.lang.String[] getSimInpPat()
gets the simulation input path names

Returns:
the simulation input path names

getSimInpSavPat

public final java.lang.String getSimInpSavPat(int i)
gets the path where the simulation input file has to be saved

Parameters:
i - the number of the file
Returns:
the path where the simulation input file has to be saved, or null if no save is required

getSimOutFilNam

public final java.lang.String[] getSimOutFilNam()
gets the simulation output file names

Returns:
the simulation output file names

getSimOutFilNam

public final java.lang.String getSimOutFilNam(int i)
gets the simulation output file name

Parameters:
i - the number of the file
Returns:
the simulation output file name

getSimOutPat

public final java.lang.String[] getSimOutPat()
gets the simulation output paths

Returns:
the simulation output paths

getSimOutPat

public final java.lang.String getSimOutPat(int i)
gets the simulation output path

Parameters:
i - the number of the file
Returns:
the simulation output path

getSimInpSavPat

public final java.lang.String[] getSimInpSavPat()
gets the simulation input save paths

Returns:
the simulation input save paths. If a path has not been specified, then this element contains the String '""'

getSimOutSavPat

public final java.lang.String[] getSimOutSavPat()
gets the simulation output save paths

Returns:
the simulation output save paths. If a path has not been specified, then this element contains the String '""'

getSimOutSavPat

public final java.lang.String getSimOutSavPat(int i)
gets the path where the simulation output file has to be saved

Parameters:
i - the number of the file
Returns:
the path where the simulation output file has to be saved, or null if no save is required

getSimLogFilNam

public final java.lang.String getSimLogFilNam(int i)
gets the simulation log file name

Parameters:
i - the number of the file
Returns:
the simulation log file name

getSimLogFilNam

public final java.lang.String[] getSimLogFilNam()
gets the simulation log file names

Returns:
the simulation log file names

getSimLogPat

public final java.lang.String[] getSimLogPat()
gets the simulation log paths

Returns:
the simulation log paths

getSimLogPat

public final java.lang.String getSimLogPat(int i)
gets the simulation log path

Parameters:
i - the number of the file
Returns:
the simulation log path

getSimLogSavPat

public final java.lang.String[] getSimLogSavPat()
gets the simulation log save paths

Returns:
the simulation log save paths. If a path has not been specified, then this element contains the String '""'

getSimLogSavPat

public final java.lang.String getSimLogSavPat(int i)
gets the path where the simulation log file has to be saved

Parameters:
i - the number of the file
Returns:
the path where the simulation log file has to be saved, or null if no save is required

getSimConFilNam

public final java.lang.String getSimConFilNam()
gets the simulation configuration file name

Returns:
the simulation configuration file name

getSimConPat

public final java.lang.String getSimConPat()
gets the simulation configuration path

Returns:
the simulation configuration path

getOptIniPat

public final java.lang.String getOptIniPat()
gets the optimization initialization path

Returns:
Optimization initialization path

getOptComFilNam

public final java.lang.String getOptComFilNam()
gets the optimization command file name

Returns:
Optimization command file name

getOptComPat

public final java.lang.String getOptComPat()
gets the optimization command path

Returns:
Optimization command path

getObjFunDel

public final java.lang.String getObjFunDel(java.lang.String name)
gets the delimiter of the objective function in the simulation output file

Parameters:
name - name of the objective function
Returns:
delimiter of the objective function in the simulation output file

getObjFunFun

public final java.lang.String getObjFunFun(java.lang.String name)
gets the function definining the objective function

Parameters:
name - name of the objective function
Returns:
string representing the objective function

isFunction

public final boolean isFunction(java.lang.String name)
returns true if name is the name of an objective function that is defined by a function object, rather than by a direct simulation output

Parameters:
name - name of the objective function
Returns:
returns true if name is the name of an objective function that is defined by a function object, false otherwise

getSimCalPre

public final java.lang.String getSimCalPre()
gets the simulation call prefix

Returns:
simulation call prefix

getSimCalSuf

public final java.lang.String getSimCalSuf()
gets the simulation call suffix

Returns:
simulation call suffix

isObjectiveFunctionDelimiterSet

public final boolean isObjectiveFunctionDelimiterSet()
checks whether the objective function delimiter is set or not

Returns:
true if it is set, false otherwise

convertToTemporaryPath

public final java.lang.String convertToTemporaryPath(java.lang.String path,
                                                     java.lang.String dirName)
converts the argument path to the temporary path that will be used for the simulation

Parameters:
path - the original path as specified in GenOpt's files
dirName - the name of the temporary directory (without the full path name)
Returns:
the path name