#############SOME EXPLANATION#############
The setup can be done as follows. Feel free to skip sections if needed.
-
Python Setup
- Python Installation To begin, you need to have Python installed on your Windows system. Follow these steps:
- Download Python
-
Visit the official Python website: https://www.python.org/downloads/
-
Download the latest version of Python for Windows.
2. **Install Python**
- Run the installer and make sure to check the box "Add Python to PATH" during the installation process.
- Complete the installation by following the on-screen instructions.
3. **Verify Python Installation**
-
Open the Command Prompt (
cmd) and verify the installation by running:python --version
-
You should see the Python version printed in the terminal, indicating a successful installation.
- Create a Virtual Environment
It’s recommended to create a virtual environment to manage your project dependencies separately.
Open the Command Prompt and navigate to your project folder:
cd path\to\your\project
Run the following command to create a virtual environment:
```bash
python -m venv venv
```
- Activate the Virtual Environment After creating the virtual environment, activate it by running:
venv\Scripts\activate- Requirement.txt
```bash
pip install -r requirements.txt
```
-
Please refer to the following links https://www.youtube.com/watch?v=z7t0p5J9YcQ
Give the input file in following format shown in the picture below (only shown top 3 rows)
You need to give the either of two input arguement True or False to file linear_optimizer_controller.py for stablitiy default is considered to be false
K=5000
U1,224,318,162,2500
U2,224,318,162,2500
U3,244,318,244,2800
U4,244,318,244,2800
U5,244,318,285,3500
U6,244,318,285,3500
P-1,99,53,55,61,Economy,176
P-2,56,99,81,53,Priority,-
P-3,42,101,51,17,Priority,-
P-4,108,75,56,73,Economy,138
P-5,88,58,64,93,Economy,139For Stablity=True
python3 linear_optimizer_controller.py TrueFor Stablity=False
python3 linear_optimizer_controller.py False-
sudo apt update sudo apt install python3 python-virtualenv
sudo dnf update sudo dnf install python3 python3-virtualenv
sudo pacman -Syu sudo pacman -S python3 python3-virtualenv
You can check if the python install properly by typing the folling command
python3 --version
-
Locate to the folder where source folder is located
virtualenv venv source venv/bin/activate-
Locate to the folder where source code is their
pip install -r requirement.txt
-
Locate to the folder where source code is their
-
NOTE :- Download the version 11.0.2 and place the file in which gurobi is installed You can also follow the youtube video by offical youtube channel of gurobi https://youtu.be/OYuOKXPJ5PI?si=hiixS1Pi_mqVBulR
- Register yourself at https://www.gurobi.com/ with your institute mail ID.
- Once logged in, click on Downloads and Licenses at the top. Under Download the Latest Version of Gurobi, click on Gurobi Optimizer.
- Scroll down to Current Version and download the appropriate version.
- In Linux, you will have downloaded a tar.gz file. Move this file to a folder where you want to install Gurobi. You can move it to /opt for a shared installation across users otherwise, your home directory should also work.
- Unzip the file by running the following command - tar xvfz gurobi<version>_linux64.tar.gz
- This will extract the contents into a new directory named by the Gurobi version, which will contain a sub-directory named linux64 (assuming you have x64 Linux). The full path to the linux64 directory is your <install-dir>.
- Open your .bashrc file (ls -a in your home directory, and you will find it) in any text editor and add the following lines at the end.
export GUROBI_HOME=<install-dir> export PATH=$GUROBI_HOME/bin:$PATH export LD_LIBRARY_PATH=$"{LD_LIBRARY_PATH}:${GUROBI_HOME}/lib
- You need to restart the terminal after you make changes in the .bashrc file for the changes to take effect. Alternatively, you can run the command source ~/.bashrc to allow the changes to become active without needing to restart the terminal. (By restart, I mean, close and relaunch the terminal)
- The next step is to create a license. Go back to the Downloads and Licenses page. Scroll down to the Access your Licenses section and click on Your Gurobi Licenses. This will take you to a page listing all your licenses.
- On the left, click on Request and choose Named-User Academic or comercial liseanse and click Generate Now. This should generate the license and give you a grbgetkey command with your specific license details. Names-User Academic licenses are valid for 1 year. You can generate a new license when this one expires if you need to.
- Copy this command and run it in the terminal. It will ask for a location to store your license. It is recommended to accept the default location, but in case you want to store it anywhere else, you can do so and then add another line to your .bashrc file which specifies the location.
export GRB_LICENSE_FILE=<License-File-Location>
- Gurobi should work now. You can test it by running the command gurobi_cl --version Some sources in case you are facing any issues
Give the input file in following format shown in the picture below (only shown top 3 rows)
You need to give the either of two input arguement True or False to file linear_optimizer_controller.py for stablitiy default is considered to be false Ensure that the K is written in uppercase.
K=5000
U1,224,318,162,2500
U2,224,318,162,2500
U3,244,318,244,2800
U4,244,318,244,2800
U5,244,318,285,3500
U6,244,318,285,3500
P-1,99,53,55,61,Economy,176
P-2,56,99,81,53,Priority,-
P-3,42,101,51,17,Priority,-
P-4,108,75,56,73,Economy,138
P-5,88,58,64,93,Economy,139For Stablity=True
python3 linear_optimizer_controller.py TrueFor Stablity=False
python3 linear_optimizer_controller.py False