Difference between revisions of "SED:SED reference"
(5 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
=== SequentialDesign(problemStruct) === | === SequentialDesign(problemStruct) === | ||
− | Create a sequentual design object for the specified problem, as described in problemStruct. For more information, see the [[SED:SED_toolbox#You_want_to_use_the_more_advanced_features_of_the_SED_Toolbox|main page]]. | + | Create a sequentual design object for the specified problem, as described in problemStruct. Uses the default algorithm ('''mc-intersite-projected-threshold''') to generate the design. For more information, see the [[SED:SED_toolbox#You_want_to_use_the_more_advanced_features_of_the_SED_Toolbox|main page]]. |
+ | |||
+ | |||
+ | === seq = SequentialDesign('problem.xml') === | ||
+ | |||
+ | Create a sequentual design object for the specified problem, as described in the problem.xml XML file. Uses the default algorithm ('''mc-intersite-projected-threshold''') to generate the design. For more information, see the [[SED:SED_toolbox#You_want_to_use_the_more_advanced_features_of_the_SED_Toolbox|main page]]. | ||
+ | |||
+ | |||
+ | === seq = SequentialDesign(problemStruct, 'methods/method.xml') === | ||
+ | |||
+ | Create a sequentual design object for the specified problem, as described in problemStruct. Uses the algorithm described in methods/method.xml to generate the design. For more information, see the [[SED:SED_toolbox#You_want_to_use_the_more_advanced_features_of_the_SED_Toolbox|main page]]. | ||
+ | |||
+ | |||
+ | === seq = SequentialDesign('problem.xml', 'methods/method.xml') === | ||
+ | |||
+ | Create a sequentual design object for the specified problem, as described in the problem.xml XML file. Uses the algorithm described in methods/method.xml to generate the design. For more information, see the [[SED:SED_toolbox#You_want_to_use_the_more_advanced_features_of_the_SED_Toolbox|main page]]. | ||
+ | |||
+ | |||
+ | === [seq, newPoints] = seq.generatePoints(10) === | ||
+ | |||
+ | Use the sequential design algorithm to generate an additional 10 points on top of the already generated points. Will return the new points as the second return parameter. | ||
+ | |||
+ | |||
+ | === [seq, newPoints] = seq.generateTotalPoints(10) === | ||
+ | |||
+ | Use the sequential design algorithm to generate a total of 10 points. If, for example, 6 points were previously generated, 4 additional points will be selected to get the total up to 10. Will return the new points as the second return parameter. | ||
+ | |||
+ | |||
+ | === seq.getInitialDesign() === | ||
+ | |||
+ | The initial design is a set of samples which is generated in advance, to get the sequential design algorithm started. In the SED Toolbox, these are kept as small as possible (most methods need at least 2 points to get going, so the initial design will typically be 2 points). Note that the initial design ''might not respect the constraints''. You can manually remove the initial points from the design, or you can request all the points excluding the initial design using the getAllPointsWithoutInitialDesign() function. | ||
+ | |||
+ | |||
+ | === seq.getAllPoints() === | ||
+ | |||
+ | Get all points generated thus far, including the initial design. | ||
+ | |||
+ | |||
+ | === seq.getAllPointsWithoutInitialDesign() === | ||
+ | |||
+ | Get all points generated thus far, excluding the initial design. | ||
+ | |||
+ | |||
+ | === seq.plot() === | ||
+ | |||
+ | Generate a plot of the design generated thus far. Will only work for 1-3D. | ||
+ | |||
+ | |||
+ | === seq.getMetrics() === | ||
+ | |||
+ | Will calculate some metrics about the quality of the design. Two metrics are calculated and plotted: the intersite distance (minimum distance between points) and the projected distance (minimum distance between points after being projected onto one of the axes). These can be used as a basis of comparison between designs. | ||
+ | |||
+ | === metrics = seq.getMetrics() === | ||
+ | |||
+ | Will return the same metrics as described above in a struct. Will not plot or print any data. | ||
+ | |||
+ | === metrics = seq.getMetrics(points) === | ||
+ | |||
+ | Calculate the same metrics as above, but then for the points provided as an argument instead of the design generated by the object. This function can be used to compare a design from another source against the design generated by the SED Toolbox. | ||
+ | |||
+ | |||
+ | === seq = seq.updatePoints(newPoints, newValues) === | ||
+ | |||
+ | When using LOLA-Voronoi, you need to provide the outputs produced through simulation after every call of generatePoints. This is required because LOLA-Voronoi uses the outputs to determine the optimal distribution of points. When using the other methods, you do not need to call updatePoints. | ||
+ | |||
+ | |||
+ | === seq = seq.plotLive(true) === | ||
+ | |||
+ | This will enable live plotting of sample generation for 2D designs. If this is enabled, after each point that is generated, a plot will be built that shows the current design. This nicely demonstrates how points are selected and distributed over the design space. | ||
+ | |||
+ | |||
+ | === seq.save('file.txt') === | ||
+ | |||
+ | Store the entire design in a text file called ''file.txt''. Can later be loaded again by calling data = load('file.txt'). |
Latest revision as of 13:31, 25 January 2011
This page describes the different functions available in the SequentialDesign class, which is the main entry point for using the SED Toolbox. There are three ways to create an instance of this class, as described in the different use cases in the main documentation page. Additionally, several functions are available to make it easy for the user to generate, plot and get data about the design produced by your SequentialDesign instance. In the sections below, we describe each function that is available to the user.
SequentialDesign
SequentialDesign(problemStruct)
Create a sequentual design object for the specified problem, as described in problemStruct. Uses the default algorithm (mc-intersite-projected-threshold) to generate the design. For more information, see the main page.
seq = SequentialDesign('problem.xml')
Create a sequentual design object for the specified problem, as described in the problem.xml XML file. Uses the default algorithm (mc-intersite-projected-threshold) to generate the design. For more information, see the main page.
seq = SequentialDesign(problemStruct, 'methods/method.xml')
Create a sequentual design object for the specified problem, as described in problemStruct. Uses the algorithm described in methods/method.xml to generate the design. For more information, see the main page.
seq = SequentialDesign('problem.xml', 'methods/method.xml')
Create a sequentual design object for the specified problem, as described in the problem.xml XML file. Uses the algorithm described in methods/method.xml to generate the design. For more information, see the main page.
[seq, newPoints] = seq.generatePoints(10)
Use the sequential design algorithm to generate an additional 10 points on top of the already generated points. Will return the new points as the second return parameter.
[seq, newPoints] = seq.generateTotalPoints(10)
Use the sequential design algorithm to generate a total of 10 points. If, for example, 6 points were previously generated, 4 additional points will be selected to get the total up to 10. Will return the new points as the second return parameter.
seq.getInitialDesign()
The initial design is a set of samples which is generated in advance, to get the sequential design algorithm started. In the SED Toolbox, these are kept as small as possible (most methods need at least 2 points to get going, so the initial design will typically be 2 points). Note that the initial design might not respect the constraints. You can manually remove the initial points from the design, or you can request all the points excluding the initial design using the getAllPointsWithoutInitialDesign() function.
seq.getAllPoints()
Get all points generated thus far, including the initial design.
seq.getAllPointsWithoutInitialDesign()
Get all points generated thus far, excluding the initial design.
seq.plot()
Generate a plot of the design generated thus far. Will only work for 1-3D.
seq.getMetrics()
Will calculate some metrics about the quality of the design. Two metrics are calculated and plotted: the intersite distance (minimum distance between points) and the projected distance (minimum distance between points after being projected onto one of the axes). These can be used as a basis of comparison between designs.
metrics = seq.getMetrics()
Will return the same metrics as described above in a struct. Will not plot or print any data.
metrics = seq.getMetrics(points)
Calculate the same metrics as above, but then for the points provided as an argument instead of the design generated by the object. This function can be used to compare a design from another source against the design generated by the SED Toolbox.
seq = seq.updatePoints(newPoints, newValues)
When using LOLA-Voronoi, you need to provide the outputs produced through simulation after every call of generatePoints. This is required because LOLA-Voronoi uses the outputs to determine the optimal distribution of points. When using the other methods, you do not need to call updatePoints.
seq = seq.plotLive(true)
This will enable live plotting of sample generation for 2D designs. If this is enabled, after each point that is generated, a plot will be built that shows the current design. This nicely demonstrates how points are selected and distributed over the design space.
seq.save('file.txt')
Store the entire design in a text file called file.txt. Can later be loaded again by calling data = load('file.txt').