SAMPL

{{Infobox programming language

| name = SAMPL

| logo =

| caption =

| year = {{Start date and age|2001}}

| designer = Gautam Mitra, Enza Messina, Valente Patrick

| paradigm = multi-paradigm: declarative, imperative

| developer =

| latest_release_version = 20120523

| latest_release_date = {{Start date and age|2013|05|23}}

| latest_test_version =

| latest_test_date =

| turing-complete =

| typing =

| implementations =

| dialects =

| influenced_by = AMPL

| influenced =

| operating_system = Cross-platform (multi-platform)

| license = Proprietary | genre = Algebraic Modeling Language (AML)

| website = {{URL|www.optirisk-systems.com}}

| file_ext = .mod .dat .run .sampl

}}

SAMPL, which stands for "Stochastic AMPL", is an algebraic modeling language resulting by expanding the well-known language AMPL with extended syntax and keywords. It is designed specifically for representing stochastic programming problems

{{cite journal | author=Christian Valente, Gautam Mitra, Mustapha Sadki and Robert Fourer| title=Extending algebraic modelling languages for stochastic programming| journal=INFORMS Journal on Computing| year=2009| volume=21| issue=1| pages=107–122| url=http://joc.journal.informs.org/content/21/1/107.abstract| doi=10.1287/ijoc.1080.0282}}

and, through recent extensions, problems with chance constraints, integrated chance constraints and robust optimization problems.

It can generate the deterministic equivalent version of the instances, using all the solvers AMPL connects to,{{Cite web|url=http://www.ampl.com/solvers.html|title = Solvers}} or generate an SMPS representation and use specialized decomposition based solvers, like FortSP.

Language Features

SAMPL shares all language features with AMPL, and adds some constructs specifically designed for expressing scenario based stochastic programming and robust optimization.

= Stochastic programming features and constructs =

To express scenario-based SP problems, additional constructs describe the tree structure and group the decision variable into stages. Moreover, it is possible to specify which parameter stores the probabilities for each branch of the tree and which set represents the scenario set. Other constructs to easily define chance constraints and integrated chance constraint in an SP problem are available as well.

Using these language constructs allows to retain the structure of the problem, hence making it available to the solvers, which might exploit it using specialized decomposition methods like Benders' decomposition to speed-up the solution.

= Robust optimization constructs =

SAMPL supports constructs to describe three types of robust optimization formulations:

  • Soyster{{cite journal | author=Allen L Soyster| title=Technical Note—Convex Programming with Set-Inclusive Constraints and Applications to Inexact Linear Programming| journal=Operations Research| year=1974| volume=21| issue=5| pages=1154–1157| doi=10.1287/opre.21.5.1154| doi-access=free}}
  • Bertsimas and Sim{{cite journal|last=Bertsimas|first=Dimitris|author2=Sim, Melvyn |title=The Price of Robustness|journal=Operations Research|year=2004|volume=52|issue=1|pages=35–53|doi=10.1287/opre.1030.0065|hdl=2268/253225|s2cid=8946639 |url=https://orbi.uliege.be/handle/2268/253225}}
  • Ben-Tal and Nemirovski{{cite journal |author1=Aharon Ben-Tal |author2=Arkadi Nemirovski |name-list-style=amp | title=Robust convex optimization| journal=Mathematics of Operations Research| year=1998| volume=23| issue=4| pages=769–805| doi=10.1287/moor.23.4.769|citeseerx=10.1.1.135.798 }}

Availability

SAMPL is currently available as a part of the software AMPLDev (distributed by [http://www.optirisk-systems.com www.optirisk-systems.com]). It supports many popular 32- and 64-bit platforms including Windows, Linux and Mac OS X. A free evaluation version with limited functionality is available.{{cite web |url=http://optirisk-systems.com/products_ampldevSP.asp |title=Products: AMPLDev SP |website=optirisk-systems.com |url-status=dead |archive-url=https://web.archive.org/web/20121111110910/http://www.optirisk-systems.com/products_ampldevSP.asp |archive-date=2012-11-11}}

A stochastic programming sample model

The following is the SAMPL version of a simple problem (Dakota{{cite journal| author=Higle, Julia L, Wallace, Stein W| title=Sensitivity analysis and uncertainty in linear programming| journal=Interfaces| year=2003| volume=33| number=4| pages=53–60| doi=10.1287/inte.33.4.53.16370| url=https://eprints.lancs.ac.uk/id/eprint/45390/1/INTERFACES_Julie.pdf}}), to show the SP related constructs. It does not include the data file, which follows the normal AMPL syntax (see the example provided in the AMPL Wikipedia page for further reference).

{{codett|lang=ampl|set Prod;}}

{{codett|lang=ampl|set Resource;}}

{{codett|lang=ampl|# Scenarios (future possible realizations)}}

scenarioset Scen;

{{codett|lang=ampl|# Definition of the problem as a two-stage problem}}

tree Tree := twostage;

{{codett|lang=ampl|# Demand for each product in each scenario}}

random param Demand{Prod, Scen};

{{codett|lang=ampl|# Probability of each scenario}}

probability P{Scen};

{{codett|lang=ampl|# Cost of each unit of resource}}

{{codett|lang=ampl|param Cost{Resource};}}

{{codett|lang=ampl|# Requirement in terms of resources units to produce one unit of each product}}

{{codett|lang=ampl|param ProdReq{Resource,Prod};}}

{{codett|lang=ampl|# Selling price of each product}}

{{codett|lang=ampl|param Price{Prod};}}

{{codett|lang=ampl|# Initial budget}}

{{codett|lang=ampl|param Budget;}}

{{codett|lang=ampl|# Amount of resources to buy}}

{{codett|lang=ampl|code=var buy{r in Resource} >= 0,}} suffix stage 1;

{{codett|lang=ampl|# Amount of each product to produce}}

{{codett|lang=ampl|code=var amountprod{p in Prod, s in Scen} >= 0,}} suffix stage 2;

{{codett|lang=ampl|# Amount of each product to sell}}

{{codett|lang=ampl|code=var amountsell{p in Prod, s in Scen} >= 0,}} suffix stage 2;

{{codett|lang=ampl|# Total final wealth, as expected total income from sales minus costs for the resources}}

{{codett|lang=ampl|maximize wealth: sum{s in Scen} P[s] * }}

{{codett|lang=ampl|(sum{p in Prod} Price[p] * amountsell[p,s] - sum{r in Resource} Cost[r] * buy[r]);}}

{{codett|lang=ampl|subject to }}

{{codett|lang=ampl|# Make sure you have enough resources to produce what we intend to}}

{{codett|lang=ampl|balance{r in Resource, s in Scen}: }}

{{codett|lang=ampl|code=buy[r] >= sum{p in Prod} ProdReq[r,p] * amountprod[p, s];}}

{{codett|lang=ampl|# Make sure we do not sell what we did not produce}}

{{codett|lang=ampl|code=production{p in Prod, s in Scen}: amountsell[p,s] <= amountprod[p,s];}}

{{codett|lang=ampl|# Make sure we do not sell more than the market demand}}

{{codett|lang=ampl|code=sales{p in Prod, s in Scen}: amountsell[p,s] <= Demand[p,s];}}

{{codett|lang=ampl|# Respect initial budget}}

{{codett|lang=ampl|code=budgetres: sum{r in Resource} Cost[r] * buy[r] <= Budget;}}

Solvers connectivity

SAMPL instance level format for SP problems is SMPS, and therefore the problem can be solved by any solver which supports that standard. One of such solvers (FortSP) is included in the standard SAMPL distribution. Regarding robust optimization problems, the needed solver depend on the specific formulation used, as Ben-Tal and Nemirovski formulation need a second-order cone capable solver.

See also

References

{{reflist|30em}}