You are not logged in. Click here to log in.

Application Lifecycle Management

Search In Project

Search inClear

Console FAQ #17025/HEAD / v11
Tags:  not added yet

Frequently Asked Questions (FAQ)

Component Development

How do I define an OMS3 Java Component?

An OMS3 component is just a plain class. It also has some extra information, called Annotations enabling the OMS framework to use it as a modeling component. There are many OMS3 annotations that can be used, however only @In, @Out, and @Execute are required.

CircleArea.java:

import oms3.annotations.*;

public class CircleArea {

   @In public double radius;
   @Out public double area;

   @Execute
   public void runme() {
       area = Math.PI * radius * radius; 
   }
}

All blue source code elements are OMS3 annotations. @In/Out are tagging the fields radius and area to be input or output to this component, @Execute is tagging the execution method. With this information present the framework can establish dataflow among components and manages overall execution.

Console

What is the purpose of the OMS Console, how does it differ from OMS Framework?

Answer: The OMS3 Modeling Console is a simple graphical user interface for the OMS3 Modeling Framework. It provides simple access to framework core features such as simulation management, output analysis, or documentation generation.

It represents a general way to use the framework and provide core aspects of modeling using OMS3. It is not meant to be the only way to use OMS3 in an application, but maybe it may is the one to start with...

How do I uninstall the console?

Answer: Delete the folder where unpacked the console zip file. Also delete the HOME/.oms/OMS_VERSION (e.g. OMS_VERSION = 3.1). This folder contains the runtime jar files.

The console wants me to set the JAVA_HOME environment variable, why?

Answer: OMS needs to run simulations with the JDK, the JRE is not sufficient.

In windows JAVA_HOME needs to be set using your control panel/system settings. In Linux or OSX you can set it for example in ~/.profile:

JAVA_HOME=/opt/jdk1.6_22

or

JAVA_HOME=/Library/Java/Home

verify your setting with 'echo $JAVA_HOME' on Linux/OSX or 'set JAVA_HOME' on Windows

Further instructions

Projects

Does OMS requires a certain folder setup for projects?

Answer: No, not really. However it makes sense to organize modeling projects in a consistent. A common setup can be found for all the example projects that are downloadable from this site.
<INSTALL_DIR>
 +--oms3.prj.thornthwaite         base project folder
    +-- dist                      jar/dll/exe file directory
    +-- data                      input data
    +-- output                    output folder for results
    +-- simulations               simulation files
    +-- src                       sources files

MMS to OMS conversion

How do I convert a MMS files (.param,.data,.statvar) to a OMS .csv file

If the user has an existing PRMS MMS parameter file, it can be converted to a PrmsOms parameter file using the editor in the OMS3 Console. To make this conversion, first put the MMS parameter file in a project data directory. Then load any .sim file into the Console and click on the editor icon. This will load the parameter file listed in the .sim file. You can ignore this parameter file. Then enter in the computation field the conversion command conv followed by the full path to the MMS parameter file. The MMS parameter file name MUST have the extension .params to be recognized by the conversion program.

In the C:\PrmsOmsWork\data directory is a MMS parameter file named efc_MMS_params.params. To convert this file to an OMS3 parameter file format, start the OMS Console and open the Editor. In the computation field enter the conversion command as shown below. The system will respond when the conversion is complete and will show the path and name of the new converted file.

To use this file with a PrmsOms model, enter the path and new file name in the parameter field of the .sim file to be used to run PrmsOms. Note that the parameters in the MMS parameter file may not be the complete set of parameters needed for the PrmsOms version. When the .sim file is executed, a check is made on the parameter file to insure that all model declared parameters are contained in the declared parameter file. If parameters are missing from the parameter file, the model will terminate with an error message and a missing.params file will be created and placed in the work directory (in this example, the PrmsOmsWork directory). This missing .params file will contain all the missing parameters in OMS3 format and default values will be assigned to all missing parameters. The default values are either zero or the default value specified in the model declaration of the parameter.

The missing parameters can be added to your parameter file using your favorite editor. Copy and paste the missing parameters to your parameter file. When the missing parameters are added to your parameter file, you may need to modify the default values to be consistent with the model application.

How do I convert a MMS data file to OMS

If you have an existing PRMS MMS data file, you can convert it to a PrmsOms data file using the Editor in the OMS3 Console. To make this conversion, first put the MMS data file in a project data directory. Then load any .sim file into the Console and click on the editor icon. This will load the parameter file listed in the .sim file. You can ignore this parameter file. Then enter in the computation field the conversion command conv followed by the full path to the MMS data file. The MMS data file name MUST have the extension .data to be recognized by the conversion program.

In the C:\PrmsOmsWork\data directory is a MMS data file named efc_MMS_data.data. To convert this file to an OMS3 data file format, start the OMS Console and open the Editor. In the computation field enter the conversion command as shown below. The system will respond when the conversion is complete and will show the path and name of the new converted file.

To use this file with a PrmsOms model, enter the path and new file name in the inputFile field of the .sim file to be used to run PrmsOms.

How do I convert a MMS statvar file.

If you have an existing PRMS MMS statvar file, you can convert it to a PrmsOms .csv file using the Editor in the OMS3 Console. To make this conversion, first put the MMS statvar file in a project data directory. Then load any .sim file into the Console and click on the editor icon. This will load the parameter file listed in the .sim file. You can ignore this parameter file. Then enter in the computation field the conversion command conv followed by the full path to the MMS statvar file. The MMS statvar file name MUST have the extension .statvar to be recognized by the conversion program.

In the C:\PrmsOmsWork\data directory is a MMS statvar file named efc_MMS_statvar.statvar. To convert this file to an OMS3 .csv file format, start the OMS Console and open the Editor. In the computation field enter the conversion command as shown below. The system will respond when the conversion is complete and will show the path and name of the new converted file.

A typical use of a converted statvar file is to compare MMS results with OMS results. You can plot any of the variables in the converted statvar file in the analysis element of a .sim file. Simply use the full path and variable name in a timeseries setup.