genopt.algorithm
Class Mesh

java.lang.Object
  extended by genopt.algorithm.Optimizer
      extended by genopt.algorithm.Mesh

public class Mesh
extends Optimizer

Class for doing a parametric run where the parameters are the nodes of a grid.

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  int dimCon
          number of continuous independent variables
protected  int dimDis
          number of discrete independent variables
protected  int dimF
          number of function values
protected  int dimX
          number of independent variables
protected  int[] ind
          index that defines the perturbated parameter value
protected  int[] leng
          number of values that each parameter can take on
protected  int nS
          number of required function evalations
(package private)  java.util.Vector<Point> poiVec
          Vector of points to be evaluated
protected  int[] step
          number of steps for continuous parameters
protected  boolean stopAtError
          flag whether run should stop or proceed if a simulation error occurs
 
Fields inherited from class genopt.algorithm.Optimizer
done, EXCLUDING, FS, INCLUDING, LS, MAINITERATION, ORIGINAL, SUBITERATION, TRANSFORMED
 
Constructor Summary
Mesh(GenOpt genOptData)
          Constructor
 
Method Summary
private  void executeSimulations()
          Executes all simulations.
 Point getF(Point pt)
          Evaluates a simulation and reports result
private  void perturb(int iPar)
          Perturbs the point and evaluates a simulation
 int run(Point x0)
          Runs the evaluation
 
Methods inherited from class genopt.algorithm.Optimizer
algorithmRequiresUsageOfStepNumber, appendToOutputListing, checkMaxIteration, checkObjectiveFunctionValue, ensureOnlyContinuousParameters, ensureOnlyDiscreteParameters, getAbsAccuracyFunction, getDimensionContinuous, getDimensionDiscrete, getDimensionF, getDimensionX, getDiscreteValueDouble0, getDx, getDx0, getF, getIndex0, getIndex0, getInputValueBoolean, getInputValueDouble, getInputValueDouble, getInputValueInteger, getInputValueInteger, getInputValueString, getInputValueString, getKindOfConstraint, getL, getLengthDiscrete, getMainIterationNumber, getMaximumThreadPoolSize, getMaxIterationNumber, getMinimumPoint, getMode, getObjectiveFunctionName, getOutputPath, getPointerToEqualPoints, getRelAccuracyFunction, getSimulationNumber, getStepNumber, getU, getVariableNameContinuous, getVariableNameDiscrete, getX0, getX0, goToEndOfCommandFile, increaseStepNumber, increaseStepNumber, isFeasible, isNextToken, maxIterationReached, mustStopOptimization, print, println, replace, report, reportCurrentLowestPoint, reportMinimum, resetStepNumber, roundCoordinates, run, setInfo, setMode, setNumberOfMatchingResults, setToFeasibleCoordinate, setToFeasibleCoordinate, setWarning, simulate, throwInputError, useStepNumber, writeStepNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nS

protected int nS
number of required function evalations


dimX

protected int dimX
number of independent variables


dimCon

protected int dimCon
number of continuous independent variables


dimDis

protected int dimDis
number of discrete independent variables


dimF

protected int dimF
number of function values


leng

protected int[] leng
number of values that each parameter can take on


ind

protected int[] ind
index that defines the perturbated parameter value


step

protected int[] step
number of steps for continuous parameters


stopAtError

protected boolean stopAtError
flag whether run should stop or proceed if a simulation error occurs


poiVec

java.util.Vector<Point> poiVec
Vector of points to be evaluated

Constructor Detail

Mesh

public Mesh(GenOpt genOptData)
     throws OptimizerException,
            java.io.IOException,
            java.lang.Exception,
            InputFormatException
Constructor

Parameters:
genOptData - a reference to the GenOpt object.
Note: the object is used as a reference. Hence, the datas of GenOpt are modified by this Class.
Throws:
OptimizerException
java.io.IOException - if an I/O exception occurs
java.lang.Exception
InputFormatException
Method Detail

run

public int run(Point x0)
        throws OptimizerException,
               java.lang.Exception
Runs the evaluation

Specified by:
run in class Optimizer
Parameters:
x0 - initial point
Returns:
+4 the only possible return value
Throws:
java.lang.Exception
OptimizerException
InputFormatException - if an InputFormatException occurs
java.lang.NoSuchMethodException - if a method that should be invoked could not be found
java.lang.IllegalAccessException - if an invoked method enforces Java language access control and the underlying method is inaccessible
java.lang.reflect.InvocationTargetException - if an invoked method throws an exception

perturb

private void perturb(int iPar)
              throws OptimizerException,
                     java.lang.Exception
Perturbs the point and evaluates a simulation

Parameters:
iPar - number of continuous and discrete parameters that has to be perturbed
Throws:
java.lang.Exception
OptimizerException

executeSimulations

private void executeSimulations()
                         throws OptimizerException,
                                java.lang.Exception
Executes all simulations. At any time, only as many simulations will be started as there are threads available. After these simulations finished, the results are reported, and then the next simulations will be started.

Throws:
java.lang.Exception
OptimizerException

getF

public Point getF(Point pt)
           throws SimulationInputException,
                  OptimizerException,
                  java.lang.Exception
Evaluates a simulation and reports result

Overrides:
getF in class Optimizer
Parameters:
pt - point to be evaluated
Returns:
a clone of the point with the new function values stored
Throws:
OptimizerException - if an OptimizerException occurs or if the user required to stop GenOpt
SimulationInputException - if an error in writing the simulation input file occurs
java.lang.Exception - if an I/O error in the simulation input file occurs