Computational Management Science Бизнес, управление и учёт (прочее)
Embedded domain-specific language for multistage stochastic programming in Scala
Аннотация
We present amphip , an embedded domain-specific language (EDSL) in Scala with a syntax similar to GNU MathProg, that enables the modeling of scenario-based multistage stochastic programming problems. The proposed EDSL provides a concise and expressive way to define models using the separate scenarios formulation while avoiding redundancy in the specification of stochastic parameters. It introduces a novel approach to scenario tree construction, allowing stepwise refinement through built-in primitives that support arbitrary tree structures and the specification of stochastic parameter values at varying levels of detail. Being embedded in Scala, the EDSL seamlessly integrates with applications written in the host language, leveraging existing libraries and programming techniques to enhance expressiveness and maintainability. Scala’s interoperability with the JVM, JavaScript, and native platforms opens possibilities for deploying stochastic programming models across a wide range of computational environments and application domains. By leveraging the abstraction capabilities of Scala, extensions to the EDSL can be developed using Scala standard functions, for example, to construct scenario trees with specific structures or to specify probabilities and parameter data following particular patterns without repetitive code. The EDSL follows a declarative paradigm for model specification, similar to MathProg, making stochastic models more readable, maintainable, and less error-prone.