Giter Club home page Giter Club logo

rhodium's Introduction

Rhodium

Tests PyPI PyPI

Rhodium is an open source Python library for robust decision making (RDM) and multiobjective robust decision making (MORDM), and exploratory modelling (EM).

Citation

Please cite the following paper (PDF) if using this project in your own works:

Hadjimichael A, et al. 2020 Rhodium: Python Library for Many-Objective Robust Decision Making and Exploratory Modeling. Journal of Open Research Software, 8: 12. DOI: https://doi.org/10.5334/jors.293

Installation

To install the latest Rhodium release, run the following command:

pip install rhodium

To install the latest development version of Rhodium, run the following commands:

pip install -U build setuptools
git clone https://github.com/Project-Platypus/Rhodium.git
cd Rhodium
python -m build
python -m pip install --editable .

Rhodium has several optional dependencies that enable additional graphical and analytical capabilities.

  1. GraphViz - Required for CART figures (Cart#show_tree)
  2. pip install pywin32 - Required to connect to Excel models (ExcelModel)
  3. pip install openmdao - Required to connect to OpenMDAO models (OpenMDAOModel)
  4. pip install pyper - Required to connect to R models (RModel)
  5. pip install images2gif - Required to produce 3D animated GIFs (animate3d)
  6. J3Py - Interactive 3D visualizations

Resources

About

What is Robust Decision Making?

Robust Decision Making (RDM) is an analytic framework developed by Robert Lempert and his collaborators at RAND Corporation that helps identify potential robust strategies for a particular problem, characterize the vulnerabilities of such strategies, and evaluate trade-offs among them [2]. Multiobjective Robust Decision Making (MORDM) is an extension of RDM to account for problems with multiple competing performance objectives, enabling the exploration of performance tradeoffs with respect to robustness [3, 4].

What is Rhodium?

Rhodium is an open source Python library providing methods for RDM and MORDM. It follows a declarative design, where you tell Rhodium the actions or analyses you wish to perform and it determines the necessary calculations. Rhodium can interface with models written in a variety of languages, including Python, C and Fortran, R, and Excel. One begins by creating a Rhodium model:

from rhodium import *

def lake_problem(pollution_limit,
         b = 0.42,        # decay rate for P in lake (0.42 = irreversible)
         q = 2.0,         # recycling exponent
         mean = 0.02,     # mean of natural inflows
         stdev = 0.001,   # standard deviation of natural inflows
         alpha = 0.4,     # utility from pollution
         delta = 0.98,    # future utility discount rate
         nsamples = 100): # monte carlo sampling of natural inflows
    # add body of function
    return (max_P, utility, inertia, reliability)


model = Model(lake_problem)

model.parameters = [Parameter("pollution_limit"),
                    Parameter("b"),
                    Parameter("q"),
                    Parameter("mean"),
                    Parameter("stdev"),
                    Parameter("delta")]

model.responses = [Response("max_P", Response.MINIMIZE),
                   Response("utility", Response.MAXIMIZE),
                   Response("inertia", Response.MAXIMIZE),
                   Response("reliability", Response.MAXIMIZE)]

model.constraints = [Constraint("reliability >= 0.95")]

model.levers = [RealLever("pollution_limit", 0.0, 0.1, length=100)]

model.uncertainties = [UniformUncertainty("b", 0.1, 0.45),
                       UniformUncertainty("q", 2.0, 4.5),
                       UniformUncertainty("mean", 0.01, 0.05),
                       UniformUncertainty("stdev", 0.001, 0.005),
                       UniformUncertainty("delta", 0.93, 0.99)]

A Rhodium model consists of 6 parts:

  1. The underlying model (in this case, the Python function lake_problem).

  2. model.parameters - the parameters of interest.

  3. model.responses - the model responses or outputs.

  4. model.constraints - any hard constraints that must be satisfied.

  5. model.levers - parameters that we have direct control over.

  6. model.uncertainties - parameters that represent exogeneous uncertainties.

Once the Rhodium model is defined, you can then perform any analysis. For example, if we want to optimize the model and display the Pareto front:

output = optimize(model, "NSGAII", 10000)
scatter3d(model, output)
plt.show()

Check out the examples folder to see Rhodium in action!

Publishing

To publish a new version to PyPI, use:

python3 -m build
python3 -m pip install --upgrade twine

# The following command publishes the build.  Add `--repository testpypi` for testnig.
# Use `__token__` for the username and the PyPI token to authenticate.
python3 -m twine upload dist/*

References

  1. Rhodium logo by Tyler Glaude, Creative Commons License, https://thenounproject.com/term/knight/30912/
  2. Lempert, R. J., D. G. Groves, S. W. Popper, and S. C. Bankes (2006). A General, Analytic Method for Generating Robust Strategies and Narrative Scenarios. Management Science, 52(4):514-528.
  3. Kasprzyk, J. R., S. Nataraj, P. M. Reed, and R. J. Lempert (2013). Many objective robust decision making for complex environmental systems undergoing change. Environmental Modelling & Software, 42:55-71.
  4. Hadka, D., Herman, J., Reed, P.M., Keller, K. An Open Source Framework for Many-Objective Robust Decision Making. Environmental Modelling & Software, 74:114-129, 2015. DOI:10.1016/j.envsoft.2015.07.014. (View Online)
  5. Hadjimichael A, et al. 2020 Rhodium: Python Library for Many-Objective Robust Decision Making and Exploratory Modeling. Journal of Open Research Software, 8: 12. DOI: https://doi.org/10.5334/jors.293

rhodium's People

Contributors

davidanthoff avatar davidfgold avatar dependabot[bot] avatar dhadka avatar ostenst avatar saschaishikawa 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  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  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

rhodium's Issues

Adding levers causes type error

Is there a design reason I can't iteratively build model.levers and model.responses like the regular parameters list, i.e. model.parameters += Parameter("nsamples")

TypeError: can only add <type 'type'> objects

Specific dependencies

I have been helping a student run the Eijgenraam example and built a conda environment to install required packages. It's available at https://github.com/jdossgollin/conda-envs/blob/master/environments/rhodium.yml.

First I tried running python 3.6, but ran into an issue with the comb function in scipy, which has moved from scipy.misc to scipy.special. If there are specific versions of scipy needed, that should be reflected in requirements.txt and setup.py. Now I can get anything running, but can't plot anything because I get an AttributeError: module 'matplotlib.colors' has no attribute 'to_rgba'. This seems to be another version issue.

It would be really helpful for me to develop the above conda environment so that it "just works" can be used for teaching.

Some questions on the reference materials.

Dear David Hadka,

Hello !
I try to reach to you through e-mail from research paper.
But i could not reach you so I write this article here.

Now I am using some component of your Rhodium and MORDM.
Therefore, I am studying on some theoretical stuffs and trying to figure out how to apply your tools in my model HSPF.
I think I can apply your tool If I am extracting some data from my model.
But I want to apply those tools directly in your open source based tools.
And I found some of your research papers. But I could not find some referenced file for your paper.
If you have one, could you share it with me?
The name of paper is as belows.

Ward, V., Hadka, D.M., Reed, P.M., 2015. Confronting Decision Cliffs: Diagnostic
Assessment of Multi-objective Evolutionary Algorithm Performance for
Addressing Uncertain Environmental Thresholds. Accepted to Environmental
Modelling & Software. 10.1016/j.envsoft.2015.07.020.

And Actually I found some other research paper on those topic.
Do you think is this same research material?
Could you confirm it? And the name of the research paper that I had found is as belows.

Ward, V. L., Singh, R., Reed, P. M., & Keller, K. (2015). Confronting tipping points: Can multi-objective evolutionary algorithms discover pollution control tradeoffs given environmental thresholds?. Environmental Modelling & Software, 73, 27-43.

Thank you for reading my simple question.

Ji-Heon Lee
E-mail : [email protected]/
[email protected]

typo in readme

return (max_P, utility, intertia, reliability). -> inertia

Issue using Jupyter Notebook with New Conda Environment

When using Jupyter Notebooks in a new Conda Environment (as to ensure I have Python 3.5), it defaults to using the system's Python version instead of the Conda environment. Thus, when trying to use Rhodium et al., the Jupyter Notebook examples aren't using the correct Python version (and its associated libraries).

If I install Jupyter Notebook in this new Conda Environment, it solves the issue of launching the correct Python version when opening a Jupyter Notebook within this Conda Environment.

Robust Optimization with Rhodium

Dear David Hadka, Dear Team,

I would like to use the robust_optimize function for my MORDM in rhodium. Unfortunately, I can't find any documentation for it. Is there another possibility than to use the mean setting for the obj_aggregate. If so, which one?

Thanks in advance!

Cannot import name 'Real' from platypus

Hello,

I am running python v 3.11, Rhodium v 1.2.0, and platypus v 1.1.0. I have installed platypus with platypus-opt.

In the rhodium DPS example, from rhodium import * returns a traceback to from .model import * and ImportError: cannot import name Real from platypus.

Do you have any suggestions for this error? I am wondering if I should modify the .model file to by changing from platypus import Real to from platypus.types import Real.

Thanks so much.

Suggested images2gif not available

Cannot import Wrappers from Platypus

Hello,

I am running python v 3.11, Rhodium v 1.2.0, and platypus v 1.1.0. I have installed platypus with platypus-opt.

In the Rhodium Lake problem example using Borg, the line from platypus import wrappers is not running successfully. Because of this, output = optimize(model, "BorgMOEA", 20000, module="platypus.wrappers", epsilons=[0.01, 0.01, 0.0001, 0.0001]) returns an import error, where wrappers cannot be imported from Platypus.

Do you have any suggestions on this?

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.