This repository implements a stochastic optimization problem using the Stochastic Programs with Recourse formulation. The goal is to analyze and solve the problem under different demand variances using various models.
.
├── data_generator.py # Script to generate demand data
├── deterministic-demands # Deterministic model and results
│ ├── deterministic-demands.dat
│ ├── deterministic-demands.mod
│ └── results.txt
├── README.md # Project documentation
└── stochastic-demands # Stochastic models, data, and results
├── data # Demand datasets with different variances
│ ├── high-var-demands.dat
│ ├── low-var-demands.dat
│ └── stochastic-demands.dat
├── models # OPL models for different approaches
│ ├── deterministic-equivalent.mod
│ ├── expected-value-problem.mod
│ └── wait-and-see.mod
└── results # Result files for each scenario and model
├── stochastic-demands-deterministic-equivalent-results.txt
├── ...
└── stochastic-demands-wait-and-see-results.txt
- Provides the PDE (Primal Deterministic Equivalent) formulation of the stochastic problem.
- Incorporates all demand scenarios into a single model.
- Calculates the Wait-and-See (W&S) solution.
- Evaluates the objective function in each scenario assuming perfect foresight of demand.
Approximation by Estimated Values
The optimal solution of the Expected Value Problem (EVP) assumes that the uncertain parameters take their average values. This result represents the objective function value when using this solution.
Expectation of Expected Value (EEV)
To evaluate the quality of the solution from the EVP, the expected objective value is calculated by considering all possible scenarios of the uncertain parameters while keeping the same solution.
The models are tested under three demand scenarios with varying levels of uncertainty:
- Low Variance Demand (
low-var-demands.dat) - High Variance Demand (
high-var-demands.dat) - Base Stochastic Demand (
stochastic-demands.dat)
All models generate their results in the stochastic-demands/results/ folder with descriptive filenames:
- Deterministic Equivalent Results:
*-deterministic-equivalent-results.txt - Expected Value Problem Results:
*-EEV-results.txt - Wait-and-See Results:
*-wait-and-see-results.txt
-
Generate Data (if needed):
python data_generator.py
-
Solve Models in IBM ILOG CPLEX Optimization Studio:
- Open the desired model (
.mod) and corresponding data (.dat). - Run the model to generate results in the
results/folder.
- Open the desired model (
- Deterministic Equivalent Solution (PDE): Optimal solution that incorporates all possible scenarios of uncertainty into a single model.
- Wait-and-See (W&S): Solution obtained with perfect knowledge of future demand, representing the best possible outcome.
- Expected Value (EV): Solution derived by solving the problem using the average demand values.
- Estimation of Expected Value (EEV): Expected performance of the EV solution across all scenarios.
- IBM ILOG CPLEX Optimization Studio (for running
.modmodels) - Python 3.x (for
data_generator.py)
- Clone the repository:
git clone https://github.com/BlcMed/site-allocation-solver.git cd site-allocation-solver/
Refer to the Wiki for detailed theory and mathematical modeling.
This project is licensed under the MIT License - see the LICENSE file for details.