Anda di halaman 1dari 38

Microsoft Solver Foundation

Solver Foundation for Excel Primer

This documentation is provided to you for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS,
IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright,
no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form
or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express
written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering
subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the
furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual
property.
2006-2010 Microsoft Corporation. All rights reserved.
Microsoft and Excel are registered trademarks or trademarks of Microsoft Corporation in the United States and/or other
countries.

2006-2010 Microsoft Corporation

Contents
Contents ........................................................................................................................................................ 2
Introduction .................................................................................................................................................. 3
What does Solver Foundation for Excel look like?........................................................................................ 4
Basic How-To................................................................................................................................................. 7
Creating the Model ................................................................................................................................... 7
Binding Data .............................................................................................................................................. 8
Goals, Constraints, and Directives .......................................................................................................... 11
Checking and Solving the Model ............................................................................................................. 15
Sample Projects........................................................................................................................................... 16
Airline Allocation Sample ..................................................................................................................... 17
Data and data binding ......................................................................................................................... 17
Appendix 1: Directive Options .................................................................................................................... 28
CompactQuasiNewtonDirective ............................................................................................................. 28
ConstraintProgrammingDirective ........................................................................................................... 28
HybridLocalSearchDirective .................................................................................................................... 29
InteriorPointMethodDirective ................................................................................................................ 29
MixedIntegerProgrammingDirective ...................................................................................................... 30
SimplexDirective ..................................................................................................................................... 30
StochasticDirective.................................................................................................................................. 31
Appendix 2: Optimization Modeling Language (OML)................................................................................ 32
Appendix 2: OMLX File Format ................................................................................................................... 33
Root Element Model ........................................................................................................................ 33
Name Element .................................................................................................................................... 33
ModelText Element............................................................................................................................. 33
DataBindings Element ......................................................................................................................... 33
BindingSourceInfo Element ................................................................................................................ 34
InputBindingInfo Element ................................................................................................................... 35
OutputBindingInfo Element ................................................................................................................ 36
Directives Element .............................................................................................................................. 36

2006-2010 Microsoft Corporation

DirectiveInfo Element ......................................................................................................................... 37


DirectivePropertyInfo Element ........................................................................................................... 37

Introduction
Solver Foundation is a pure, managed code runtime for mathematical programming, modeling, and
optimization. This .NET/CLR based framework provides a rich set of tools, services, and engines for
Visual Studio and Office. The Solver Foundation for Excel add-in enables the mathematical modeler to
optimize problems easily and within the comfort of the Excel environment. Key features of this
application include the following:
o

o
o
o

Modeling Editor. Simplifies the modeling experience by using a collection of modeling panes
and includes a modeling syntax checker and other similar features exposed through the Solver
Foundation ribbon bar for Excel.
Excel Cell binding. Binds static or dynamic data in a range to and from the model.
Automatic Results and Report generation. Displays all results and reports on separate Excel
sheets for easy viewing, saving, or integration into other workflow systems.
Import/Export capabilities. Supports MPS, QPS, SMPS, and OML formats. You can deploy a
model from Excel directly to C# - avoiding the need for the application developer to re-write any
model code.
Improved Microsoft Office Integration. Deploy models from Excel to SharePoint using our
OMLX file (model + metadata). This provides a script-safe and secure method to transfer models
between client and a server.

This release of the Solver Foundation for Excel add-in provides several improvements:

Support for 18 new OML operators such as Sin, Cos, If, Max, Min.

Nonlinear optimization support using the Compact Quasi Newton and Hybrid Local Search solvers.

Improved data binding support.

This document covers how you can model, solve, and generate reports by using the Solver Foundation
for Excel add-in. Please direct queries and feature suggestions online at www.solverfoundation.com.

2006-2010 Microsoft Corporation

What does Solver Foundation for Excel look like?


The Solver Foundation for Excel add-in makes it easier to build and solve models. Analysts, decision
makers, and the academic community can use the add-in as a tool for understanding the basics of
optimization. The following screenshot demonstrates the Solver Foundation for Excel add-in user
interface:

Models are entered in the right-hand pane. Models are built from input parameters, decisions, goals (in
the form of objective functions), constraints, and sets. Constraint and goal expressions are specified
using the Optimization Modeling Language (OML), a type safe declarative modeling language. You can
bind input parameters and output decisions to cell ranges in a worksheet.

2006-2010 Microsoft Corporation

To get started, enter the model in the modeling pane, and press the Check button on the Ribbon to
make sure the model is valid. Then, press the Solve button, and view the results on the Solver
Foundation Results sheet.
The Solver Foundation ribbon tab includes many features to help build, solve, and analyze models.

Model. Basic functionality for displaying, importing, exporting, and deploying models.
o Model. Hides or shows the modeling pane window.
o Import. Supports importing OML, MPS and QPS files. The add-in supports file sizes up to 10
MB. Larger files can be processed by the command-line tool MSFCLI, or by writing .NET
code to call Solver Foundation Services.
o Export. Save as MPS, QPS (when appropriate) or OML.
o Deploy. A model can be deployed to SharePoint (via OMLX format) or Visual Studio (via C#).
o Check. Performs syntax checking on the model. Results of this check will be displayed below
the model in the Model Validation text box within the modeling pane.
Report Verbosity. These options enable the user to fine tune what details are generated.
o Clear Log On Solve. The Log tab will clear after each Solve.
o Decisions. Display detailed Decision information when available.
o Directives. Display Directive related information.
o Infeasibility. Include solver specific sensitivity information.
o Sensitivity. Include solver-specific feasibility information when available.
o Solver Details. Include details such as solve time, algorithms used, etc.
Simulation. Solver Foundation supports stochastic programming to perform basic MonteCarlo and
Latin Hypercube simulations.
o Method. The sampling method used to solve stochastic models. Choose between Automatic
(the default), Monte Carlo and Latin Hypercube.
o Count. The number of samples. Larger values lead to improved accuracy but require more
time to solve.
o Seed. The seed used to initialize the random number generator. Using the same seed leads
to more predictable solution behavior.
Solve. The main runtime to invoke a solution.
o Solve. Runs the appropriate solver, and generates results in the Solver Foundation Results
sheet.
o (Solve) Next. Iterate through Constraint Programming problems that have multiple
solutions. Multiple solutions will be shown sequentially in the Solver Foundation Results
sheet.
o Stop. Interrupts the Check, Solve or Summary functions mid-stream.

2006-2010 Microsoft Corporation

Summary. Generates a report overview plus any solver execution details.

2006-2010 Microsoft Corporation

Basic How-To
This section goes through the general process of creating and solving a

model.

Creating the Model


A model can be formed several different ways:

Importing an existing model (including MPS, QPS, OML, etc.)


Typing a new model directly within the Model tab.
Typing values through the collection of modeling tabs.

Sets. These are collections of objects that are used as indexes in Parameters or Decisions. For
example, a matrix Parameter takes two Sets as indexes.
Parameters. These are the inputs of the solver data is bound from an Excel sheet to the model.
Parameters can be indexed, or singled-valued constants of type Reals, Integers, or Booleans.
Decisions. These are the outputs or results of the model being solved. Data can be bound to a
specific Excel sheet. Supported types for Decisions can be Reals, Integers, or Booleans.
Goals. This is where you define the business goal or goals you are trying to accomplish. These are
used to specify a quantity or equation that should be maximized or minimized.
Constraints. This is where you can add constraints to the model. These are restrictions placed on
Decisions.
Directives. Ability to provide solver hints and other solver specific attributes.
Model. Shows the model in OML format. Advanced users can manually edit OML directly from this
pane.
Log. Solver output details. This is similar to the command line interface output.

2006-2010 Microsoft Corporation

Binding Data
Most real world models have an algebraic form but depend on data to be used for a specific problem
instance. For example, a model may use a Demand parameter where product demand values are stored
in a range of cells. Data can be entered manually, or imported from a variety of sources using the Get
External Data button on the Data ribbon tab. Once the sheet contains model data, you can use the
Parameters and Decisions modeling pane tabs to bind the data to and from the model.
Parameters
The Parameters tab allows the user to bind data from an Excel sheet to the model. The following
parameter types are available:
-

Parameter. These represent real or integer values over a range.


Random Parameter. These are used in stochastic models and represent a random distribution.
Random parameters are either:
o Scenario Parameter. A random parameter where the possible values are specified by
scenarios. Each scenario has an associated value and probability of occurring.
o Distribution Parameter. A random parameter that represents a discrete or continuous
random distribution.

Parameters can be single-valued or indexed using Sets. A Set is an unordered list of items that define the
valid set of indexes for a Parameter or Decision. Both random and non-random parameters can be
indexed. You can use the Binding Editor to associate Sets with Parameters. Click on the Binding button
for a parameter to display the Binding Editor. The Binding Editor is shown in the following screenshot:

2006-2010 Microsoft Corporation

Set the cell range for the data using the control at the top of the dialog. The Binding Editor supports
three different data layouts.
A single row or column. Uncheck the Range Includes Column Headers and select the range
containing the data. In the first Set dropdown, choose the Set that represents the indexes for
the Parameter.
A table (matrix) containing data values. Uncheck the Range Includes Column Headers and
select the range containing the data. In the first Set dropdown select the Set that represents the
first (row) index. In the second Set dropdown select the second (column) index. The Column
Header controls are disabled.
A table containing rows containing indexes and values. The table has headers that describe the
contents of each column. Check the Range Includes Column Headers checkbox. Typically one
or more columns will represent indexes and one column contains the values. For each column
that represents an index, select the appropriate Set and Column Header. In the Value Field
dropdown, select the dropdown that contains the parameter values.
Decisions
Similar to the Parameters tab, the Decisions pane allows the user to bind Decisions generated from
Solver Foundation directly into an Excel sheet. The following input Decisions are available.
-

Decision. An output value that represents values that the solver should determine.
Recourse Decision. An output value in a stochastic model that is made in response to the
realization of a random parameter.

2006-2010 Microsoft Corporation

Decisions, just like Parameters, can be indexed using Sets. In the airline simulation sample below, there
are two decisions:

A doubly-indexed Decision that represents the number of aircraft of each type assigned to each
route.
A Recourse Decision that represents the number of passengers that will be bumped from each flight.

In this example, the customer demand for each route is random, therefore the number of passengers
that will need to be bumped is not known in advance. Since the number of bumped passengers depends
on the realization of the demand random parameter, it is defined as a recourse decision.

10

2006-2010 Microsoft Corporation

Goals, Constraints, and Directives


Parameters and Decisions are the raw materials used to build models using goals, constraints, and
directives. Goals and constraints are specified algebraically using OML. OML provides logical, arithmetic,
iteration and set operations that allow a wide range of goals and constraints to be clearly expressed.
Many real-world models have goals or constraints that apply to a range of input or output values. In
such cases, it is useful to define indexed parameters over sets and use the Foreach and Sum operators.
The following sections show how goals and constraints can be created and manipulated in the Excel addin. Then you can learn how Directives can be used to customize Solver Foundations solution behavior.
Goals
A goal combines Parameters and Decisions in order to express how a model is to be optimized. Typically,
goals represent business objectives or preferences such as maximize profit, or minimize waiting
time. In the following example, the goal is to minimize operational cost:

11

2006-2010 Microsoft Corporation

The first step is to specify a unique name for the goal. The Kind of goal is either Maximize or Minimize.
The Expression is text that combines Decisions, Parameters, and constant values using the rich set of
operations provided by OML. This example uses the Sum and Foreach expressions to iterate over the
set of possible routes and airplane types. Goals can contain Recourse Decisions, in which case Solver
Foundation can substitute the expected value over all samples of the random parameters.

12

2006-2010 Microsoft Corporation

Constraints
A constraint is simply an expression that restricts possible values for decisions. Some constraints are
logical in nature for example, the sum of demand over all routes is equal to the total demand.
Others represent business constraints, such as do not allow server load to exceed 90%.

The constraint above is indexed over the Routes set using the Foreach expression. The constraint says
that for each route, the demand is the sum of the products of the passenger capacities and airplane
fleet allocation, minus the number of passengers bumped from the route

13

2006-2010 Microsoft Corporation

Directives
Parameters, decisions, goals and constraints all describe the content of a model, whereas a directive
specifies how a model should be solved. Directives are not required when building a model; however,
these are useful when you want to customize the behavior of a solver.

A Stochastic Directive in used for this model because it contains random parameters. A complete list of
Directive attributes can be found in the appendix.

14

2006-2010 Microsoft Corporation

Checking and Solving the Model


After the data binding is complete, you are ready to validate the model by using the Check button. This
functionality validates your model and checks the matching between data and parameters. A valid
model can be solved at any time by simply pressing the Solve button. Solver Foundation automatically
generates results, and if you specify an output binding, any Excel valid action (graphing, charting, etc.)
can be used.
Solver Foundation for Excel provides a detailed summary for additional post optimality analysis. Click the
Summary button to initiate a report that includes an Overview, Solver Execution Details, and if available,
the Stochastic Measures and Sensitivity Details reports.

15

2006-2010 Microsoft Corporation

Sample Projects
The Solver Foundation installation includes several samples to help you get started. These samples
demonstrate a variety of solver and application domain types:
Area
Solver Foundation for Excel
XLSX
XLSX
XLSX
XLSX
XLSX
XLSX
XLSX

Domain

Samples

Linear Programming
Constraint Programming
Quadratic Programming
Simulation
Mixed Integer Programming
Nonlinear Programming
Special Ordered Sets (SOS)

Supply Chain Planning


Job Machine Allocation
Quadratic Portfolio
Airline Allocation
Airline Allocation
Shipping Route
Purchase

These samples span classical problem domains in mathematical programming and operations research:
linear programming (LP), quadratic programming (QP), constraint programming (CP), nonlinear
programming (NLP) and stochastic programming (SP).

16

2006-2010 Microsoft Corporation

Airline Allocation Sample


In the following walkthrough, use the Solver Foundation add-in for Excel to solve an operational
planning problem using stochastic programming and Monte Carlo simulation. An operations planner for
a regional airline needs to determine how to utilize its fleet to minimize operational cost. The airline has
a mixed fleet of planes that operate five routes out of six cities. A demand forecast for each route has
been determined, as well as the capacity and per-mile costs for each type of plane on each route. The
planner wants to determine the allocation of planes to routes that results in the lowest monthly
operational cost.
Data and data binding
The first Excel sheet contains the problem data:

17

2006-2010 Microsoft Corporation

The sheet contains the following data:

The number of aircraft of each type.


The forecasted demand and price for each route.
The carrying capacity per month for each type of plane for each route (in thousands).
The operational cost for a plane on a route, in thousands.
The cost of a refund due to overbooking for each route.

The actions in the Solver Foundation ribbon cover the entire lifecycle of building a model, checking
correctness, solving, and analyzing results. The modeling pane on the right guides the model creation

18

2006-2010 Microsoft Corporation

process. The first step is to create Parameters that bind to the data in the worksheet. In the right-hand
pane, there is defined Parameter called Demand that binds to a range in the worksheet. The decisions
are defined in a similar fashion. The most interesting decision is Allocation: the number of planes of each
type to assign to each route. First define Routes and Aircraft sets by switching to the Sets tab, clicking
New, and entering the name for each Set.

Now create the decision by switching to the Decisions tab and clicking New. Use the Binding Editor to
associate the Routes and Aircraft sets:

19

2006-2010 Microsoft Corporation

20

2006-2010 Microsoft Corporation

The goal is to minimize operational costs. This goal is expressed by combining the inputs and outputs
using OML's expression language. Similarly you can define constraints, such as the constraint that the
sum of the allocations for a plane type over all routes must not exceed inventory.

21

2006-2010 Microsoft Corporation

The model definition is complete. The OML tab shows the complete representation of the model in
OML. Click the Solve button, and Solver Foundation automatically interprets the OML, determines the
underlying type of optimization problem, calls the correct underlying solver, and returns the best
allocation, shown in the results:

22

2006-2010 Microsoft Corporation

The decision values are data bound to the right-hand portion of the worksheet. These values are used in
a pivot table and chart that provide additional insight:

23

2006-2010 Microsoft Corporation

Solver Foundation introduces a simulation framework that extends OML to handle stochastic models. In
this example, the customer demand is an imprecise estimate. Therefore it is more realistic to capture
this uncertainty directly in the model. This is easily done in OML using a random parameter.

24

2006-2010 Microsoft Corporation

The demand is modeled using a NormalDistribution parameter. A normal distribution is defined by its
mean and standard deviation. These values are different for each route, so this example uses data
binding to define the mean and standard deviation. The model can now be modified to use the random
parameter. Since the demand is random, it is necessary to have a fallback plan in case demand for a
route exceeds capacity. If a route is overbooked, it is possible to bump passengers and refund them
money. This is a recourse decision that is made once the actual passenger demand is known. Recourse
decisions are defined in the Output tab, similar to how the Allocation decision was defined earlier.

25

2006-2010 Microsoft Corporation

Click Solve to use sampling to simulate different values for the random parameters and solve the model,
finding the allocation that works best over the range of possible demands.

The average, minimum, and maximum values for the recourse decisions are shown in the log.

26

2006-2010 Microsoft Corporation

Click the Summary button to produce a solution report, which in this case includes additional
information particular to stochastic models, including information about how sampling was performed.
Solver Foundation chooses default values for sampling parameters, but these can be changed in the
Simulation area of the Solver Foundation ribbon. For example, the number of samples can be increased
to 200.

More information about sampling options and stochastic models can be found in the Simulation Primer.

27

2006-2010 Microsoft Corporation

Appendix 1: Directive Options


There are seven categories of Solvers with respective Directives available for advanced manipulation via
Directives - essentially a hint to point the solvers to use a specific set of attributes.

Unconstrained Nonlinear Programming. Compact Quasi Newton Directive


Constraint Satisfaction. Constraint Programming Directive
Interior Point Method. Interior Point Method Directive
Mixed Integer Programming. Mixed Integer Programming Directive
Nonlinear Programming. Hybrid Local Search Directive
Simplex. Simplex Directive
Stochastic. Stochastic Directive

CompactQuasiNewtonDirective

Int. IterationLimit: The maximum number of iterations.

Int. IterationsToRemember: Number of previous iterations to remember for estimate of Hessian


(default is 17).

Double. Tolerance: The solver tolerance.

ConstraintProgrammingDirective

ConstraintProgrammingAlgorithm. Algorithm: The algorithm to use:


o

Default. Use whatever algorithm the solver thinks is best.

TreeSearch. Use tree search.

LocalSearch. Use local search.

TreeSearchVariableSelection. VariableSelection: Heuristic for selecting decisions to branch on


o

Default. Use whatever heuristic the solver thinks is best

MinimalDomainFirst. Enumeration that chooses a variable with smallest domain

DeclarationOrder. Enumeration following the declaration order of the variables

DynamicWeighting. Weigh variables dynamically according to their dependents and current


domain sizes

ConflictDriven. Enumeration based on conflict analysis following a variant of the VSIDS


heuristic used in SAT solvers

ImpactPrediction. Enumeration based on a forecast of the impact

28

2006-2010 Microsoft Corporation

DomainOverWeightedDegree. Enumeration based on the "domain over weighted degree"

TreeSearchValueSelection. ValueSelection: Heuristic for selecting decision value to test first

Default. Use whatever heuristic the solver thinks is best

SuccessPrediction. Value enumeration based on a prediction of the success

ForwardOrder. Value enumeration that follows the order of the values

RandomOrder. Value enumeration that picks uniformly at random

LocalSearchMoveSelection. MoveSelection: Heuristic for selecting local search moves


o

Default. Use whatever heuristic the solver thinks is best

Greedy. Violation-guided greedy move

SimulatedAnnealing. Simulated annealing

GreedyNoise. Violation-guided greedy with noise

Tabu. Violation-guided greedy with noise and tabu

Gradients. Gradient-guided with tabu and escape strategy

Bool. RestartEnabled: Whether to enable the solver to restart from the beginning if it isn't making
progress

Int. PrecisionDecimals: Number of decimal digits of precision (0 to 4)

ReadOnlyCollection<Decision>. UserOrderVariables: A list of decisions to branch on first

HybridLocalSearchDirective

Int. PresolveLevel: Presolve level. -1 means automatic, 0 means no presolve.

Bool. RunUntilTimeout: whether to continue to search for improved solutions until aborted.

InteriorPointMethodDirective

Double. GapTolerance: The gap tolerance. If set to 0, the solver can choose

InteriorPointMethodAlgorithm. Algorithm: The algorithm

Default. Use whatever algorithm the solver thinks is best

PredictorCorrector. Use Predictor Corrector

HomogeneousSelfDual. Use Homogeneous Self Dual

Int. IterationLimit: Iteration count limit. If negative, no limit

29

2006-2010 Microsoft Corporation

MixedIntegerProgrammingDirective

Double. GapTolerance: Gets or sets the tolerance to declare an integer solution optimal

Bool. QuickFeasibility: Whether or not to focus on getting quick feasibility

Bool. CuttingPlaneGeneration: Enable/disable cutting plane

Bool. LocalSearch: Enable/disable local search in Mixed Integer Solvers

SimplexDirective

SimplexPricing. Pricing: The pricing strategy to use


o

Default. Use whatever pricing the solver thinks is best

SteepestEdge. Use steepest edge pricing

ReducedCost. Use reduced cost pricing

Partial. Use partial pricing

Int. IterationLimit: The limit on number of pivots. If negative, no limit

SimplexAlgorithm. Algorithm: The algorithm to use

Default. Use whatever algorithm the solver thinks is best

Primal. Use primal simplex

Dual. Use dual simplex

SimplexBasis. Basis: The basis to use


o

Default. Use whatever basis the solver thinks is best

Crash. Use crash basis

Slack. Use slack basis

Freedom. Use freedom basis

Bool. GetSensitivity: Whether to generate sensitivity information

bool. GetInfeasibility: Whether to generate infeasibility information

Double. PricingTolerance: Numerical tolerance for Simplex pricing

Double. VariableTolerance: Numerical tolerance for variables

30

2006-2010 Microsoft Corporation

StochasticDirective

Int. MaximumScenarioCountBeforeSampling: When there are more than


MaximumScenarioCountBeforeSampling scenarios, sampling will be used instead of enumeration.
Use -1 for automatic mode (Default)

DecompositionType. DecompositionType: Whether to use decomposition or the deterministic


equivalent.

Automatic. Let the solver decide whether to use decomposition.


o

Disabled. Do not use decomposition. Form the Deterministic Equivalent instead

Enabled. Use decomposition.

31

2006-2010 Microsoft Corporation

Appendix 2: Optimization Modeling Language (OML)


Solver Foundation includes an Optimization Modeling Language (OML) system, designed exclusively for
modeling and solving using the underlining Solver Foundation infrastructure. It is an algebraic modeling
language.
If you use the Automatic Editing Mode in the Modeling Pane, the comments may be removed from the
OML code. To work around this issue, use Annotation to add metadata to a parameter, decision,
constraint, or goal.
Please refer to the Solver Foundation OML Syntax Document for more information.

32

2006-2010 Microsoft Corporation

Appendix 2: OMLX File Format


This document defines an XML schema for extended OML model. The schema provides for information
suitable for editing, validating and solving the model with different data sources.
Root Element Model
Every OMLX file must contain single model. A Model root element contains the entire model. The
namespace for OMLX is
<Model xmlns:xsi="http://schemas.microsoft.com/SolverFoundation/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
...
</Model>

Name Element
Name element contains the name of the model.
<Name>Supply Chain Planning</Name>

ModelText Element
ModelText element contains the entire OML model text.
<ModelText>Model[
Parameters[
Sets, Products, Factories, Areas, Promotions
],
...
]</ModelText>

DataBindings Element
DataBindings element contains information for binding to different type of data sources. DataBindings
element can contains 0 to n BindingSourceInfo element. Each BindingSourceInfo element contains
information for setting up input and output data binding when solving a model.
<DataBindings>
<BindingSourceInfo>
<Name>XML</Name>
...
</BindingSourceInfo>
<BindingSourceInfo>
<Name>SQL</Name>
...

33

2006-2010 Microsoft Corporation

</BindingSourceInfo>
</DataBindings>

BindingSourceInfo Element
In BindingSourceInfo element there are two metadata elements:

Name element contains the name of the binding source. The name should be unique in
DataBindings collection.
Connection element contains the connection information for the data source. For SQL Server it
will be connection string; For XML file it will be the filename; For SharePointSite it will be the Url
to the site collections.

There are two sections for individual Parameter/Decision bindings:

ParameterBindings element contains input binding information for parameters in model.


ParameterBindings element can contain 0 to n InputBindingInfo each represent binding
information to a parameter.
DecisionBindings element contains output binding information for decisions in model.
DecisionBindings element can contain 0 to n OutputBindingInfo each represent binding
information to a decision.
<BindingSourceInfo>
<Name>SQL</Name>
<Connection>Data Source=(local);Initial
Catalog=SupplyChainPlanning;Integrated Security=SSPI;</Connection>
<ParameterBindings>
<InputBindingInfo>
<Name>manufactureLoads</Name>
<TableName>manufactureLoads</TableName>
<ValueField>ManufactureLoads</ValueField>
<IndexFields>Product</IndexFields>
</InputBindingInfo>
...
</ParameterBindings>
<DecisionBindings>
<OutputBindingInfo>
<Name>Plan</Name>
<TableName>Plan</TableName>
<ValueField>value</ValueField>
<IndexFields>Products,Areas,Promotions,Factories</IndexFields>
</OutputBindingInfo>

34

2006-2010 Microsoft Corporation

...
</DecisionBindings>
</BindingSourceInfo>

InputBindingInfo Element
InputBidingInfo contains binding information to a parameter:

Name element contains name of the parameter in model.


TableName element contains name of the table data container from data source.
ValueField element contains name of the value field in table.
IndexFields element contains names of index fields separated by commons.
<InputBindingInfo>
<Name>manufactureLoads</Name>
<TableName>manufactureLoads</TableName>
<ValueField>ManufactureLoads</ValueField>
<IndexFields>Product</IndexFields>
</InputBindingInfo>

To define a binding for UniformDistributionParameter following elements can be used:

Name element contains name of the uniform distribution parameter.


TableName element contains name of the table data container from data source.
LowerBoundField element contains field name for lower bound field.
UpperBoundField element contains field name for upper bound field.
IndexFields element contains names of index fields separated by commons.
<InputBindingInfo>
<Name>gasDemand</Name>
<TableName>gasDemand</TableName>
<LowerBoundField>LowerBound</LowerBoundField>
<UpperBoundField>UpperBound</UpperBoundField>
<IndexFields>country</IndexFields>
</InputBindingInfo>

To define a binding for NormalDistributionParameter following elements can be used:

Name element contains name of the uniform distribution parameter.


TableName element contains name of the table data container from data source.
MeanField element contains field name for field contains mean value.
VarianceField element contains field name for field contains variance value.

35

2006-2010 Microsoft Corporation

IndexFields element contains names of index fields separated by commons.


<InputBindingInfo>
<Name>gasDemand</Name>
<TableName>gasDemand</TableName>
<MeanField>LowerBound</MeanField>
<VarianceField>UpperBound</VarianceField>
<IndexFields>country</IndexFields>
</InputBindingInfo>

OutputBindingInfo Element
OutputBindingInfo contains information for single decision binding:

Name element contains name of the decision in model.


TableName element contains name of the table data container which output data will write it
to.
ValueField element contains name of the value field in table.
IndexFields element contains names of index fields separated by commons.
<OutputBindingInfo>
<Name>TotalCost</Name>
<TableName>TotalCost</TableName>
<ValueField>Cost</ValueField>
<IndexFields>Products,Areas</IndexFields>
</OutputBindingInfo>

Directives Element
Directives element contains all directives will be used to solve the model. Directives element contains 0
to n directives. Each directive represent an instance can be created by SFS. There should be only one
instance per type can exist in directives collection.
Here is an example of Directives element:
<Directives>
<DirectiveInfo>
<TypeName>SimplexDirective</TypeName>
<Enabled>true</Enabled>
<Properties>
<DirectivePropertyInfo>
<Name>Algorithm</Name>
<Value xsi:type="xsd:int">2</Value>
</DirectivePropertyInfo>

36

2006-2010 Microsoft Corporation

<DirectivePropertyInfo>
<Name>Arithmetic</Name>
<Value xsi:type="xsd:int">2</Value>
</DirectivePropertyInfo>
<DirectivePropertyInfo>
<Name>Basis</Name>
<Value xsi:type="xsd:int">1</Value>
</DirectivePropertyInfo>
<DirectivePropertyInfo>
<Name>GetSensitivity</Name>
<Value xsi:type="xsd:boolean">true</Value>
</DirectivePropertyInfo>
<DirectivePropertyInfo>
<Name>IterationLimit</Name>
<Value xsi:type="xsd:int">200</Value>
</DirectivePropertyInfo>
<DirectivePropertyInfo>
<Name>MaximumGoalCount</Name>
<Value xsi:type="xsd:int">20</Value>
</DirectivePropertyInfo>
<DirectivePropertyInfo>
<Name>TimeLimit</Name>
<Value xsi:type="xsd:int">2000</Value>
</DirectivePropertyInfo>
</Properties>
</DirectiveInfo>
</Directives>

DirectiveInfo Element
DirectiveInfo element contains all information for a SFS directive object. DirectiveInfo element contains
following elements:

TypeName element contains the type name of SFS directive object.


Enabled element identify if the directive should be used or not.
Properties element contains property values for the SFS directive object.

DirectivePropertyInfo Element
DirectivePropertyInfo contains name value pair for each directive object property. DirectivePropertyInfo
element contains following elements:

37

2006-2010 Microsoft Corporation

Name element contains the name of the property.


Value element contains the value of the property.

38

2006-2010 Microsoft Corporation

Anda mungkin juga menyukai