Difference between revisions of "Running"

From SUMOwiki
Jump to navigationJump to search
Line 10: Line 10:
 
If you want to add your own example see [[Adding an example]].
 
If you want to add your own example see [[Adding an example]].
  
If you have updated <code>defaul.xml</code> then simply run '<code>go</code>' to run the example (making sure that the toolbox is in your Matlab path of course).  Always make sure that the example you use matches the selected sample evaluator ([[Config:SampleEvaluator|SampleEvaluator]] tag).  For example, its no use running an example that is implemented as a static dataset using the '/[[Config:SampleEvaluator#matlab|matlab]]' or '/[[Config:SampleEvaluator#local|local]]' sample evaluators.  Doing this will result in an error.  In this case you should use 'scattered'.  See also [[Toolbox configuration#Structure]].
+
If you have updated <code>defaul.xml</code> then simply run '<code>go</code>' to run the example (making sure that the toolbox is in your Matlab path of course).  Always make sure that the example you use matches the selected sample evaluator ([[Config:SampleEvaluator|SampleEvaluator]] tag).  For example, its no use running an example that is implemented as a static dataset using the '[[Config:SampleEvaluator#matlab|matlab]]' or '[[Config:SampleEvaluator#local|local]]' sample evaluators.  Doing this will result in an error.  In this case you should use '[[Config:SampleEvaluator#scattered|scattered]]'.  See also [[Toolbox configuration#Structure]].
  
 
Other usages of '<code>go</code>' are as follows:
 
Other usages of '<code>go</code>' are as follows:
Line 24: Line 24:
 
  Note: the merging process does not support all possible cases,
 
  Note: the merging process does not support all possible cases,
 
        in case of problems, do not specify the "-merge" parameter.
 
        in case of problems, do not specify the "-merge" parameter.
 +
</pre></code>
  
    NB: the default configuraiton file is /path/to/SUMO/config/default.xml
+
Note: the default configuration file is <code><SUMO-Toolbox-installation-dir>/config/default.xml</code>.
</pre></code>
 
  
 
== Modeling Complex Outputs ==
 
== Modeling Complex Outputs ==

Revision as of 09:26, 13 June 2008

Default run

Once the SUMO Toolbox is installed you can do a simple test run to check if everything is working as expected. See the installation page for more information.

Running different examples

The examples/ directory contains many example simulators that you can use to test the toolbox with. These examples range from predefined functions, to datasets from various domains, to native simulation code. If you want to try one of the examples, open config/default.xml and edit the <Simulator> tag to suit your needs.

See the configuration section on information about the possible options. If you want to add your own example see Adding an example.

If you have updated defaul.xml then simply run 'go' to run the example (making sure that the toolbox is in your Matlab path of course). Always make sure that the example you use matches the selected sample evaluator (SampleEvaluator tag). For example, its no use running an example that is implemented as a static dataset using the 'matlab' or 'local' sample evaluators. Doing this will result in an error. In this case you should use 'scattered'. See also Toolbox configuration#Structure.

Other usages of 'go' are as follows:

	"go"
     	"go('MyConfigFile.xml')"
     	"go('MyConfigFile.xml',xValues, yValues)"
     	"go('MyConfigFile.xml',xValues, yValues, options)"
  
     With options a cell array containing one or more of:
     	"'-merge'" : merge MyConfigFile.xml with the default configuration
		   Note: the merging process does not support all possible cases,
		         in case of problems, do not specify the "-merge" parameter.

Note: the default configuration file is <SUMO-Toolbox-installation-dir>/config/default.xml.

Modeling Complex Outputs

If you do not specify any specific <Output> tags, all outputs will be modeled with complexHandling set to 'complex' This will mean that a real output will be modeled as is and a complex output will be modeled directly. If you don't want this (i.e., you want to model the modulus of a complex output or you want to model real and imaginary parts separately), you explicitly have to set complexHandling to 'modulus' or 'real'. More information on this subject can be found at the Outputs page.

Debugging

To aid understanding and debugging you should set the console logging handler to FINE (or even FINER, FINEST) as follows: (by default it is set to INFO)

<Option key="java.util.logging.ConsoleHandler.level" value="FINE"/>

Remember to always check the log file first! When reporting problems please attach your log file and the xml configuration file you used.

Output

Output is stored in the directory specified in the Config:ContextConfig section of the configuration file (by default this is set to "output"). After completion of a SUMO-Toolbox run, the following files and directories can be found there:

  • config.xml: The xml file that was used by this run. Can be used to reproduce the entire modeling process for that run.
  • randstate.dat: contains states of the random number generators, so that it becomes possible to deterministically repeat a run (see the Random state page.
  • samples.txt: a list of all the samples that were evaluated and their outputs.
  • profilers: contains information and plots about convergence rates, resource usage, and so on.
  • best: contains the best models that were constructed during the run and also contains plots of these models. Is continuously updated as the modeling progresses.
  • models_outputname: contains a history of all the models and plots for each output that was modeled.

Loading a saved model from disk

As the SUMO Toolbox builds models, each current best model is stored as a matlab mat file in the output directory (eg: output/model_0002.mat). In order to load this model from disk and actually use it, do the following:

  • Start matlab, make sure the SUMO Toolbox is in your path and navigate to the directory where the model file is stored
  • Load the model from disk as follows:
    • >> modelFile = load('model_0002.mat');
    • >> model = modelFile.model;

Now the model is available as the variable 'model' in the matlab workspace. To see what you can do with it see the Using a model page.

Model portability

The model mat files can shared with other people. In order for somebody else to use your saved model the following conditions need to be satisfied:

  • The person has the SUMO Toolbox in his Matlab path
  • The person should be using a similar Matlab version as was used to create the model file (preferably equal)
  • The person should be using a similar SUMO Toolbox version as was used to create the model file (preferably equal)

Tips

See the Tips page for various tips and gotchas.

Interfacing with the SUMO Toolbox

To learn how to interface with the toolbox see the Adding an example and Interfacing with the toolbox pages.

Memory

See the Tips page on dealing with memory problems.

Miscellaneous scripts

See the Sun NG1 page for utility scripts for distributing the differnt runs.