Back to instructions on creating a solver

Input types avaiable for NEOS solvers

Neos recognizes the following types of input:
The tags used in the XML file describing these inputs can be seen in the following table:
<neos:token>
required
The name of this input.  This is the name of the XML tag that will be used when submitting a job via XML-RPC or email.  When using the web submission form, kestrel, or the Java submission tool, the token name will be hidden from the user.
<neos:filename>
required
This indicates the name of the file that the value of the input will be stored in.  When writing the driver to run your solver, you need to read this file to get the desired value
<neos:prompt>
optional
The prompt that the user will see when using the web submission form or the Java submission tool.
<neos:help>
optional
A message to explain what the input is used for and any instructions for the user.
<neos:default>
optional
The default setting for this option.  Not applicable for radio buttons or files.


Textfield

Textfields allow the user the type in a line of text for input.  The following is a sample XML code for using a text area:
<neos:input TYPE="textarea">
  <neos:token>mytext</neos:token>
  <neos:filename>mytextfile</neos:filename>
  <neos:prompt>Enter some text</neos:filename>
  <neos:help>This is an example of using a textarea</neos:help>
  <neos:default>Default Text</neos:default>
</neos:input>


For the web submission form, this will result in a form that looks like:
This is an example of using a textarea
Enter some text:


Whatever is in the textarea will be sent to the solver as the contents of the file 'mytextfile'.

Textarea
Textareas are the same as textfields, except that a multiple-line text box is displayed.
<neos:input TYPE="textbox">
  <neos:token>mytext</neos:token>
  <neos:filename>mytextfile</neos:filename>
  <neos:prompt>Enter some text</neos:filename>
  <neos:help>This is an example of using a textbox</neos:help>
  <neos:default>Default Text</neos:default>
</neos:input>


For the web submission form, this will result in a form that looks like:
This is an example of using a textbox
Enter some text:


Whatever is in the textarea will be sent to the solver as the contents of the file 'mytextfile'.

Files

A file widget allows the user to use a local file as input to the solver.  If the user is submitting their job using the Web form or the Java tool, then it provides a
file selection tool to pick a file.  For email or XML-RPC submissions, there is no difference among the 'file', 'textfield', or 'textarea' options.
<neos:input TYPE="file">
  <neos:token>samplefile</neos:token>
  <neos:filename>mysamplefile</neos:token>
  <neos:prompt>File:</neos:prompt>
  <neos:help>This is an example of using a file</neos:help>
</neos:input>

For the Web form or Java tool, this will display the form:


If a local file is chosen using the 'Browse...' button, then the contents of that file will be sent to the solver as the file 'mysamplefile'.


Checkbox
Checkboxes provide a way for the user to set an option as true or false.  The XML for using a checkbox looks like:
<neos:input TYPE="checkbox">
  <neos:token>samplecheckbox</neos:token>
  <neos:filename>mycheckbox</neos:filename>
  <neos:prompt>Check me</neos:prompt>
  <neos:help>This is an example of using a checkbox</neos:help>
  <neos:default>yes</neos:default>
</neos:input>


The file 'mycheckbox' will be sent to the solver.  If the box is checked, the contents of the file will be 'yes', otherwise it will be 'no'.


Radio Button

Radio buttons provide users with a set of options, of which at most one can be selected.  To designate a radio button as input, you need to add a declaration in the XML file that will look something like the following:
<neos:input TYPE="radio">
  <neos:token>selection</neos:token>
  <neos:filename>selectionfile</neos:filename>
  <neos:prompt>Make a selection</neos:prompt>
  <neos:help>This is an example of how to formulate a radio button.</neos:help>
  <neos:option value="value1">Select value 1</neos:option>
  <neos:option value="value2" default="true">Select value 2</neos:option>
</neos:input>

Note the addition of the <neos:option> tag.  The value attribute determines the text entered into the file 'selectionfile', the text inside the tag will be displayed for choosing the option, and setting the optional default attribute to true will cause the option to be the default selection.  For the Web submission form, this will result in a form that looks like this:

This is an example of how to formulate a radio button.
Make a selection:

If this was submitted, then a file named 'selectionfile' containing the text 'value2' would be sent to the solver.

Back to instructions on creating a solver
@NEOS_WEB_DISCLAIMER@