-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0edfb5a
Showing
5 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.lp | ||
results.txt | ||
*.sol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Data section | ||
data; | ||
|
||
# Set Definition | ||
set PP:= | ||
coal | ||
gas; | ||
|
||
# Demand | ||
param demand := | ||
250; | ||
|
||
# Fuel Requirement info | ||
param fuel_req := | ||
coal 3 | ||
gas 2; | ||
|
||
# Cost of production info | ||
param prod_cost:= | ||
coal 300 | ||
gas 250; | ||
|
||
# Fuel Availability info | ||
param fuel_avail:= | ||
coal 600 | ||
gas 300; | ||
|
||
# End statement | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Set and Problem declaration | ||
set PP; | ||
|
||
# Parameter definition | ||
param fuel_req {i in PP}; | ||
param prod_cost {i in PP}; | ||
param fuel_avail {i in PP}; | ||
param demand >= 0; | ||
|
||
# Variable description | ||
var x {i in PP} >=0; | ||
|
||
# Objective function | ||
minimize z: sum{i in PP} prod_cost[i] * x[i]; | ||
|
||
# Constraint Specification | ||
s.t. Fuel {i in PP}: fuel_req[i] * x[i] <= fuel_avail[i]; | ||
s.t. Production : sum{i in PP} x[i] >= demand; | ||
|
||
# Solve statement | ||
solve; | ||
|
||
# End statement | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright 2023 Will Usher | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# MJ2380 Lecture 3 - Island Model using GNU MathProg | ||
|
||
Provides the model and data for a simple island model. | ||
|
||
Run the model glpsol: | ||
|
||
glpglpsol -d island_data.txt -m island_model.txt -o results.txt | ||
|
||
View the LP file by appending `--wlp island.lp` to the command above. | ||
|
||
## License | ||
|
||
You are free to use the model and data under the terms of the open source MIT license. | ||
See `license.txt`. |