Optimization model examples ready for use with MOS.
Examples are arranged by modeling system (e.g. CVXPY, JuMP). Associated with each example are two file types, *model.* and *api.*, along with any data files associated with the example.
Examples from:
- Finance: portfolio allocation
- Machine learning: lasso regression
- Logistics: transportation, facility location
- Aerospace: satellite scheduling
- Energy: AC optimal power flow, DC optimal power flow, gas trade, unit commitment
- Climate policy: Dice model
- Macroeconomics: computable general equilibrium
- Resource allocation: knapsack problem
- Games: sudoku
- Biotechnology: codon design
Use with MOS Frontend
The *model.* example may be uploaded to MOS Frontend directly, ready to be provided with mos-examples data or user data, and solved.
Steps to use with the MOS Python Interface package or Julia Interface package:
- Installation of an MOS Interface package
- Adjustment of an
*api.*file to include URL and authentication token - Alternatively, setting of local environment variables will allow use of an
*api.*file directly - The key environment variable to set is:
MOS_BACKEND_TOKEN. If hosting MOS locally, the environment variablesMOS_BACKEND_HOST,MOS_BACKEND_PORT, are also required to be set. - If the environment variables are set in a file named
.envat the root of the repository, the api examples will automatically load them.
The model may then be specified, adjusted, and solved through the *api.* file, from the repository root, to the user's interest.
Contributions of new and improved models are very welcome.
- Fork the Project
- Create your Branch (
git checkout -b NewModel) - Commit your Changes (
git commit -m 'New Model') - Push to the Branch (
git push origin NewModel) - Open a Pull Request
Distributed under the BSD-3-Clause License. See LICENSE for more information.