The SUMO toolbox  2018a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Static Public Member Functions | List of all members
inputParserSUMO Class Reference

SUMO version of an inputParser. More...

Inheritance diagram for inputParserSUMO:
Inheritance graph
[legend]

Public Member Functions

function inputParserSUMO ()
 
function addRequired (var name, var validator, var convertor)
 add a mandatory parameter More...
 
function addOptional (var name, var defaultValue, var validator, var convertor)
 add an optional parameter More...
 
function addRequiredAttribute (var name, var validator, var convertor)
 add a mandatory attribute More...
 
function addOptionalAttribute (var name, var defaultValue, var validator, var convertor)
 add an optional attribute More...
 
function addRequiredObject (var name, var type, var min, var max)
 add a mandatory object (tag) More...
 
function addOptionalObject (var name, var defaultValue, var type, var min, var max)
 add an optional object (tag) More...
 
function addDimensions ()
 add special parameters for the dimension More...
 
function addInputDescription ()
 add special parameters describing the input More...
 
function addOutputDescription ()
 add special parameters describing the output More...
 
function addClassification ()
 add special parameters for classification More...
 
function addOptimization ()
 add special parameters for optimization More...
 
function parse (var varargin)
 Parses the option according to the specified structure. More...
 

Static Public Member Functions

static function str2bool (var s)
 converts a string to a boolean More...
 
static function str2cell (var s)
 converts a string to a cell array More...
 
static function str2logical (var s)
 converts a string to a logical array More...
 
static function str2any (var s, var map)
 converts a string to an object More...
 
static function isa (var objects, var type)
 cell array version of isa More...
 
static function timeLeft ()
 

Detailed Description

SUMO version of an inputParser.

Basic validation and convertion functions:

More rigorous validation functions: @(x) validateattributes(x,{'numeric'},{'nonempty','integer','positive'}) @(x) validateattributes(x,{'cell'},{'ndims',2}) @(x) validateattributes(x,{'char'},{'nonempty'}) @(x) validatestring(x, {'value1' 'value2' 'value3'}, '', 'optionName')

Limitations:

Constructor & Destructor Documentation

function inputParserSUMO ( )
inline

Member Function Documentation

function addClassification ( )
inline

add special parameters for classification

Parameters that become available: isClassification, numberOfClasses

function addDimensions ( )
inline

add special parameters for the dimension

Parameters that become available: inDim, outDim, inSimDim, outSimDim

function addInputDescription ( )
inline

add special parameters describing the input

Parameters that become available: inputBounds, inputNames, inputWeights, frequencyDim

function addOptimization ( )
inline

add special parameters for optimization

Parameters that become available: hypervolumeR

function addOptional ( var  name,
var  defaultValue,
var  validator,
var  convertor 
)
inline

add an optional parameter

Note
Overrides addOptional but internally uses addParamValue as the name addOptional makes more sense, but we require the behavior of addParamValue
Parameters
namename of option
defaultValuedefault value
validatorfunction handle that validates the input
convertorfunction handle that converts the input to the right type
function addOptionalAttribute ( var  name,
var  defaultValue,
var  validator,
var  convertor 
)
inline

add an optional attribute

Parameters
namename of option
defaultValuedefault value
validatorfunction handle that validates the input
convertorfunction handle that converts the input to the right type
function addOptionalObject ( var  name,
var  defaultValue,
var  type,
var  min,
var  max 
)
inline

add an optional object (tag)

Parameters
namename of option (and tag)
defaultValuedefault value
typebase class of object
minminimum number of objects
maxmaximum number of objects
function addOutputDescription ( )
inline

add special parameters describing the output

Parameters that become available: isComplex

function addRequired ( var  name,
var  validator,
var  convertor 
)
inline

add a mandatory parameter

Parameters
namename of option
validatorfunction handle that validates the input
convertorfunction handle that converts the input to the right type
function addRequiredAttribute ( var  name,
var  validator,
var  convertor 
)
inline

add a mandatory attribute

Parameters
namename of option
validatorfunction handle that validates the input
convertorfunction handle that converts the input to the right type
function addRequiredObject ( var  name,
var  type,
var  min,
var  max 
)
inline

add a mandatory object (tag)

Parameters
namename of option (and tag)
typebase class of object
minminimum number of objects
maxmaximum number of objects
static function isa ( var  objects,
var  type 
)
inlinestatic

cell array version of isa

Parameters
objectsobject or cell array of objects
typeclass type to check against
Return values
outboolean
function parse ( var  varargin)
inline

Parses the option according to the specified structure.

An error will be given when not all mandatory options can be found and for unmatched options

Parameters
vararginraw parameter list
static function str2any ( var  s,
var  map 
)
inlinestatic

converts a string to an object

Namely, a cell array is used to map strings to an object (double, enum, function handle, etc.)

Parameters
sstring
Return values
oobject
static function str2bool ( var  s)
inlinestatic

converts a string to a boolean

Parameters
sstring
Return values
bboolean
static function str2cell ( var  s)
inlinestatic

converts a string to a cell array

Parameters
sstring
Return values
ccell array
static function str2logical ( var  s)
inlinestatic

converts a string to a logical array

Parameters
sstring
Return values
logicalIdxlogical array
static function timeLeft ( )
inlinestatic

The documentation for this class was generated from the following file: