Coder Social home page Coder Social logo

sallen7 / io_gnep Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 4.9 MB

Code for a project working on inverse optimization applied to generalized nash equilibrium problems (GNEPs)

License: BSD 3-Clause "New" or "Revised" License

Python 79.29% Shell 7.43% GAMS 10.30% MATLAB 2.98%

io_gnep's Introduction

Using Inverse Optimization to Learn Cost Functions in Generalized Nash Games

README

This code repository is broken down into files that require the following programs:

  • MATLAB
  • PYTHON
  • GAMS

It also assumes that we are running on a Ubuntu/Linux operating system.

The IO_GNEP_* shell scripts will run different collections of the other scripts housed in this repository. The bash scripts correspond to the four experimental groups discussed in the paper. The Python classes called by the Python scripts are:

  • RK_IO_methods which is housed in the RK_IO_model.py file. This class contains the inverse optimization residual model for the paper for both the same costs across all players and different costs across players
  • generalized_RK_framework which is housed in the Generalized_RK_Framework.py file This class contains the mechanics methods for translating between Python and the various other programs. It also runs the RK_IO_methods, calculates total flow error, and saves all of the data.

Note: We have three class objects called class_object_1 through 3 that are created with the various scripts that call methods from these classes. They transfer data between the different Python scripts.


The Python scripts are named in terms of steps, so script_1_generating_data_for_matlab.py indicates the first step. However, there are MATLAB and GAMS calls that happen between the various Python scripts. For a general experiment, this is the sequence of calls and their outputs in the bash scripts:

  1. python script_1_generating_data_for_matlab.py [with potentially arguments] OR python script_1_generating_data_for_matlab_sioux_falls.py OUTPUT: Pickle object (class_object_1) and MATLAB data file (data_for_matlab_original_costs.mat)

  2. matlab script call to either matlab_generating_data_original_costs.m or matlab_generating_data_original_costs_different_costs.m OUTPUT: GDX files traffic_data_gdx_iteration_1.gdx through 10

  3. gams script call 10 times for 10 trials, either to the gams_original_costs_file.gms or gams_original_costs_file_different_costs.gms OUTPUT: CSV files traffic_results_original_costs_1.csv through 10

  4. python script call to either script_2_inverse_optimization_step.py or script_2_inverse_optimization_step_different_costs.py OUTPUT: Pickle object (class_object_2)

  5. matlab script call to either matlab_generating_data_IO_costs.m or matlab_generating_data_IO_costs_different_costs.m OUTPUT: GDX files IO_traffic_data_gdx_iteration1.gdx through 10

  6. gams script call 10 times for 10 trials, either to the gams_IO_costs_file.gms or gams_IO_costs_file_different_costs.gms OUTPUT: CSV files IO_traffic_results_1.csv through 10

  7. python script call to script_3_calculating_flow_error_and_boxplots.py OUTPUT: Named CSV file of the data collected over the course of the experiment and Pickle object (class_object_3)


Note that the data from the experiments we ran can be found in the csv_data_files_from_experiments folder. The scripts in that folder will also produce the boxplots for the 4 experimental groupings we describe in the paper. We do use this opportunity to tell the reader that the data for data_saving_experiment_different_costs_5x5_Grid_num_players_10_alpha_5.csv was inputted by hand due to problems with that experiment (as discussed in the paper)

ALSO: The csv data files in this folder (along with the .mat and .gdx data files) relate to the following run: Sioux Falls, number of players N=10, and alpha=10. If a user would like to run experiments with the Sioux Falls network, they will need to download the SiouxFall_flow.tntp file separately from the https://github.com/bstabler/TransportationNetworks repository.

See 1_PACKAGES.txt for the Packages utilized by the two machines we utilized.


Major References

Ratliff, Lillian J., et al. "Social game for building energy efficiency: Incentive design." 2014 52nd Annual Allerton Conference on Communication, Control, and Computing (Allerton). IEEE, 2014.

Konstantakopoulos, Ioannis C., et al. "A robust utility learning framework via inverse optimization." IEEE Transactions on Control Systems Technology 26.3 (2017): 954-970.

Transportation Networks for Research Core Team. Transportation Networks for Research. https://github.com/bstabler/TransportationNetworks. Accessed 2020.

io_gnep's People

Contributors

sallen7 avatar

Stargazers

Josephbkt avatar TzuRen avatar John P. Dickerson avatar

Watchers

James Cloos avatar  avatar

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.