mirror of
https://github.com/ANL-CEEESA/RELOG.git
synced 2025-12-06 07:48:50 -06:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f988dd3f9 | |||
| 046ee52d9d | |||
| 583208aa53 | |||
| ae9388be2a | |||
| f26055a0fe | |||
| 12ae6aec45 | |||
| ab64fc4346 | |||
| 4a9266a1bf | |||
| 8b3f3206eb | |||
| 15f3120131 | |||
| 042c7cf601 | |||
| bc156c84d3 | |||
| 26c5cd1ca1 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,7 +1,10 @@
|
||||
.ipynb*
|
||||
*.ipynb
|
||||
instances/Manifest.toml
|
||||
instances/Project.toml
|
||||
instances/Makefile
|
||||
instances/run.jl
|
||||
instances/*.jl
|
||||
instances/*.py
|
||||
notebooks
|
||||
.idea
|
||||
*.lp
|
||||
|
||||
6
CHANGELOG.md
Normal file
6
CHANGELOG.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Version 0.3 (June 25, 2020)
|
||||
|
||||
- Track emissions and energy (transportation and plants)
|
||||
- Minor changes to input file format:
|
||||
- Make all dictionary keys lowercase
|
||||
- Rename "outputs (tonne)" to "output (tonne/tonne)"
|
||||
8
Makefile
8
Makefile
@@ -1,11 +1,15 @@
|
||||
VERSION := 0.3
|
||||
JULIA := julia --color=yes --project=.
|
||||
|
||||
all: docs
|
||||
|
||||
test:
|
||||
$(JULIA) -e 'using Pkg; Pkg.test("RELOG")'
|
||||
|
||||
docs:
|
||||
mkdocs build
|
||||
|
||||
docs-push:
|
||||
rsync -avP docs/ andromeda:/www/axavier.org/projects/RELOG/
|
||||
rsync -avP docs/ isoron@axavier.org:/www/axavier.org/projects/RELOG/$(VERSION)/
|
||||
|
||||
.PHONY: docs
|
||||
.PHONY: docs test
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name = "RELOG"
|
||||
uuid = "a2afcdf7-cf04-4913-85f9-c0d81ddf2008"
|
||||
authors = ["Alinson S Xavier <axavier@anl.gov>"]
|
||||
version = "0.2.0"
|
||||
version = "0.3.0"
|
||||
|
||||
[deps]
|
||||
Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76"
|
||||
|
||||
@@ -5,7 +5,7 @@ RELOG: Reverse Logistics Optimization
|
||||
|
||||
### Documentation
|
||||
|
||||
* [https://axavier.org/projects/RELOG](https://axavier.org/projects/RELOG)
|
||||
* [https://anl-ceeesa.github.io/RELOG/](https://anl-ceeesa.github.io/RELOG/)
|
||||
|
||||
### Authors
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
</ul>
|
||||
<h3 id="source-code">Source Code</h3>
|
||||
<ul>
|
||||
<li><a href="https://github.com/iSoron/RELOG">https://github.com/iSoron/RELOG</a></li>
|
||||
<li><a href="https://anl-ceeesa.github.io/RELOG/">https://anl-ceeesa.github.io/RELOG/</a></li>
|
||||
</ul>
|
||||
<h3 id="authors">Authors</h3>
|
||||
<ul>
|
||||
@@ -276,5 +276,5 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
<!--
|
||||
MkDocs version : 1.0.4
|
||||
Build Date UTC : 2020-06-05 20:38:00
|
||||
Build Date UTC : 2020-06-25 20:50:07
|
||||
-->
|
||||
|
||||
@@ -154,15 +154,15 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left"><code>Time horizon (years)</code></td>
|
||||
<td align="left"><code>time horizon (years)</code></td>
|
||||
<td>Number of years in the simulation.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="example">Example</h3>
|
||||
<pre><code class="json">{
|
||||
"Parameters": {
|
||||
"Time horizon (years)": 2
|
||||
"parameters": {
|
||||
"time horizon (years)": 2,
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
@@ -178,11 +178,19 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left"><code>Transportation cost ($/km/tonne)</code></td>
|
||||
<td align="left"><code>transportation cost ($/km/tonne)</code></td>
|
||||
<td>The cost to transport this product. Must be a timeseries.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>Initial amounts</code></td>
|
||||
<td align="left"><code>transportation energy (J/km/tonne)</code></td>
|
||||
<td>The energy required to transport this product. Must be a timeseries. Optional.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>transportation emissions (tonne/km/tonne)</code></td>
|
||||
<td>A dictionary mapping the name of each greenhouse gas, produced to transport one tonne of this product along one kilometer, to the amount of gas produced (in tonnes). Must be a timeseries. Optional.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>initial amounts</code></td>
|
||||
<td>A dictionary mapping the name of each location to its description (see below). If this product is not initially available, this key may be omitted. Must be a timeseries.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -197,50 +205,55 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left"><code>Latitude (deg)</code></td>
|
||||
<td align="left"><code>latitude (deg)</code></td>
|
||||
<td>The latitude of the location.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>Longitude (deg)</code></td>
|
||||
<td align="left"><code>longitude (deg)</code></td>
|
||||
<td>The longitude of the location.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>Amount (tonne)</code></td>
|
||||
<td align="left"><code>amount (tonne)</code></td>
|
||||
<td>The amount of the product initially available at the location. Must be a timeseries.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="example_1">Example</h3>
|
||||
<pre><code class="json">{
|
||||
"Products": {
|
||||
"products": {
|
||||
"P1": {
|
||||
"Transportation cost ($/km/tonne)": [0.015, 0.015],
|
||||
"Initial amounts": {
|
||||
"initial amounts": {
|
||||
"C1": {
|
||||
"Latitude (deg)": 7.0,
|
||||
"Longitude (deg)": 7.0,
|
||||
"Amount (tonne)": [934.56, 934.56]
|
||||
"latitude (deg)": 7.0,
|
||||
"longitude (deg)": 7.0,
|
||||
"amount (tonne)": [934.56, 934.56]
|
||||
},
|
||||
"C2": {
|
||||
"Latitude (deg)": 7.0,
|
||||
"Longitude (deg)": 19.0,
|
||||
"Amount (tonne)": [198.95, 198.95]
|
||||
"latitude (deg)": 7.0,
|
||||
"longitude (deg)": 19.0,
|
||||
"amount (tonne)": [198.95, 198.95]
|
||||
},
|
||||
"C3": {
|
||||
"Latitude (deg)": 84.0,
|
||||
"Longitude (deg)": 76.0,
|
||||
"Amount (tonne)": [212.97, 212.97]
|
||||
"latitude (deg)": 84.0,
|
||||
"longitude (deg)": 76.0,
|
||||
"amount (tonne)": [212.97, 212.97]
|
||||
}
|
||||
},
|
||||
"transportation cost ($/km/tonne)": [0.015, 0.015],
|
||||
"transportation energy (J/km/tonne)": [0.12, 0.11],
|
||||
"transportation emissions (tonne/km/tonne)": {
|
||||
"CO2": [0.052, 0.050],
|
||||
"CH4": [0.003, 0.002]
|
||||
}
|
||||
},
|
||||
"P2": {
|
||||
"Transportation cost ($/km/tonne)": [0.02, 0.02]
|
||||
"transportation cost ($/km/tonne)": [0.022, 0.020]
|
||||
},
|
||||
"P3": {
|
||||
"Transportation cost ($/km/tonne)": [0.0125, 0.0125]
|
||||
"transportation cost ($/km/tonne)": [0.0125, 0.0125]
|
||||
},
|
||||
"P4": {
|
||||
"Transportation cost ($/km/tonne)": [0.0175, 0.0175]
|
||||
"transportation cost ($/km/tonne)": [0.0175, 0.0175]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,15 +270,23 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left"><code>Input</code></td>
|
||||
<td align="left"><code>input</code></td>
|
||||
<td>The name of the product that this plant takes as input. Only one input is accepted per plant.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>Outputs (tonne)</code></td>
|
||||
<td align="left"><code>outputs (tonne/tonne)</code></td>
|
||||
<td>A dictionary specifying how many tonnes of each product is produced for each tonnes of input. For example, if the plant outputs 0.5 tonnes of P2 and 0.25 tonnes of P3 for each tonnes of P1 provided, then this entry should be <code>{"P2": 0.5, "P3": 0.25}</code>. If the plant does not output anything, this key may be omitted.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>Locations</code></td>
|
||||
<td align="left"><code>energy (GJ/tonne)</code></td>
|
||||
<td>The energy required to process 1 tonne of the input. Must be a timeseries. Optional.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>emissions (tonne/tonne)</code></td>
|
||||
<td>A dictionary mapping the name of each greenhouse gas, produced to process each tonne of input, to the amount of gas produced (in tonne). Must be a timeseries. Optional.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>locations</code></td>
|
||||
<td>A dictionary mapping the name of the location to a dictionary which describes the site characteristics (see below).</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -280,19 +301,19 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left"><code>Latitude (deg)</code></td>
|
||||
<td align="left"><code>latitude (deg)</code></td>
|
||||
<td>The latitude of the location, in degrees.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>Longitude (deg)</code></td>
|
||||
<td align="left"><code>longitude (deg)</code></td>
|
||||
<td>The longitude of the location, in degrees.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>Disposal</code></td>
|
||||
<td align="left"><code>disposal</code></td>
|
||||
<td>A dictionary describing what products can be disposed locally at the plant.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>Capacities (tonne)</code></td>
|
||||
<td align="left"><code>capacities (tonne)</code></td>
|
||||
<td>A dictionary describing what plant sizes are allowed, and their characteristics.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -307,16 +328,16 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left"><code>Cost ($/tonne)</code></td>
|
||||
<td align="left"><code>cost ($/tonne)</code></td>
|
||||
<td>The cost to dispose of the product. Must be a timeseries.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>Limit (tonne)</code></td>
|
||||
<td align="left"><code>limit (tonne)</code></td>
|
||||
<td>The maximum amount that can be disposed of. If an unlimited amount can be disposed, this key may be omitted. Must be a timeseries.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The keys in the <code>capacities</code> dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys:</p>
|
||||
<p>The keys in the <code>capacities (tonne)</code> dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -326,48 +347,53 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left"><code>Opening cost ($)</code></td>
|
||||
<td align="left"><code>opening cost ($)</code></td>
|
||||
<td>The cost to open a plant of this size.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>Fixed operating cost ($)</code></td>
|
||||
<td align="left"><code>fixed operating cost ($)</code></td>
|
||||
<td>The cost to keep the plant open, even if the plant doesn't process anything. Must be a timeseries.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><code>Variable operating cost ($/tonne)</code></td>
|
||||
<td align="left"><code>variable operating cost ($/tonne)</code></td>
|
||||
<td>The cost that the plant incurs to process each tonne of input. Must be a timeseries.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="example_2">Example</h3>
|
||||
<pre><code class="json">{
|
||||
"Plants": {
|
||||
"plants": {
|
||||
"F1": {
|
||||
"Input": "P1",
|
||||
"Outputs (tonne)": {
|
||||
"input": "P1",
|
||||
"outputs (tonne/tonne)": {
|
||||
"P2": 0.2,
|
||||
"P3": 0.5
|
||||
},
|
||||
"Locations": {
|
||||
"energy (GJ/tonne)": [0.12, 0.11],
|
||||
"emissions (tonne/tonne)": {
|
||||
"CO2": [0.052, 0.050],
|
||||
"CH4": [0.003, 0.002]
|
||||
},
|
||||
"locations": {
|
||||
"L1": {
|
||||
"Latitude (deg)": 0.0,
|
||||
"Longitude (deg)": 0.0,
|
||||
"Disposal": {
|
||||
"latitude (deg)": 0.0,
|
||||
"longitude (deg)": 0.0,
|
||||
"disposal": {
|
||||
"P2": {
|
||||
"Cost ($/tonne)": [-10.0, -12.0],
|
||||
"Limit (tonne)": [1.0, 1.0]
|
||||
"cost ($/tonne)": [-10.0, -12.0],
|
||||
"limit (tonne)": [1.0, 1.0]
|
||||
}
|
||||
},
|
||||
"Capacities (tonne)": {
|
||||
"capacities (tonne)": {
|
||||
"100": {
|
||||
"Opening cost ($)": [500, 530],
|
||||
"Fixed operating cost ($)": [300.0, 310.0],
|
||||
"Variable operating cost ($/tonne)": [5.0, 5.2]
|
||||
"opening cost ($)": [500, 530],
|
||||
"fixed operating cost ($)": [300.0, 310.0],
|
||||
"variable operating cost ($/tonne)": [5.0, 5.2]
|
||||
},
|
||||
"500": {
|
||||
"Opening cost ($)": [750, 760],
|
||||
"Fixed operating cost ($)": [400.0, 450.0],
|
||||
"Variable operating cost ($/tonne)": [5.0, 5.2]
|
||||
"opening cost ($)": [750, 760],
|
||||
"fixed operating cost ($)": [400.0, 450.0],
|
||||
"variable operating cost ($/tonne)": [5.0, 5.2]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,22 +2,22 @@
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-06-05</lastmod>
|
||||
<lastmod>2020-06-25</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-06-05</lastmod>
|
||||
<lastmod>2020-06-25</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-06-05</lastmod>
|
||||
<lastmod>2020-06-25</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-06-05</lastmod>
|
||||
<lastmod>2020-06-25</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
</urlset>
|
||||
Binary file not shown.
@@ -1,188 +1,198 @@
|
||||
{
|
||||
"Parameters": {
|
||||
"Time horizon (years)": 2
|
||||
"parameters": {
|
||||
"time horizon (years)": 2
|
||||
},
|
||||
"Products": {
|
||||
"products": {
|
||||
"P1": {
|
||||
"Transportation cost ($/km/tonne)": [0.015, 0.015],
|
||||
"Initial amounts": {
|
||||
"transportation cost ($/km/tonne)": [0.015, 0.015],
|
||||
"transportation energy (J/km/tonne)": [0.12, 0.11],
|
||||
"transportation emissions (tonne/km/tonne)": {
|
||||
"CO2": [0.052, 0.050],
|
||||
"CH4": [0.003, 0.002]
|
||||
},
|
||||
"initial amounts": {
|
||||
"C1": {
|
||||
"Latitude (deg)": 7.0,
|
||||
"Longitude (deg)": 7.0,
|
||||
"Amount (tonne)": [934.56, 934.56]
|
||||
"latitude (deg)": 7.0,
|
||||
"longitude (deg)": 7.0,
|
||||
"amount (tonne)": [934.56, 934.56]
|
||||
},
|
||||
"C2": {
|
||||
"Latitude (deg)": 7.0,
|
||||
"Longitude (deg)": 19.0,
|
||||
"Amount (tonne)": [198.95, 198.95]
|
||||
"latitude (deg)": 7.0,
|
||||
"longitude (deg)": 19.0,
|
||||
"amount (tonne)": [198.95, 198.95]
|
||||
},
|
||||
"C3": {
|
||||
"Latitude (deg)": 84.0,
|
||||
"Longitude (deg)": 76.0,
|
||||
"Amount (tonne)": [212.97, 212.97]
|
||||
"latitude (deg)": 84.0,
|
||||
"longitude (deg)": 76.0,
|
||||
"amount (tonne)": [212.97, 212.97]
|
||||
},
|
||||
"C4": {
|
||||
"Latitude (deg)": 21.0,
|
||||
"Longitude (deg)": 16.0,
|
||||
"Amount (tonne)": [352.19, 352.19]
|
||||
"latitude (deg)": 21.0,
|
||||
"longitude (deg)": 16.0,
|
||||
"amount (tonne)": [352.19, 352.19]
|
||||
},
|
||||
"C5": {
|
||||
"Latitude (deg)": 32.0,
|
||||
"Longitude (deg)": 92.0,
|
||||
"Amount (tonne)": [510.33, 510.33]
|
||||
"latitude (deg)": 32.0,
|
||||
"longitude (deg)": 92.0,
|
||||
"amount (tonne)": [510.33, 510.33]
|
||||
},
|
||||
"C6": {
|
||||
"Latitude (deg)": 14.0,
|
||||
"Longitude (deg)": 62.0,
|
||||
"Amount (tonne)": [471.66, 471.66]
|
||||
"latitude (deg)": 14.0,
|
||||
"longitude (deg)": 62.0,
|
||||
"amount (tonne)": [471.66, 471.66]
|
||||
},
|
||||
"C7": {
|
||||
"Latitude (deg)": 30.0,
|
||||
"Longitude (deg)": 83.0,
|
||||
"Amount (tonne)": [785.21, 785.21]
|
||||
"latitude (deg)": 30.0,
|
||||
"longitude (deg)": 83.0,
|
||||
"amount (tonne)": [785.21, 785.21]
|
||||
},
|
||||
"C8": {
|
||||
"Latitude (deg)": 35.0,
|
||||
"Longitude (deg)": 40.0,
|
||||
"Amount (tonne)": [706.17, 706.17]
|
||||
"latitude (deg)": 35.0,
|
||||
"longitude (deg)": 40.0,
|
||||
"amount (tonne)": [706.17, 706.17]
|
||||
},
|
||||
"C9": {
|
||||
"Latitude (deg)": 74.0,
|
||||
"Longitude (deg)": 52.0,
|
||||
"Amount (tonne)": [30.08, 30.08]
|
||||
"latitude (deg)": 74.0,
|
||||
"longitude (deg)": 52.0,
|
||||
"amount (tonne)": [30.08, 30.08]
|
||||
},
|
||||
"C10": {
|
||||
"Latitude (deg)": 22.0,
|
||||
"Longitude (deg)": 54.0,
|
||||
"Amount (tonne)": [536.52, 536.52]
|
||||
"latitude (deg)": 22.0,
|
||||
"longitude (deg)": 54.0,
|
||||
"amount (tonne)": [536.52, 536.52]
|
||||
}
|
||||
}
|
||||
},
|
||||
"P2": {
|
||||
"Transportation cost ($/km/tonne)": [0.02, 0.02]
|
||||
"transportation cost ($/km/tonne)": [0.02, 0.02]
|
||||
},
|
||||
"P3": {
|
||||
"Transportation cost ($/km/tonne)": [0.0125, 0.0125]
|
||||
"transportation cost ($/km/tonne)": [0.0125, 0.0125]
|
||||
},
|
||||
"P4": {
|
||||
"Transportation cost ($/km/tonne)": [0.0175, 0.0175]
|
||||
"transportation cost ($/km/tonne)": [0.0175, 0.0175]
|
||||
}
|
||||
},
|
||||
"Plants": {
|
||||
"plants": {
|
||||
"F1": {
|
||||
"Input": "P1",
|
||||
"Outputs (tonne)": {
|
||||
"input": "P1",
|
||||
"outputs (tonne/tonne)": {
|
||||
"P2": 0.2,
|
||||
"P3": 0.5
|
||||
},
|
||||
"Locations": {
|
||||
"energy (GJ/tonne)": [0.12, 0.11],
|
||||
"emissions (tonne/tonne)": {
|
||||
"CO2": [0.052, 0.050],
|
||||
"CH4": [0.003, 0.002]
|
||||
},
|
||||
"locations": {
|
||||
"L1": {
|
||||
"Latitude (deg)": 0.0,
|
||||
"Longitude (deg)": 0.0,
|
||||
"Disposal": {
|
||||
"latitude (deg)": 0.0,
|
||||
"longitude (deg)": 0.0,
|
||||
"disposal": {
|
||||
"P2": {
|
||||
"Cost ($/tonne)": [-10.0, -10.0],
|
||||
"Limit (tonne)": [1.0, 1.0]
|
||||
"cost ($/tonne)": [-10.0, -10.0],
|
||||
"limit (tonne)": [1.0, 1.0]
|
||||
},
|
||||
"P3": {
|
||||
"Cost ($/tonne)": [-10.0, -10.0],
|
||||
"Limit (tonne)": [1.0, 1.0]
|
||||
"cost ($/tonne)": [-10.0, -10.0],
|
||||
"limit (tonne)": [1.0, 1.0]
|
||||
}
|
||||
},
|
||||
"Capacities (tonne)": {
|
||||
"capacities (tonne)": {
|
||||
"250.0": {
|
||||
"Opening cost ($)": [500.0, 500.0],
|
||||
"Fixed operating cost ($)": [30.0, 30.0],
|
||||
"Variable operating cost ($/tonne)": [30.0, 30.0]
|
||||
"opening cost ($)": [500.0, 500.0],
|
||||
"fixed operating cost ($)": [30.0, 30.0],
|
||||
"variable operating cost ($/tonne)": [30.0, 30.0]
|
||||
},
|
||||
"1000.0": {
|
||||
"Opening cost ($)": [1250.0, 1250.0],
|
||||
"Fixed operating cost ($)": [30.0, 30.0],
|
||||
"Variable operating cost ($/tonne)": [30.0, 30.0]
|
||||
"opening cost ($)": [1250.0, 1250.0],
|
||||
"fixed operating cost ($)": [30.0, 30.0],
|
||||
"variable operating cost ($/tonne)": [30.0, 30.0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"L2": {
|
||||
"Latitude (deg)": 0.5,
|
||||
"Longitude (deg)": 0.5,
|
||||
"Capacities (tonne)": {
|
||||
"latitude (deg)": 0.5,
|
||||
"longitude (deg)": 0.5,
|
||||
"capacities (tonne)": {
|
||||
"0.0": {
|
||||
"Opening cost ($)": [1000, 1000],
|
||||
"Fixed operating cost ($)": [50.0, 50.0],
|
||||
"Variable operating cost ($/tonne)": [50.0, 50.0]
|
||||
"opening cost ($)": [1000, 1000],
|
||||
"fixed operating cost ($)": [50.0, 50.0],
|
||||
"variable operating cost ($/tonne)": [50.0, 50.0]
|
||||
},
|
||||
"10000.0": {
|
||||
"Opening cost ($)": [10000, 10000],
|
||||
"Fixed operating cost ($)": [50.0, 50.0],
|
||||
"Variable operating cost ($/tonne)": [50.0, 50.0]
|
||||
"opening cost ($)": [10000, 10000],
|
||||
"fixed operating cost ($)": [50.0, 50.0],
|
||||
"variable operating cost ($/tonne)": [50.0, 50.0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"F2": {
|
||||
"Input": "P2",
|
||||
"Outputs (tonne)": {
|
||||
"input": "P2",
|
||||
"outputs (tonne/tonne)": {
|
||||
"P3": 0.05,
|
||||
"P4": 0.80
|
||||
},
|
||||
"Locations": {
|
||||
"locations": {
|
||||
"L3": {
|
||||
"Latitude (deg)": 25.0,
|
||||
"Longitude (deg)": 65.0,
|
||||
"Disposal": {
|
||||
"latitude (deg)": 25.0,
|
||||
"longitude (deg)": 65.0,
|
||||
"disposal": {
|
||||
"P3": {
|
||||
"Cost ($/tonne)": [100.0, 100.0]
|
||||
"cost ($/tonne)": [100.0, 100.0]
|
||||
}
|
||||
},
|
||||
"Capacities (tonne)": {
|
||||
"capacities (tonne)": {
|
||||
"1000.0": {
|
||||
"Opening cost ($)": [3000, 3000],
|
||||
"Fixed operating cost ($)": [50.0, 50.0],
|
||||
"Variable operating cost ($/tonne)": [50.0, 50.0]
|
||||
"opening cost ($)": [3000, 3000],
|
||||
"fixed operating cost ($)": [50.0, 50.0],
|
||||
"variable operating cost ($/tonne)": [50.0, 50.0]
|
||||
}
|
||||
}
|
||||
},
|
||||
"L4": {
|
||||
"Latitude (deg)": 0.75,
|
||||
"Longitude (deg)": 0.20,
|
||||
"Capacities (tonne)": {
|
||||
"latitude (deg)": 0.75,
|
||||
"longitude (deg)": 0.20,
|
||||
"capacities (tonne)": {
|
||||
"10000": {
|
||||
"Opening cost ($)": [3000, 3000],
|
||||
"Fixed operating cost ($)": [50.0, 50.0],
|
||||
"Variable operating cost ($/tonne)": [50.0, 50.0]
|
||||
"opening cost ($)": [3000, 3000],
|
||||
"fixed operating cost ($)": [50.0, 50.0],
|
||||
"variable operating cost ($/tonne)": [50.0, 50.0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"F3": {
|
||||
"Input": "P4",
|
||||
"Locations": {
|
||||
"input": "P4",
|
||||
"locations": {
|
||||
"L5": {
|
||||
"Latitude (deg)": 100.0,
|
||||
"Longitude (deg)": 100.0,
|
||||
"Capacities (tonne)": {
|
||||
"latitude (deg)": 100.0,
|
||||
"longitude (deg)": 100.0,
|
||||
"capacities (tonne)": {
|
||||
"15000": {
|
||||
"Opening cost ($)": [0.0, 0.0],
|
||||
"Fixed operating cost ($)": [0.0, 0.0],
|
||||
"Variable operating cost ($/tonne)": [-15.0, -15.0]
|
||||
"opening cost ($)": [0.0, 0.0],
|
||||
"fixed operating cost ($)": [0.0, 0.0],
|
||||
"variable operating cost ($/tonne)": [-15.0, -15.0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"F4": {
|
||||
"Input": "P3",
|
||||
"Locations": {
|
||||
"input": "P3",
|
||||
"locations": {
|
||||
"L6": {
|
||||
"Latitude (deg)": 50.0,
|
||||
"Longitude (deg)": 50.0,
|
||||
"Capacities (tonne)": {
|
||||
"latitude (deg)": 50.0,
|
||||
"longitude (deg)": 50.0,
|
||||
"capacities (tonne)": {
|
||||
"10000": {
|
||||
"Opening cost ($)": [0.0, 0.0],
|
||||
"Fixed operating cost ($)": [0.0, 0.0],
|
||||
"Variable operating cost ($/tonne)": [-15.0, -15.0]
|
||||
"opening cost ($)": [0.0, 0.0],
|
||||
"fixed operating cost ($)": [0.0, 0.0],
|
||||
"variable operating cost ($/tonne)": [-15.0, -15.0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,53 +1,50 @@
|
||||
Welcome to the CBC MILP Solver
|
||||
Version: 2.10.3
|
||||
Build Date: Oct 7 2019
|
||||
Gurobi Optimizer version 9.0.0 build v9.0.0rc2 (linux64)
|
||||
Optimize a model with 124 rows, 141 columns and 400 nonzeros
|
||||
Model fingerprint: 0x46af87f0
|
||||
Variable types: 117 continuous, 24 integer (24 binary)
|
||||
Coefficient statistics:
|
||||
Matrix range [5e-02, 2e+04]
|
||||
Objective range [9e-01, 3e+03]
|
||||
Bounds range [1e+00, 1e+08]
|
||||
RHS range [3e+01, 2e+04]
|
||||
Presolve removed 98 rows and 107 columns
|
||||
Presolve time: 0.00s
|
||||
Presolved: 26 rows, 34 columns, 74 nonzeros
|
||||
Variable types: 28 continuous, 6 integer (6 binary)
|
||||
|
||||
command line - Cbc_C_Interface -solve -quit (default strategy 1)
|
||||
Continuous objective value is 1.86768e+06 - 0.00 seconds
|
||||
Cgl0003I 7 fixed, 0 tightened bounds, 9 strengthened rows, 0 substitutions
|
||||
Cgl0003I 0 fixed, 0 tightened bounds, 2 strengthened rows, 0 substitutions
|
||||
Cgl0003I 0 fixed, 0 tightened bounds, 1 strengthened rows, 0 substitutions
|
||||
Cgl0004I processed model has 35 rows, 55 columns (9 integer (9 of which binary)) and 211 elements
|
||||
Cbc0012I Integer solution of 1871179 found by DiveCoefficient after 0 iterations and 0 nodes (0.00 seconds)
|
||||
Cbc0038I Full problem 35 rows 55 columns, reduced to 18 rows 37 columns
|
||||
Cbc0006I The LP relaxation is infeasible or too expensive
|
||||
Cbc0013I At root node, 0 cuts changed objective from 1869627.3 to 1871179 in 1 passes
|
||||
Cbc0014I Cut generator 0 (Probing) - 0 row cuts average 0.0 elements, 1 column cuts (1 active) in 0.000 seconds - new frequency is 1
|
||||
Cbc0014I Cut generator 1 (Gomory) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
|
||||
Cbc0014I Cut generator 2 (Knapsack) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
|
||||
Cbc0014I Cut generator 3 (Clique) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
|
||||
Cbc0014I Cut generator 4 (MixedIntegerRounding2) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
|
||||
Cbc0014I Cut generator 5 (FlowCover) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
|
||||
Cbc0014I Cut generator 6 (TwoMirCuts) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
|
||||
Cbc0014I Cut generator 7 (ZeroHalf) - 0 row cuts average 0.0 elements, 0 column cuts (0 active) in 0.000 seconds - new frequency is -100
|
||||
Cbc0001I Search completed - best objective 1871178.961662621, took 2 iterations and 0 nodes (0.00 seconds)
|
||||
Cbc0035I Maximum depth 0, 5 variables fixed on reduced cost
|
||||
Cuts at root node changed objective from 1.86963e+06 to 1.87118e+06
|
||||
Probing was tried 1 times and created 1 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
|
||||
Gomory was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
|
||||
Knapsack was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
|
||||
Clique was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
|
||||
MixedIntegerRounding2 was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
|
||||
FlowCover was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
|
||||
TwoMirCuts was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
|
||||
ZeroHalf was tried 0 times and created 0 cuts of which 0 were active after adding rounds of cuts (0.000 seconds)
|
||||
Root relaxation: objective 1.870636e+06, 10 iterations, 0.00 seconds
|
||||
|
||||
Result - Optimal solution found
|
||||
Nodes | Current Node | Objective Bounds | Work
|
||||
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
|
||||
|
||||
Objective value: 1871178.96166262
|
||||
Enumerated nodes: 0
|
||||
Total iterations: 2
|
||||
Time (CPU seconds): 0.01
|
||||
Time (Wallclock seconds): 0.01
|
||||
0 0 1870636.06 0 2 - 1870636.06 - - 0s
|
||||
H 0 0 1871178.9617 1870636.06 0.03% - 0s
|
||||
|
||||
Total time (CPU seconds): 0.01 (Wallclock seconds): 0.01
|
||||
Explored 1 nodes (10 simplex iterations) in 0.00 seconds
|
||||
Thread count was 8 (of 80 available processors)
|
||||
|
||||
Coin0506I Presolve 24 (-100) rows, 38 (-103) columns and 164 (-236) elements
|
||||
Clp0006I 0 Obj 1590708.5 Primal inf 13041.309 (4) Dual inf 429.24088 (24)
|
||||
Clp0006I 16 Obj 1871179
|
||||
Clp0000I Optimal - objective value 1871179
|
||||
Coin0511I After Postsolve, objective 1871179, infeasibilities - dual 0 (0), primal 0 (0)
|
||||
Clp0032I Optimal objective 1871178.962 - 16 iterations time 0.002, Presolve 0.00
|
||||
Solution count 1: 1.87118e+06
|
||||
|
||||
Optimal solution found (tolerance 1.00e-02)
|
||||
Best objective 1.871178961663e+06, best bound 1.870636062997e+06, gap 0.0290%
|
||||
Gurobi Optimizer version 9.0.0 build v9.0.0rc2 (linux64)
|
||||
Optimize a model with 124 rows, 141 columns and 400 nonzeros
|
||||
Model fingerprint: 0x133a97e7
|
||||
Coefficient statistics:
|
||||
Matrix range [5e-02, 2e+04]
|
||||
Objective range [9e-01, 3e+03]
|
||||
Bounds range [1e+00, 1e+08]
|
||||
RHS range [3e+01, 2e+04]
|
||||
Presolve removed 115 rows and 110 columns
|
||||
Presolve time: 0.00s
|
||||
Presolved: 9 rows, 31 columns, 94 nonzeros
|
||||
|
||||
Iteration Objective Primal Inf. Dual Inf. Time
|
||||
0 1.0296026e+06 1.950922e+03 0.000000e+00 0s
|
||||
7 1.8711790e+06 0.000000e+00 0.000000e+00 0s
|
||||
|
||||
Solved in 7 iterations and 0.00 seconds
|
||||
Optimal objective 1.871178962e+06
|
||||
Reading s1.json...
|
||||
Building graph...
|
||||
Building optimization model...
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
### Source Code
|
||||
|
||||
* [https://github.com/iSoron/RELOG](https://github.com/iSoron/RELOG)
|
||||
* [https://anl-ceeesa.github.io/RELOG/](https://anl-ceeesa.github.io/RELOG/)
|
||||
|
||||
### Authors
|
||||
* **Alinson S. Xavier,** Argonne National Laboratory <<axavier@anl.gov>>
|
||||
|
||||
@@ -8,14 +8,14 @@ The **parameters** section describes details about the simulation itself.
|
||||
|
||||
| Key | Description
|
||||
|:------------------------|---------------|
|
||||
|`Time horizon (years)` | Number of years in the simulation.
|
||||
|`time horizon (years)` | Number of years in the simulation.
|
||||
|
||||
|
||||
### Example
|
||||
```json
|
||||
{
|
||||
"Parameters": {
|
||||
"Time horizon (years)": 2
|
||||
"parameters": {
|
||||
"time horizon (years)": 2,
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -26,50 +26,57 @@ The **products** section describes all products and subproducts in the simulatio
|
||||
|
||||
| Key | Description
|
||||
|:--------------------------------------|---------------|
|
||||
|`Transportation cost ($/km/tonne)` | The cost to transport this product. Must be a timeseries.
|
||||
|`Initial amounts` | A dictionary mapping the name of each location to its description (see below). If this product is not initially available, this key may be omitted. Must be a timeseries.
|
||||
|`transportation cost ($/km/tonne)` | The cost to transport this product. Must be a timeseries.
|
||||
|`transportation energy (J/km/tonne)` | The energy required to transport this product. Must be a timeseries. Optional.
|
||||
|`transportation emissions (tonne/km/tonne)` | A dictionary mapping the name of each greenhouse gas, produced to transport one tonne of this product along one kilometer, to the amount of gas produced (in tonnes). Must be a timeseries. Optional.
|
||||
|`initial amounts` | A dictionary mapping the name of each location to its description (see below). If this product is not initially available, this key may be omitted. Must be a timeseries.
|
||||
|
||||
Each product may have some amount available at the beginning of each time period. In this case, the key `initial amounts` maps to a dictionary with the following keys:
|
||||
|
||||
| Key | Description
|
||||
|:------------------------|---------------|
|
||||
| `Latitude (deg)` | The latitude of the location.
|
||||
| `Longitude (deg)` | The longitude of the location.
|
||||
| `Amount (tonne)` | The amount of the product initially available at the location. Must be a timeseries.
|
||||
| `latitude (deg)` | The latitude of the location.
|
||||
| `longitude (deg)` | The longitude of the location.
|
||||
| `amount (tonne)` | The amount of the product initially available at the location. Must be a timeseries.
|
||||
|
||||
### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"Products": {
|
||||
"products": {
|
||||
"P1": {
|
||||
"Transportation cost ($/km/tonne)": [0.015, 0.015],
|
||||
"Initial amounts": {
|
||||
"initial amounts": {
|
||||
"C1": {
|
||||
"Latitude (deg)": 7.0,
|
||||
"Longitude (deg)": 7.0,
|
||||
"Amount (tonne)": [934.56, 934.56]
|
||||
"latitude (deg)": 7.0,
|
||||
"longitude (deg)": 7.0,
|
||||
"amount (tonne)": [934.56, 934.56]
|
||||
},
|
||||
"C2": {
|
||||
"Latitude (deg)": 7.0,
|
||||
"Longitude (deg)": 19.0,
|
||||
"Amount (tonne)": [198.95, 198.95]
|
||||
"latitude (deg)": 7.0,
|
||||
"longitude (deg)": 19.0,
|
||||
"amount (tonne)": [198.95, 198.95]
|
||||
},
|
||||
"C3": {
|
||||
"Latitude (deg)": 84.0,
|
||||
"Longitude (deg)": 76.0,
|
||||
"Amount (tonne)": [212.97, 212.97]
|
||||
"latitude (deg)": 84.0,
|
||||
"longitude (deg)": 76.0,
|
||||
"amount (tonne)": [212.97, 212.97]
|
||||
}
|
||||
},
|
||||
"transportation cost ($/km/tonne)": [0.015, 0.015],
|
||||
"transportation energy (J/km/tonne)": [0.12, 0.11],
|
||||
"transportation emissions (tonne/km/tonne)": {
|
||||
"CO2": [0.052, 0.050],
|
||||
"CH4": [0.003, 0.002]
|
||||
}
|
||||
},
|
||||
"P2": {
|
||||
"Transportation cost ($/km/tonne)": [0.02, 0.02]
|
||||
"transportation cost ($/km/tonne)": [0.022, 0.020]
|
||||
},
|
||||
"P3": {
|
||||
"Transportation cost ($/km/tonne)": [0.0125, 0.0125]
|
||||
"transportation cost ($/km/tonne)": [0.0125, 0.0125]
|
||||
},
|
||||
"P4": {
|
||||
"Transportation cost ($/km/tonne)": [0.0175, 0.0175]
|
||||
"transportation cost ($/km/tonne)": [0.0175, 0.0175]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -81,66 +88,73 @@ The **plants** section describes the available types of reverse manufacturing pl
|
||||
|
||||
| Key | Description
|
||||
|:------------------------|---------------|
|
||||
| `Input` | The name of the product that this plant takes as input. Only one input is accepted per plant.
|
||||
| `Outputs (tonne)` | A dictionary specifying how many tonnes of each product is produced for each tonnes of input. For example, if the plant outputs 0.5 tonnes of P2 and 0.25 tonnes of P3 for each tonnes of P1 provided, then this entry should be `{"P2": 0.5, "P3": 0.25}`. If the plant does not output anything, this key may be omitted.
|
||||
| `Locations` | A dictionary mapping the name of the location to a dictionary which describes the site characteristics (see below).
|
||||
| `input` | The name of the product that this plant takes as input. Only one input is accepted per plant.
|
||||
| `outputs (tonne/tonne)` | A dictionary specifying how many tonnes of each product is produced for each tonnes of input. For example, if the plant outputs 0.5 tonnes of P2 and 0.25 tonnes of P3 for each tonnes of P1 provided, then this entry should be `{"P2": 0.5, "P3": 0.25}`. If the plant does not output anything, this key may be omitted.
|
||||
|`energy (GJ/tonne)` | The energy required to process 1 tonne of the input. Must be a timeseries. Optional.
|
||||
|`emissions (tonne/tonne)` | A dictionary mapping the name of each greenhouse gas, produced to process each tonne of input, to the amount of gas produced (in tonne). Must be a timeseries. Optional.
|
||||
| `locations` | A dictionary mapping the name of the location to a dictionary which describes the site characteristics (see below).
|
||||
|
||||
Each type of plant is associated with a set of potential locations where it can be built. Each location is represented by a dictionary with the following keys:
|
||||
|
||||
| Key | Description
|
||||
|:------------------------------|---------------|
|
||||
| `Latitude (deg)` | The latitude of the location, in degrees.
|
||||
| `Longitude (deg)` | The longitude of the location, in degrees.
|
||||
| `Disposal` | A dictionary describing what products can be disposed locally at the plant.
|
||||
| `Capacities (tonne)` | A dictionary describing what plant sizes are allowed, and their characteristics.
|
||||
| `latitude (deg)` | The latitude of the location, in degrees.
|
||||
| `longitude (deg)` | The longitude of the location, in degrees.
|
||||
| `disposal` | A dictionary describing what products can be disposed locally at the plant.
|
||||
| `capacities (tonne)` | A dictionary describing what plant sizes are allowed, and their characteristics.
|
||||
|
||||
The keys in the `disposal` dictionary should be the names of the products. The values are dictionaries with the following keys:
|
||||
|
||||
| Key | Description
|
||||
|:------------------------|---------------|
|
||||
| `Cost ($/tonne)` | The cost to dispose of the product. Must be a timeseries.
|
||||
| `Limit (tonne)` | The maximum amount that can be disposed of. If an unlimited amount can be disposed, this key may be omitted. Must be a timeseries.
|
||||
| `cost ($/tonne)` | The cost to dispose of the product. Must be a timeseries.
|
||||
| `limit (tonne)` | The maximum amount that can be disposed of. If an unlimited amount can be disposed, this key may be omitted. Must be a timeseries.
|
||||
|
||||
|
||||
The keys in the `capacities` dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys:
|
||||
The keys in the `capacities (tonne)` dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys:
|
||||
|
||||
| Key | Description
|
||||
|:--------------------------------------|---------------|
|
||||
| `Opening cost ($)` | The cost to open a plant of this size.
|
||||
| `Fixed operating cost ($)` | The cost to keep the plant open, even if the plant doesn't process anything. Must be a timeseries.
|
||||
| `Variable operating cost ($/tonne)` | The cost that the plant incurs to process each tonne of input. Must be a timeseries.
|
||||
| `opening cost ($)` | The cost to open a plant of this size.
|
||||
| `fixed operating cost ($)` | The cost to keep the plant open, even if the plant doesn't process anything. Must be a timeseries.
|
||||
| `variable operating cost ($/tonne)` | The cost that the plant incurs to process each tonne of input. Must be a timeseries.
|
||||
|
||||
### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"Plants": {
|
||||
"plants": {
|
||||
"F1": {
|
||||
"Input": "P1",
|
||||
"Outputs (tonne)": {
|
||||
"input": "P1",
|
||||
"outputs (tonne/tonne)": {
|
||||
"P2": 0.2,
|
||||
"P3": 0.5
|
||||
},
|
||||
"Locations": {
|
||||
"energy (GJ/tonne)": [0.12, 0.11],
|
||||
"emissions (tonne/tonne)": {
|
||||
"CO2": [0.052, 0.050],
|
||||
"CH4": [0.003, 0.002]
|
||||
},
|
||||
"locations": {
|
||||
"L1": {
|
||||
"Latitude (deg)": 0.0,
|
||||
"Longitude (deg)": 0.0,
|
||||
"Disposal": {
|
||||
"latitude (deg)": 0.0,
|
||||
"longitude (deg)": 0.0,
|
||||
"disposal": {
|
||||
"P2": {
|
||||
"Cost ($/tonne)": [-10.0, -12.0],
|
||||
"Limit (tonne)": [1.0, 1.0]
|
||||
"cost ($/tonne)": [-10.0, -12.0],
|
||||
"limit (tonne)": [1.0, 1.0]
|
||||
}
|
||||
},
|
||||
"Capacities (tonne)": {
|
||||
"capacities (tonne)": {
|
||||
"100": {
|
||||
"Opening cost ($)": [500, 530],
|
||||
"Fixed operating cost ($)": [300.0, 310.0],
|
||||
"Variable operating cost ($/tonne)": [5.0, 5.2]
|
||||
"opening cost ($)": [500, 530],
|
||||
"fixed operating cost ($)": [300.0, 310.0],
|
||||
"variable operating cost ($/tonne)": [5.0, 5.2]
|
||||
},
|
||||
"500": {
|
||||
"Opening cost ($)": [750, 760],
|
||||
"Fixed operating cost ($)": [400.0, 450.0],
|
||||
"Variable operating cost ($/tonne)": [5.0, 5.2]
|
||||
"opening cost ($)": [750, 760],
|
||||
"fixed operating cost ($)": [400.0, 450.0],
|
||||
"variable operating cost ($/tonne)": [5.0, 5.2]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ using JSON, JSONSchema
|
||||
mutable struct Product
|
||||
name::String
|
||||
transportation_cost::Array{Float64}
|
||||
transportation_energy::Array{Float64}
|
||||
transportation_emissions::Dict{String, Array{Float64}}
|
||||
end
|
||||
|
||||
|
||||
@@ -40,6 +42,8 @@ mutable struct Plant
|
||||
disposal_limit::Dict{Product, Array{Float64}}
|
||||
disposal_cost::Dict{Product, Array{Float64}}
|
||||
sizes::Array{PlantSize}
|
||||
energy::Array{Float64}
|
||||
emissions::Dict{String, Array{Float64}}
|
||||
end
|
||||
|
||||
|
||||
@@ -70,67 +74,90 @@ function load(path::String)::Instance
|
||||
throw(msg)
|
||||
end
|
||||
|
||||
T = json["Parameters"]["Time horizon (years)"]
|
||||
T = json["parameters"]["time horizon (years)"]
|
||||
plants = Plant[]
|
||||
products = Product[]
|
||||
collection_centers = CollectionCenter[]
|
||||
prod_name_to_product = Dict{String, Product}()
|
||||
|
||||
# Create products
|
||||
for (product_name, product_dict) in json["Products"]
|
||||
product = Product(product_name, product_dict["Transportation cost (\$/km/tonne)"])
|
||||
for (product_name, product_dict) in json["products"]
|
||||
cost = product_dict["transportation cost (\$/km/tonne)"]
|
||||
energy = zeros(T)
|
||||
emissions = Dict()
|
||||
|
||||
if "transportation energy (J/km/tonne)" in keys(product_dict)
|
||||
energy = product_dict["transportation energy (J/km/tonne)"]
|
||||
end
|
||||
|
||||
if "transportation emissions (tonne/km/tonne)" in keys(product_dict)
|
||||
emissions = product_dict["transportation emissions (tonne/km/tonne)"]
|
||||
end
|
||||
|
||||
product = Product(product_name, cost, energy, emissions)
|
||||
push!(products, product)
|
||||
prod_name_to_product[product_name] = product
|
||||
|
||||
# Create collection centers
|
||||
if "Initial amounts" in keys(product_dict)
|
||||
for (center_name, center_dict) in product_dict["Initial amounts"]
|
||||
if "initial amounts" in keys(product_dict)
|
||||
for (center_name, center_dict) in product_dict["initial amounts"]
|
||||
center = CollectionCenter(length(collection_centers) + 1,
|
||||
center_name,
|
||||
center_dict["Latitude (deg)"],
|
||||
center_dict["Longitude (deg)"],
|
||||
center_dict["latitude (deg)"],
|
||||
center_dict["longitude (deg)"],
|
||||
product,
|
||||
center_dict["Amount (tonne)"])
|
||||
center_dict["amount (tonne)"])
|
||||
push!(collection_centers, center)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Create plants
|
||||
for (plant_name, plant_dict) in json["Plants"]
|
||||
input = prod_name_to_product[plant_dict["Input"]]
|
||||
for (plant_name, plant_dict) in json["plants"]
|
||||
input = prod_name_to_product[plant_dict["input"]]
|
||||
output = Dict()
|
||||
|
||||
# Plant outputs
|
||||
if "Outputs (tonne)" in keys(plant_dict)
|
||||
if "outputs (tonne/tonne)" in keys(plant_dict)
|
||||
output = Dict(prod_name_to_product[key] => value
|
||||
for (key, value) in plant_dict["Outputs (tonne)"]
|
||||
for (key, value) in plant_dict["outputs (tonne/tonne)"]
|
||||
if value > 0)
|
||||
end
|
||||
|
||||
for (location_name, location_dict) in plant_dict["Locations"]
|
||||
energy = zeros(T)
|
||||
emissions = Dict()
|
||||
|
||||
if "energy (GJ/tonne)" in keys(plant_dict)
|
||||
energy = plant_dict["energy (GJ/tonne)"]
|
||||
end
|
||||
|
||||
if "emissions (tonne/tonne)" in keys(plant_dict)
|
||||
emissions = plant_dict["emissions (tonne/tonne)"]
|
||||
end
|
||||
|
||||
for (location_name, location_dict) in plant_dict["locations"]
|
||||
sizes = PlantSize[]
|
||||
disposal_limit = Dict(p => [0.0 for t in 1:T] for p in keys(output))
|
||||
disposal_cost = Dict(p => [0.0 for t in 1:T] for p in keys(output))
|
||||
|
||||
# Disposal
|
||||
if "Disposal" in keys(location_dict)
|
||||
for (product_name, disposal_dict) in location_dict["Disposal"]
|
||||
if "disposal" in keys(location_dict)
|
||||
for (product_name, disposal_dict) in location_dict["disposal"]
|
||||
limit = [1e8 for t in 1:T]
|
||||
if "Limit (tonne)" in keys(disposal_dict)
|
||||
limit = disposal_dict["Limit (tonne)"]
|
||||
if "limit (tonne)" in keys(disposal_dict)
|
||||
limit = disposal_dict["limit (tonne)"]
|
||||
end
|
||||
disposal_limit[prod_name_to_product[product_name]] = limit
|
||||
disposal_cost[prod_name_to_product[product_name]] = disposal_dict["Cost (\$/tonne)"]
|
||||
disposal_cost[prod_name_to_product[product_name]] = disposal_dict["cost (\$/tonne)"]
|
||||
end
|
||||
end
|
||||
|
||||
# Capacities
|
||||
for (capacity_name, capacity_dict) in location_dict["Capacities (tonne)"]
|
||||
for (capacity_name, capacity_dict) in location_dict["capacities (tonne)"]
|
||||
push!(sizes, PlantSize(parse(Float64, capacity_name),
|
||||
capacity_dict["Variable operating cost (\$/tonne)"],
|
||||
capacity_dict["Fixed operating cost (\$)"],
|
||||
capacity_dict["Opening cost (\$)"]))
|
||||
capacity_dict["variable operating cost (\$/tonne)"],
|
||||
capacity_dict["fixed operating cost (\$)"],
|
||||
capacity_dict["opening cost (\$)"]))
|
||||
end
|
||||
length(sizes) > 1 || push!(sizes, sizes[1])
|
||||
sort!(sizes, by = x -> x.capacity)
|
||||
@@ -148,11 +175,13 @@ function load(path::String)::Instance
|
||||
location_name,
|
||||
input,
|
||||
output,
|
||||
location_dict["Latitude (deg)"],
|
||||
location_dict["Longitude (deg)"],
|
||||
location_dict["latitude (deg)"],
|
||||
location_dict["longitude (deg)"],
|
||||
disposal_limit,
|
||||
disposal_cost,
|
||||
sizes)
|
||||
sizes,
|
||||
energy,
|
||||
emissions)
|
||||
|
||||
push!(plants, plant)
|
||||
end
|
||||
|
||||
50
src/model.jl
50
src/model.jl
@@ -20,7 +20,6 @@ function build_model(instance::Instance, graph::Graph, optimizer)::Manufacturing
|
||||
create_objective_function!(model)
|
||||
create_shipping_node_constraints!(model)
|
||||
create_process_node_constraints!(model)
|
||||
JuMP.write_to_file(model.mip, "model.lp")
|
||||
return model
|
||||
end
|
||||
|
||||
@@ -194,7 +193,7 @@ function create_process_node_constraints!(model::ManufacturingModel)
|
||||
end
|
||||
end
|
||||
|
||||
function solve(filename::String; optimizer=Cbc.Optimizer, lp_optimizer=Clp.Optimizer)
|
||||
function solve(filename::String; milp_optimizer=Cbc.Optimizer, lp_optimizer=Clp.Optimizer)
|
||||
println("Reading $filename...")
|
||||
instance = RELOG.load(filename)
|
||||
|
||||
@@ -202,7 +201,7 @@ function solve(filename::String; optimizer=Cbc.Optimizer, lp_optimizer=Clp.Optim
|
||||
graph = RELOG.build_graph(instance)
|
||||
|
||||
println("Building optimization model...")
|
||||
model = RELOG.build_model(instance, graph, optimizer)
|
||||
model = RELOG.build_model(instance, graph, milp_optimizer)
|
||||
|
||||
println("Optimizing MILP...")
|
||||
JuMP.optimize!(model.mip)
|
||||
@@ -238,7 +237,15 @@ function get_solution(model::ManufacturingModel)
|
||||
"Disposal (\$)" => zeros(T),
|
||||
"Expansion (\$)" => zeros(T),
|
||||
"Total (\$)" => zeros(T),
|
||||
)
|
||||
),
|
||||
"Energy" => Dict(
|
||||
"Plants (GJ)" => zeros(T),
|
||||
"Transportation (GJ)" => zeros(T),
|
||||
),
|
||||
"Emissions" => Dict(
|
||||
"Plants (tonne)" => Dict(),
|
||||
"Transportation (tonne)" => Dict(),
|
||||
),
|
||||
)
|
||||
|
||||
plant_to_process_node = Dict(n.location => n for n in graph.process_nodes)
|
||||
@@ -310,13 +317,19 @@ function get_solution(model::ManufacturingModel)
|
||||
"Distance (km)" => a.values["distance"],
|
||||
"Latitude (deg)" => a.source.location.latitude,
|
||||
"Longitude (deg)" => a.source.location.longitude,
|
||||
"Transportation cost (\$)" => [a.source.product.transportation_cost[t] *
|
||||
vals[t] *
|
||||
a.values["distance"]
|
||||
for t in 1:T],
|
||||
"Variable operating cost (\$)" => [plant.sizes[1].variable_operating_cost[t] * vals[t]
|
||||
for t in 1:T],
|
||||
"Transportation cost (\$)" => a.source.product.transportation_cost .* vals .* a.values["distance"],
|
||||
"Variable operating cost (\$)" => plant.sizes[1].variable_operating_cost .* vals,
|
||||
"Transportation energy (J)" => vals .* a.values["distance"] .* a.source.product.transportation_energy,
|
||||
"Emissions (tonne)" => Dict(),
|
||||
)
|
||||
emissions_dict = output["Emissions"]["Transportation (tonne)"]
|
||||
for (em_name, em_values) in a.source.product.transportation_emissions
|
||||
dict["Emissions (tonne)"][em_name] = em_values .* dict["Amount (tonne)"]
|
||||
if em_name ∉ keys(emissions_dict)
|
||||
emissions_dict[em_name] = zeros(T)
|
||||
end
|
||||
emissions_dict[em_name] += dict["Emissions (tonne)"][em_name]
|
||||
end
|
||||
if a.source.location isa CollectionCenter
|
||||
plant_name = "Origin"
|
||||
location_name = a.source.location.name
|
||||
@@ -332,6 +345,20 @@ function get_solution(model::ManufacturingModel)
|
||||
plant_dict["Total input (tonne)"] += vals
|
||||
output["Costs"]["Transportation (\$)"] += dict["Transportation cost (\$)"]
|
||||
output["Costs"]["Variable operating (\$)"] += dict["Variable operating cost (\$)"]
|
||||
output["Energy"]["Transportation (GJ)"] += dict["Transportation energy (J)"] / 1e6
|
||||
end
|
||||
|
||||
plant_dict["Energy (GJ)"] = plant_dict["Total input (tonne)"] .* plant.energy
|
||||
output["Energy"]["Plants (GJ)"] += plant_dict["Energy (GJ)"]
|
||||
|
||||
plant_dict["Emissions (tonne)"] = Dict()
|
||||
emissions_dict = output["Emissions"]["Plants (tonne)"]
|
||||
for (em_name, em_values) in plant.emissions
|
||||
plant_dict["Emissions (tonne)"][em_name] = em_values .* plant_dict["Total input (tonne)"]
|
||||
if em_name ∉ keys(emissions_dict)
|
||||
emissions_dict[em_name] = zeros(T)
|
||||
end
|
||||
emissions_dict[em_name] += plant_dict["Emissions (tonne)"][em_name]
|
||||
end
|
||||
|
||||
# Outputs
|
||||
@@ -344,7 +371,8 @@ function get_solution(model::ManufacturingModel)
|
||||
if sum(disposal_amount) > 1e-5
|
||||
skip_plant = false
|
||||
plant_dict["Output"]["Dispose"][product_name] = disposal_dict = Dict()
|
||||
disposal_dict["Amount (tonne)"] = [JuMP.value(model.vars.dispose[shipping_node, t]) for t in 1:T]
|
||||
disposal_dict["Amount (tonne)"] = [JuMP.value(model.vars.dispose[shipping_node, t])
|
||||
for t in 1:T]
|
||||
disposal_dict["Cost (\$)"] = [disposal_dict["Amount (tonne)"][t] *
|
||||
plant.disposal_cost[shipping_node.product][t]
|
||||
for t in 1:T]
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
"Parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Time horizon (years)": { "type": "number" }
|
||||
"time horizon (years)": { "type": "number" }
|
||||
},
|
||||
"required": [
|
||||
"Time horizon (years)"
|
||||
"time horizon (years)"
|
||||
]
|
||||
},
|
||||
"Plant": {
|
||||
@@ -23,16 +23,21 @@
|
||||
"additionalProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Input": { "type": "string" },
|
||||
"Outputs (tonne)": {
|
||||
"input": { "type": "string" },
|
||||
"outputs (tonne/tonne)": {
|
||||
"type": "object",
|
||||
"additionalProperties": { "type": "number" }
|
||||
},
|
||||
"Locations": { "$ref": "#/definitions/PlantLocation" }
|
||||
"energy (GJ/tonne)": { "$ref": "#/definitions/TimeSeries" },
|
||||
"emissions (tonne/tonne)": {
|
||||
"type": "object",
|
||||
"additionalProperties": { "$ref": "#/definitions/TimeSeries" }
|
||||
},
|
||||
"locations": { "$ref": "#/definitions/PlantLocation" }
|
||||
},
|
||||
"required": [
|
||||
"Input",
|
||||
"Locations"
|
||||
"input",
|
||||
"locations"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -41,42 +46,42 @@
|
||||
"additionalProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Latitude (deg)": { "type": "number" },
|
||||
"Longitude (deg)": { "type": "number" },
|
||||
"Disposal": {
|
||||
"latitude (deg)": { "type": "number" },
|
||||
"longitude (deg)": { "type": "number" },
|
||||
"disposal": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Cost ($/tonne)": { "$ref": "#/definitions/TimeSeries" },
|
||||
"Limit (tonne)": { "$ref": "#/definitions/TimeSeries" }
|
||||
"cost ($/tonne)": { "$ref": "#/definitions/TimeSeries" },
|
||||
"limit (tonne)": { "$ref": "#/definitions/TimeSeries" }
|
||||
},
|
||||
"required": [
|
||||
"Cost ($/tonne)"
|
||||
"cost ($/tonne)"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Capacities (tonne)": {
|
||||
"capacities (tonne)": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Variable operating cost ($/tonne)": { "$ref": "#/definitions/TimeSeries" },
|
||||
"Fixed operating cost ($)": { "$ref": "#/definitions/TimeSeries" },
|
||||
"Opening cost ($)": { "$ref": "#/definitions/TimeSeries" }
|
||||
"variable operating cost ($/tonne)": { "$ref": "#/definitions/TimeSeries" },
|
||||
"fixed operating cost ($)": { "$ref": "#/definitions/TimeSeries" },
|
||||
"opening cost ($)": { "$ref": "#/definitions/TimeSeries" }
|
||||
},
|
||||
"required": [
|
||||
"Variable operating cost ($/tonne)",
|
||||
"Fixed operating cost ($)",
|
||||
"Opening cost ($)"
|
||||
"variable operating cost ($/tonne)",
|
||||
"fixed operating cost ($)",
|
||||
"opening cost ($)"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"Latitude (deg)",
|
||||
"Longitude (deg)",
|
||||
"Capacities (tonne)"
|
||||
"latitude (deg)",
|
||||
"longitude (deg)",
|
||||
"capacities (tonne)"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -85,14 +90,14 @@
|
||||
"additionalProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Latitude (deg)": { "type": "number" },
|
||||
"Longitude (deg)": { "type": "number" },
|
||||
"Amount (tonne)": { "$ref": "#/definitions/TimeSeries" }
|
||||
"latitude (deg)": { "type": "number" },
|
||||
"longitude (deg)": { "type": "number" },
|
||||
"amount (tonne)": { "$ref": "#/definitions/TimeSeries" }
|
||||
},
|
||||
"required": [
|
||||
"Latitude (deg)",
|
||||
"Longitude (deg)",
|
||||
"Amount (tonne)"
|
||||
"latitude (deg)",
|
||||
"longitude (deg)",
|
||||
"amount (tonne)"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -101,24 +106,29 @@
|
||||
"additionalProperties": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Transportation cost ($/km/tonne)": { "$ref": "#/definitions/TimeSeries" },
|
||||
"Initial amounts": { "$ref": "#/definitions/InitialAmount" }
|
||||
"transportation cost ($/km/tonne)": { "$ref": "#/definitions/TimeSeries" },
|
||||
"transportation energy (J/km/tonne)": { "$ref": "#/definitions/TimeSeries" },
|
||||
"transportation emissions (tonne/km/tonne)": {
|
||||
"type": "object",
|
||||
"additionalProperties": { "$ref": "#/definitions/TimeSeries" }
|
||||
},
|
||||
"initial amounts": { "$ref": "#/definitions/InitialAmount" }
|
||||
},
|
||||
"required": [
|
||||
"Transportation cost ($/km/tonne)"
|
||||
"transportation cost ($/km/tonne)"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Parameters": { "$ref": "#/definitions/Parameters" },
|
||||
"Plants": { "$ref": "#/definitions/Plant" },
|
||||
"Products": { "$ref": "#/definitions/Product" }
|
||||
"parameters": { "$ref": "#/definitions/Parameters" },
|
||||
"plants": { "$ref": "#/definitions/Plant" },
|
||||
"products": { "$ref": "#/definitions/Product" }
|
||||
},
|
||||
"required": [
|
||||
"Parameters",
|
||||
"Plants",
|
||||
"Products"
|
||||
"parameters",
|
||||
"plants",
|
||||
"products"
|
||||
]
|
||||
}
|
||||
@@ -36,9 +36,9 @@ using RELOG, Cbc, JuMP, Printf, JSON, MathOptInterface.FileFormats
|
||||
@test lower_bound(v) == 0.0
|
||||
@test upper_bound(v) == 1.0
|
||||
|
||||
dest = FileFormats.Model(format = FileFormats.FORMAT_LP)
|
||||
MOI.copy_to(dest, model.mip)
|
||||
MOI.write_to_file(dest, "model.lp")
|
||||
#dest = FileFormats.Model(format = FileFormats.FORMAT_LP)
|
||||
#MOI.copy_to(dest, model.mip)
|
||||
#MOI.write_to_file(dest, "model.lp")
|
||||
end
|
||||
|
||||
@testset "solve" begin
|
||||
|
||||
Reference in New Issue
Block a user