Optimization Services


 

 

 

 

 

 

 

 

Optimization Services simulation Language (OSsL)

Click to see or download the OSsL XML Schema -> OSsL.xsd [near stable]


OSsL (simulation) is a format for input and output used by simulation services that are invoked via the Optimization Services to obtain function values.

OSsL facilitates and enables objective or constraint functions to incorporate simulations, which may be located in places other than the solver. An OSsL instance is usually transmitted between a solver and a simulation engine. From the Optimization Services framework point of view, if a simulation is to be invoked by an OS-compatible solver, its input and output have to be put in the standard OSsL format.

Each simulation consists of the simulation’s address using the <uri> child and its input and output using the <ossl> child. The following figure is a good illustration.

simpleSimulation

The definition of simpleSimulation looks like:

<simulation name="simpleSimulation">
       <uri value="http://www.optimizationservices.org/os/ossimulation/SimpleSimulationService.jws"/>
       <ossl>
             <input>
                    <el name="a">1</el>
                    <el name="b">MSFT</el>
             </input>
             <output>
                    <el name="f1"/>
                    <el name="f2"/>
             </output>
       </ossl>
</simulation>

As the OSnL section, to construct a nonlinear expression that contains simpleSimulation, we use the <simInput> and <simOutput> nodes:

<nl idx="-1">
       <plus>
             <sim name="simpleSimulation">
                    <simInput inputName="a"> <var idx="0"/> </simInput>
                    <simInput inputName="b"> <var idx="1"/> </simInput>
                    <simOutput outputName="f1"/>
             </sim>
             <number value="2"/>
       </plus>
</nl>

In the following Figure, we list the entire ossl schema.

OSsLSchema

<xs:complexType name="OSsL">
       <xs:all>
             <xs:element name="input" minOccurs="0">
                    <xs:complexType>
                           <xs:sequence>
                                 <xs:element name="el" type="ioType" minOccurs="0" maxOccurs="unbounded"/>
                           </xs:sequence>
                    </xs:complexType>
             </xs:element>
             <xs:element name="output" minOccurs="0">
                    <xs:complexType>
                           <xs:sequence>
                                 <xs:element name="el" type="ioType" minOccurs="0" maxOccurs="unbounded"/>
                           </xs:sequence>
                    </xs:complexType>
             </xs:element>
       </xs:all>
</xs:complexType>

<xs:complexType name="ioType">
       <xs:simpleContent>
             <xs:extension base="xs:string">
                    <xs:attribute name="name" type="xs:ID" use="required"/>
                    <xs:attribute name="type" type="type" use="optional" default="string"/>
             </xs:extension>
       </xs:simpleContent>
</xs:complexType>

<xs:simpleType name="type">
       <xs:restriction base="xs:string">
             <xs:enumeration value="string"/>
             <xs:enumeration value="link"/>
       </xs:restriction>
</xs:simpleType>

As illustrated in the above figure, the OSsL schema is very simple, but still general enough to accommodate to any existing simulations. The <ossl> element has two optional children <input> and <output> and it does not matter which comes first. The two child elements are very similar, which is why we don’t have a separate schema for each. Both elements have 0 or more <el> elements. This corresponds to the notion that simulations in general can take any number of inputs and generate any number of outputs. An <el> element is of ioType; it takes a required name attribute for the input or output name and an optional type attribute. The input or output values go inside the elements. By default the type attribute is “string” which is the most general an input or output value can be. The other type is “link” which indicates that the value inside the <el> element is a pointer and the actual data is to be obtained from the specified link address. For instance, in the following example:

<simulation name="simpleSimulation">
       <uri value="http://www.optimizationservices.org/os/ossimulation/SimpleSimulationService.jws"/>
       <ossl>
             <input>
                    <el name="a" type="string">1</el>
                    <el name="b" type="link">http://www.optimizationservices.org/data/stock.html</el>
             </input>
             <output>
                    <el name="f1">
                    <el name="f2"/>
             </output>
       </ossl>
</simulation>

input “a” is a string (= “1”) and input “b” is a link. The value of b (e.g. “MSFT”) should be obtained from the address http://www.optimizationservices.org/data/stock.html.


Links:

Click to see or download the OSsL XML Schema -> OSsL.xsd