Giter Club home page Giter Club logo

msppy's Introduction

MSPPy

Installation

python setup.py install

Quick start examples

Some tiny-scale problems can be found in the quick_start folder. The purpose of these examples are getting you familiar with the package. None of them are realistic and useful. Summary of the examples:
a_simple_MIP.py: stage-wise independent finite discrete MSIP.
absoulte.py: stage-wise independent finite discrete MSLP.
air_conditioners.py: stage-wise independent finite discrete MSLP.
news_vendor.py: Markov chain MSLP.
portfolio_optimization.py: Markovian MSLP.
selling_tickets.py: stage-wise independent finite discrete MSIP.
semiconductor.py: Markov chain MSLP.

Examples

Three real-world large-scale examples--power system planning, portfolio optimization, airline revenue management, can be found in the examples folder. For more details, users are referred to the paper linked below.

Documentations

https://msppy.readthedocs.io/en/latest/

Support

Python 3+, Gurobi 7+, Linux/MacOS. Support for Windows is not currently supported.

Citing MSPPy

If you use MSPPy in general in a publication, please cite this paper; If you use Periodical SDDP, please also cite this paper;

msppy's People

Contributors

lingquant avatar odow avatar starrycheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

msppy's Issues

Pickle PyCapsule Error

Hi, when trying to run any of the provided examples, I get error messages regarding the "pickling" of an EvaluationTrue object such as :
Exception has occurred: TypeError
cannot pickle 'PyCapsule' object
File ".\msppy\quick_start\a_simple_MIP.py", line 47, in
resultTrue.run(n_simulations=100)

Is there something to resolve this?

Thanks and best regards
Joern

System: Windows 10, Python 3.10.5

Periodical SDDP

As shown here, https://doi.org/10.1002/net.21932, a better way to do Periodical SDDP is to terminate the forward trial passes with the probability of 1 - the discount factor.

If you use a fixed number of stages for the forward pass, you will converge to a sub-optimal solution. This is particularly true if your initial x is far from the periodical optimum.

You can also use the probabilistically terminated forward passes as an upper bound.

SDDiP and other experiences

I have a few queries regarding your implementation ๐Ÿ˜„

  • Did you ever try any other methods apart from the level set for solving the SDDiP Lagrangian?
  • Follow up: Do you ever notice bad numerics with SDDiP? i.e., cuts with very steep coefficients
  • I see you implemented:

    msppy/msppy/msp.py

    Lines 782 to 787 in c708569

    if var.X < var.lb:
    solution[idx] = var.lb
    elif var.X > var.ub:
    solution[idx] = var.ub
    else:
    solution[idx] = var.X
    Did you implement any other tricks to improve numerics (SDDiP or otherwise)?
  • I hadn't thought of adding a regularizer in the constraint:

    msppy/msppy/sp.py

    Lines 1386 to 1398 in 6e1d1de

    self.rgl_constr = [self._model.addQConstr(
    self.rgl -
    a*gurobipy.QuadExpr(
    gurobipy.quicksum([
    self.states[i] * self.states[i]
    - self.states[i] * 2 * center[i]
    + center[i] * center[i]
    for i in range(self.n_states)
    ])
    )
    >=0,
    name = 'rgl'
    )]

    Did you do any benchmarking to see if it helps?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.