Difference between revisions of "Add Initial Design"

From SUMOwiki
Jump to navigationJump to search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The toolbox comes with a number of sample selection algorithms, both for experimental design (initial samples) and sequential design.  Of course you are free to add your own.
+
'''Make sure you are familiar with [[OO Programming in Matlab]] before you attempt any of this.'''
  
The available initial designs can be found in the folder src/matlab/initialDesigns.  Adding a new type means creating a new class in this folder analogous to the existing ones (subclass InitialDesign). Two methods are required:
+
The toolbox comes with a number of sample selection algorithms, both for experimental design (initial samples) and sequential design.  Of course you are free to add your own. Note that it can be sometimes easier to combine existing initial designs to achieve the initial sample set you want by using a [[Config:InitialDesign#CombinedDesign|combined design]].
  
1. a constructor for reading in the configuration extracted from the XML file. Don't forget to call the constructor of the base class using the following syntax:
+
The available initial designs can be found in the folder src/matlab/initialDesigns. Adding a new type means creating a new class in this folder analogous to the existing ones. You must subclass InitialDesign and ensure two methods are implemented:
  
<code>
+
1. A constructor for reading in the configuration extracted from the XML file (look at the other initial design for how this works). Also don't forget to call the constructor of the base class using the following syntax:
 +
 
 +
<source lang="matlab">
 
this = this@InitialDesign(config);
 
this = this@InitialDesign(config);
</code>
+
</source>
  
2. a generate method that returns the following values:
+
2. A generate method that returns the following values:
  
 
* A set of initial samples (input values only) to be evaluated. To easily support different ranges for variables, each sample has to be in a fixed [-1,1] range in each dimension. The samples are later automatically transformed to their original range before they are passed to the sample evaluator.
 
* A set of initial samples (input values only) to be evaluated. To easily support different ranges for variables, each sample has to be in a fixed [-1,1] range in each dimension. The samples are later automatically transformed to their original range before they are passed to the sample evaluator.
  
 
* An optional set of evaluated samples (inputs and outputs), which may come from any source (for example: a dataset). These samples are instantly fed to the toolbox for modelling, because they don't have to be evaluated anymore. Because of this property, they have to be in the original range defined in the simulator xml file, instead of the fixed [-1,1] range.
 
* An optional set of evaluated samples (inputs and outputs), which may come from any source (for example: a dataset). These samples are instantly fed to the toolbox for modelling, because they don't have to be evaluated anymore. Because of this property, they have to be in the original range defined in the simulator xml file, instead of the fixed [-1,1] range.

Latest revision as of 15:32, 30 January 2012

Make sure you are familiar with OO Programming in Matlab before you attempt any of this.

The toolbox comes with a number of sample selection algorithms, both for experimental design (initial samples) and sequential design. Of course you are free to add your own. Note that it can be sometimes easier to combine existing initial designs to achieve the initial sample set you want by using a combined design.

The available initial designs can be found in the folder src/matlab/initialDesigns. Adding a new type means creating a new class in this folder analogous to the existing ones. You must subclass InitialDesign and ensure two methods are implemented:

1. A constructor for reading in the configuration extracted from the XML file (look at the other initial design for how this works). Also don't forget to call the constructor of the base class using the following syntax:

this = this@InitialDesign(config);

2. A generate method that returns the following values:

  • A set of initial samples (input values only) to be evaluated. To easily support different ranges for variables, each sample has to be in a fixed [-1,1] range in each dimension. The samples are later automatically transformed to their original range before they are passed to the sample evaluator.
  • An optional set of evaluated samples (inputs and outputs), which may come from any source (for example: a dataset). These samples are instantly fed to the toolbox for modelling, because they don't have to be evaluated anymore. Because of this property, they have to be in the original range defined in the simulator xml file, instead of the fixed [-1,1] range.