Docs: Update usage section

gh-actions
Alinson S. Xavier 5 years ago
parent a815ec4230
commit 2bbc0b998e

@ -75,19 +75,19 @@
<li > <li >
<a href="/install/">Install</a> <a href="/usage/">Usage</a>
</li> </li>
<li > <li >
<a href="/model/">Model</a> <a href="/format/">Data Format</a>
</li> </li>
<li > <li >
<a href="/optimize/">Optimize</a> <a href="/model/">Optimization Model</a>
</li> </li>

@ -0,0 +1,515 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Data Format - RELOG</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/v4-shims.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.min.css">
<link href='//rsms.me/inter/inter.css' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,600,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
<link href="../css/bootstrap-custom.min.css" rel="stylesheet">
<link href="../css/base.min.css" rel="stylesheet">
<link href="../css/cinder.min.css" rel="stylesheet">
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/styles/github.min.css">
<link href="../css/custom.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Main title -->
<a class="navbar-brand" href="..">RELOG</a>
</div>
<!-- Expanded navigation -->
<div class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li >
<a href="..">Home</a>
</li>
<li >
<a href="../usage/">Usage</a>
</li>
<li class="active">
<a href="./">Data Format</a>
</li>
<li >
<a href="../model/">Optimization Model</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
<i class="fas fa-search"></i> Search
</a>
</li>
<li >
<a rel="prev" href="../usage/">
<i class="fas fa-arrow-left"></i> Previous
</a>
</li>
<li >
<a rel="next" href="../model/">
Next <i class="fas fa-arrow-right"></i>
</a>
</li>
<li>
<a href="https://github.com/ANL-CEEESA/RELOG/edit/master/src/docs/format.md"><i class="fab fa-github"></i> Edit on GitHub</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
<li class="first-level active"><a href="#data-format">Data Format</a></li>
<li class="second-level"><a href="#parameters">Parameters</a></li>
<li class="third-level"><a href="#example">Example</a></li>
<li class="second-level"><a href="#products">Products</a></li>
<li class="third-level"><a href="#example_1">Example</a></li>
<li class="second-level"><a href="#processing-plants">Processing Plants</a></li>
<li class="third-level"><a href="#example_2">Example</a></li>
<li class="second-level"><a href="#current-limitations">Current limitations</a></li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<h1 id="data-format">Data Format</h1>
<p>The first step when using RELOG is to describe the reverse logistics pipeline and the relevant data. RELOG accepts as input a JSON file with three sections: <code>parameters</code>, <code>products</code> and <code>plants</code>. Below, we describe each section in more detail.</p>
<h2 id="parameters">Parameters</h2>
<p>The <strong>parameters</strong> section describes details about the simulation itself.</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>time horizon (years)</code></td>
<td>Number of years in the simulation.</td>
</tr>
<tr>
<td align="left"><code>building period (years)</code></td>
<td>List of years in which we are allowed to open new plants. For example, if this parameter is set to <code>[1,2,3]</code>, we can only open plants during the first three years. By default, this equals <code>[1]</code>; that is, plants can only be opened during the first year.</td>
</tr>
</tbody>
</table>
<h3 id="example">Example</h3>
<pre><code class="json">{
&quot;parameters&quot;: {
&quot;time horizon (years)&quot;: 2,
&quot;building period (years)&quot;: [1]
}
}
</code></pre>
<h2 id="products">Products</h2>
<p>The <strong>products</strong> section describes all products and subproducts in the simulation. The field <code>instance["Products"]</code> is a dictionary mapping the name of the product to a dictionary which describes its characteristics. Each product description contains the following keys:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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>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>
</table>
<p>Each product may have some amount available at the beginning of each time period. In this case, the key <code>initial amounts</code> maps to a dictionary with the following keys:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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>The longitude of the location.</td>
</tr>
<tr>
<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">{
&quot;products&quot;: {
&quot;P1&quot;: {
&quot;initial amounts&quot;: {
&quot;C1&quot;: {
&quot;latitude (deg)&quot;: 7.0,
&quot;longitude (deg)&quot;: 7.0,
&quot;amount (tonne)&quot;: [934.56, 934.56]
},
&quot;C2&quot;: {
&quot;latitude (deg)&quot;: 7.0,
&quot;longitude (deg)&quot;: 19.0,
&quot;amount (tonne)&quot;: [198.95, 198.95]
},
&quot;C3&quot;: {
&quot;latitude (deg)&quot;: 84.0,
&quot;longitude (deg)&quot;: 76.0,
&quot;amount (tonne)&quot;: [212.97, 212.97]
}
},
&quot;transportation cost ($/km/tonne)&quot;: [0.015, 0.015],
&quot;transportation energy (J/km/tonne)&quot;: [0.12, 0.11],
&quot;transportation emissions (tonne/km/tonne)&quot;: {
&quot;CO2&quot;: [0.052, 0.050],
&quot;CH4&quot;: [0.003, 0.002]
}
},
&quot;P2&quot;: {
&quot;transportation cost ($/km/tonne)&quot;: [0.022, 0.020]
},
&quot;P3&quot;: {
&quot;transportation cost ($/km/tonne)&quot;: [0.0125, 0.0125]
},
&quot;P4&quot;: {
&quot;transportation cost ($/km/tonne)&quot;: [0.0175, 0.0175]
}
}
}
</code></pre>
<h2 id="processing-plants">Processing Plants</h2>
<p>The <strong>plants</strong> section describes the available types of reverse manufacturing plants, their potential locations and associated costs, as well as their inputs and outputs. The field <code>instance["Plants"]</code> is a dictionary mapping the name of the plant to a dictionary with the following keys:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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/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>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>
</table>
<p>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:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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>The longitude of the location, in degrees.</td>
</tr>
<tr>
<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>A dictionary describing what plant sizes are allowed, and their characteristics.</td>
</tr>
</tbody>
</table>
<p>The keys in the <code>disposal</code> dictionary should be the names of the products. The values are dictionaries with the following keys:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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>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 (tonne)</code> dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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>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>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">{
&quot;plants&quot;: {
&quot;F1&quot;: {
&quot;input&quot;: &quot;P1&quot;,
&quot;outputs (tonne/tonne)&quot;: {
&quot;P2&quot;: 0.2,
&quot;P3&quot;: 0.5
},
&quot;energy (GJ/tonne)&quot;: [0.12, 0.11],
&quot;emissions (tonne/tonne)&quot;: {
&quot;CO2&quot;: [0.052, 0.050],
&quot;CH4&quot;: [0.003, 0.002]
},
&quot;locations&quot;: {
&quot;L1&quot;: {
&quot;latitude (deg)&quot;: 0.0,
&quot;longitude (deg)&quot;: 0.0,
&quot;disposal&quot;: {
&quot;P2&quot;: {
&quot;cost ($/tonne)&quot;: [-10.0, -12.0],
&quot;limit (tonne)&quot;: [1.0, 1.0]
}
},
&quot;capacities (tonne)&quot;: {
&quot;100&quot;: {
&quot;opening cost ($)&quot;: [500, 530],
&quot;fixed operating cost ($)&quot;: [300.0, 310.0],
&quot;variable operating cost ($/tonne)&quot;: [5.0, 5.2]
},
&quot;500&quot;: {
&quot;opening cost ($)&quot;: [750, 760],
&quot;fixed operating cost ($)&quot;: [400.0, 450.0],
&quot;variable operating cost ($/tonne)&quot;: [5.0, 5.2]
}
}
}
}
}
}
}
</code></pre>
<h2 id="current-limitations">Current limitations</h2>
<ul>
<li>Each plant can only be opened exactly once. After open, the plant remains open until the end of the simulation.</li>
<li>Plants can be expanded at any time, even long after they are open.</li>
<li>All material available at the beginning of a time period must be entirely processed by the end of that time period. It is not possible to store unprocessed materials from one time period to the next.</li>
<li>Up to two plant sizes are currently supported. Variable operating costs must be the same for all plant sizes.</li>
</ul></div>
</div>
<footer class="col-md-12 text-center">
<hr>
<p>
<small>Copyright © 2020, UChicago Argonne, LLC. All Rights Reserved.</small><br>
<small>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</small>
</p>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="../js/bootstrap-3.0.3.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>var base_url = ".."</script>
<script src="../js/base.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="../js/mathjax.js"></script>
<script src="../search/main.js"></script>
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="searchModalLabel">Search</h4>
</div>
<div class="modal-body">
<p>
From here you can search these documents. Enter
your search terms below.
</p>
<form>
<div class="form-group">
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
</div>
</form>
<div id="mkdocs-search-results"></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="keyboardModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th style="width: 20%;">Keys</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="help shortcut"><kbd>?</kbd></td>
<td>Open this help</td>
</tr>
<tr>
<td class="next shortcut"><kbd>n</kbd></td>
<td>Next page</td>
</tr>
<tr>
<td class="prev shortcut"><kbd>p</kbd></td>
<td>Previous page</td>
</tr>
<tr>
<td class="search shortcut"><kbd>s</kbd></td>
<td>Search</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</body>
</html>

@ -75,19 +75,19 @@
<li > <li >
<a href="install/">Install</a> <a href="usage/">Usage</a>
</li> </li>
<li > <li >
<a href="model/">Model</a> <a href="format/">Data Format</a>
</li> </li>
<li > <li >
<a href="optimize/">Optimize</a> <a href="model/">Optimization Model</a>
</li> </li>
@ -105,7 +105,7 @@
</a> </a>
</li> </li>
<li > <li >
<a rel="next" href="install/"> <a rel="next" href="usage/">
Next <i class="fas fa-arrow-right"></i> Next <i class="fas fa-arrow-right"></i>
</a> </a>
</li> </li>
@ -136,12 +136,12 @@
<div class="col-md-9" role="main"> <div class="col-md-9" role="main">
<h1 id="relog-reverse-logistics-optimization">RELOG: Reverse Logistics Optimization</h1> <h1 id="relog-reverse-logistics-optimization">RELOG: Reverse Logistics Optimization</h1>
<p><strong>RELOG</strong> is a supply chain optimization package focusing on reverse logistics and reverse manufacturing. For example, the package can be used to determine where to build recycling plants, what sizes should they have and which customers should be served by which plants. The package supports customized reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods.</p> <p><strong>RELOG</strong> is a supply chain optimization package focusing on reverse logistics and reverse manufacturing. The package uses Mixed-Integer Linear Programming to determine where to build recycling plants, what size should these plants have and which customers should be served by which plants. The package supports custom reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods.</p>
<h3 id="table-of-contents">Table of Contents</h3> <h3 id="table-of-contents">Table of Contents</h3>
<ul> <ul>
<li><a href="install/">Installation</a></li> <li><a href="usage/">Usage</a></li>
<li><a href="model/">Modeling</a></li> <li><a href="format/">Data Format</a></li>
<li><a href="optimize/">Optimizing</a></li> <li><a href="model/">Optimization model</a></li>
</ul> </ul>
<h3 id="source-code">Source Code</h3> <h3 id="source-code">Source Code</h3>
<ul> <ul>
@ -282,5 +282,5 @@ POSSIBILITY OF SUCH DAMAGE.
<!-- <!--
MkDocs version : 1.1.2 MkDocs version : 1.1.2
Build Date UTC : 2020-08-07 18:14:42.160379+00:00 Build Date UTC : 2020-08-21 19:13:45.426349+00:00
--> -->

@ -1,238 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Install - RELOG</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/v4-shims.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3.3.0/build/web/hack.min.css">
<link href='//rsms.me/inter/inter.css' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,600,700&subset=latin-ext,latin' rel='stylesheet' type='text/css'>
<link href="../css/bootstrap-custom.min.css" rel="stylesheet">
<link href="../css/base.min.css" rel="stylesheet">
<link href="../css/cinder.min.css" rel="stylesheet">
<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/styles/github.min.css">
<link href="../css/custom.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Collapsed navigation -->
<div class="navbar-header">
<!-- Expander button -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Main title -->
<a class="navbar-brand" href="..">RELOG</a>
</div>
<!-- Expanded navigation -->
<div class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li >
<a href="..">Home</a>
</li>
<li class="active">
<a href="./">Install</a>
</li>
<li >
<a href="../model/">Model</a>
</li>
<li >
<a href="../optimize/">Optimize</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" data-toggle="modal" data-target="#mkdocs_search_modal">
<i class="fas fa-search"></i> Search
</a>
</li>
<li >
<a rel="prev" href="..">
<i class="fas fa-arrow-left"></i> Previous
</a>
</li>
<li >
<a rel="next" href="../model/">
Next <i class="fas fa-arrow-right"></i>
</a>
</li>
<li>
<a href="https://github.com/ANL-CEEESA/RELOG/edit/master/src/docs/install.md"><i class="fab fa-github"></i> Edit on GitHub</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav">
<li class="first-level active"><a href="#installation">Installation</a></li>
</ul>
</div></div>
<div class="col-md-9" role="main">
<h1 id="installation">Installation</h1>
<p>The package was developed and tested with Julia 1.3 and may not be compatible with newer versions. To install it, launch the Julia console, type <code>]</code> to switch to package manager mode and run:</p>
<pre><code class="text">pkg&gt; add https://github.com/ANL-CEEESA/RELOG.git
</code></pre>
<p>To make sure that the package has been correctly installed:</p>
<pre><code class="text">pkg&gt; test RELOG
</code></pre></div>
</div>
<footer class="col-md-12 text-center">
<hr>
<p>
<small>Copyright © 2020, UChicago Argonne, LLC. All Rights Reserved.</small><br>
<small>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</small>
</p>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="../js/bootstrap-3.0.3.min.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.18.0/build/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>var base_url = ".."</script>
<script src="../js/base.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="../js/mathjax.js"></script>
<script src="../search/main.js"></script>
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="searchModalLabel">Search</h4>
</div>
<div class="modal-body">
<p>
From here you can search these documents. Enter
your search terms below.
</p>
<form>
<div class="form-group">
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
</div>
</form>
<div id="mkdocs-search-results"></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="keyboardModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th style="width: 20%;">Keys</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="help shortcut"><kbd>?</kbd></td>
<td>Open this help</td>
</tr>
<tr>
<td class="next shortcut"><kbd>n</kbd></td>
<td>Next page</td>
</tr>
<tr>
<td class="prev shortcut"><kbd>p</kbd></td>
<td>Previous page</td>
</tr>
<tr>
<td class="search shortcut"><kbd>s</kbd></td>
<td>Search</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</body>
</html>

@ -11,7 +11,7 @@
<link rel="shortcut icon" href="../img/favicon.ico"> <link rel="shortcut icon" href="../img/favicon.ico">
<title>Model - RELOG</title> <title>Optimization Model - RELOG</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
@ -75,19 +75,19 @@
<li > <li >
<a href="../install/">Install</a> <a href="../usage/">Usage</a>
</li> </li>
<li class="active"> <li >
<a href="./">Model</a> <a href="../format/">Data Format</a>
</li> </li>
<li > <li class="active">
<a href="../optimize/">Optimize</a> <a href="./">Optimization Model</a>
</li> </li>
@ -100,12 +100,12 @@
</a> </a>
</li> </li>
<li > <li >
<a rel="prev" href="../install/"> <a rel="prev" href="../format/">
<i class="fas fa-arrow-left"></i> Previous <i class="fas fa-arrow-left"></i> Previous
</a> </a>
</li> </li>
<li > <li class="disabled">
<a rel="next" href="../optimize/"> <a rel="next" >
Next <i class="fas fa-arrow-right"></i> Next <i class="fas fa-arrow-right"></i>
</a> </a>
</li> </li>
@ -122,296 +122,11 @@
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary"> <div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav"> <ul class="nav bs-sidenav">
<li class="first-level active"><a href="#modeling">Modeling</a></li>
<li class="second-level"><a href="#parameters">Parameters</a></li>
<li class="third-level"><a href="#example">Example</a></li>
<li class="second-level"><a href="#products">Products</a></li>
<li class="third-level"><a href="#example_1">Example</a></li>
<li class="second-level"><a href="#processing-plants">Processing Plants</a></li>
<li class="third-level"><a href="#example_2">Example</a></li>
<li class="second-level"><a href="#current-limitations">Current limitations</a></li>
</ul> </ul>
</div></div> </div></div>
<div class="col-md-9" role="main"> <div class="col-md-9" role="main">
<h1 id="modeling">Modeling</h1> </div>
<p>The first step when using RELOG is to describe the reverse logistics pipeline and the relevant data. RELOG accepts as input a JSON file with three sections: <code>parameters</code>, <code>products</code> and <code>plants</code>. Below, we describe each section in more detail.</p>
<h2 id="parameters">Parameters</h2>
<p>The <strong>parameters</strong> section describes details about the simulation itself.</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>time horizon (years)</code></td>
<td>Number of years in the simulation.</td>
</tr>
<tr>
<td align="left"><code>building period (years)</code></td>
<td>List of years in which we are allowed to open new plants. For example, if this parameter is set to <code>[1,2,3]</code>, we can only open plants during the first three years. By default, this equals <code>[1]</code>; that is, plants can only be opened during the first year.</td>
</tr>
</tbody>
</table>
<h3 id="example">Example</h3>
<pre><code class="json">{
&quot;parameters&quot;: {
&quot;time horizon (years)&quot;: 2,
&quot;building period (years)&quot;: [1]
}
}
</code></pre>
<h2 id="products">Products</h2>
<p>The <strong>products</strong> section describes all products and subproducts in the simulation. The field <code>instance["Products"]</code> is a dictionary mapping the name of the product to a dictionary which describes its characteristics. Each product description contains the following keys:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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>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>
</table>
<p>Each product may have some amount available at the beginning of each time period. In this case, the key <code>initial amounts</code> maps to a dictionary with the following keys:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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>The longitude of the location.</td>
</tr>
<tr>
<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">{
&quot;products&quot;: {
&quot;P1&quot;: {
&quot;initial amounts&quot;: {
&quot;C1&quot;: {
&quot;latitude (deg)&quot;: 7.0,
&quot;longitude (deg)&quot;: 7.0,
&quot;amount (tonne)&quot;: [934.56, 934.56]
},
&quot;C2&quot;: {
&quot;latitude (deg)&quot;: 7.0,
&quot;longitude (deg)&quot;: 19.0,
&quot;amount (tonne)&quot;: [198.95, 198.95]
},
&quot;C3&quot;: {
&quot;latitude (deg)&quot;: 84.0,
&quot;longitude (deg)&quot;: 76.0,
&quot;amount (tonne)&quot;: [212.97, 212.97]
}
},
&quot;transportation cost ($/km/tonne)&quot;: [0.015, 0.015],
&quot;transportation energy (J/km/tonne)&quot;: [0.12, 0.11],
&quot;transportation emissions (tonne/km/tonne)&quot;: {
&quot;CO2&quot;: [0.052, 0.050],
&quot;CH4&quot;: [0.003, 0.002]
}
},
&quot;P2&quot;: {
&quot;transportation cost ($/km/tonne)&quot;: [0.022, 0.020]
},
&quot;P3&quot;: {
&quot;transportation cost ($/km/tonne)&quot;: [0.0125, 0.0125]
},
&quot;P4&quot;: {
&quot;transportation cost ($/km/tonne)&quot;: [0.0175, 0.0175]
}
}
}
</code></pre>
<h2 id="processing-plants">Processing Plants</h2>
<p>The <strong>plants</strong> section describes the available types of reverse manufacturing plants, their potential locations and associated costs, as well as their inputs and outputs. The field <code>instance["Plants"]</code> is a dictionary mapping the name of the plant to a dictionary with the following keys:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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/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>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>
</table>
<p>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:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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>The longitude of the location, in degrees.</td>
</tr>
<tr>
<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>A dictionary describing what plant sizes are allowed, and their characteristics.</td>
</tr>
</tbody>
</table>
<p>The keys in the <code>disposal</code> dictionary should be the names of the products. The values are dictionaries with the following keys:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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>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 (tonne)</code> dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys:</p>
<table>
<thead>
<tr>
<th align="left">Key</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<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>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>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">{
&quot;plants&quot;: {
&quot;F1&quot;: {
&quot;input&quot;: &quot;P1&quot;,
&quot;outputs (tonne/tonne)&quot;: {
&quot;P2&quot;: 0.2,
&quot;P3&quot;: 0.5
},
&quot;energy (GJ/tonne)&quot;: [0.12, 0.11],
&quot;emissions (tonne/tonne)&quot;: {
&quot;CO2&quot;: [0.052, 0.050],
&quot;CH4&quot;: [0.003, 0.002]
},
&quot;locations&quot;: {
&quot;L1&quot;: {
&quot;latitude (deg)&quot;: 0.0,
&quot;longitude (deg)&quot;: 0.0,
&quot;disposal&quot;: {
&quot;P2&quot;: {
&quot;cost ($/tonne)&quot;: [-10.0, -12.0],
&quot;limit (tonne)&quot;: [1.0, 1.0]
}
},
&quot;capacities (tonne)&quot;: {
&quot;100&quot;: {
&quot;opening cost ($)&quot;: [500, 530],
&quot;fixed operating cost ($)&quot;: [300.0, 310.0],
&quot;variable operating cost ($/tonne)&quot;: [5.0, 5.2]
},
&quot;500&quot;: {
&quot;opening cost ($)&quot;: [750, 760],
&quot;fixed operating cost ($)&quot;: [400.0, 450.0],
&quot;variable operating cost ($/tonne)&quot;: [5.0, 5.2]
}
}
}
}
}
}
}
</code></pre>
<h2 id="current-limitations">Current limitations</h2>
<ul>
<li>Each plant can only be opened exactly once. After open, the plant remains open until the end of the simulation.</li>
<li>Plants can be expanded at any time, even long after they are open.</li>
<li>All material available at the beginning of a time period must be entirely processed by the end of that time period. It is not possible to store unprocessed materials from one time period to the next.</li>
<li>Up to two plant sizes are currently supported. Variable operating costs must be the same for all plant sizes.</li>
</ul></div>
</div> </div>

File diff suppressed because one or more lines are too long

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-07</lastmod> <lastmod>2020-08-21</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-07</lastmod> <lastmod>2020-08-21</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-07</lastmod> <lastmod>2020-08-21</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2020-08-07</lastmod> <lastmod>2020-08-21</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
</urlset> </urlset>

Binary file not shown.

@ -11,7 +11,7 @@
<link rel="shortcut icon" href="../img/favicon.ico"> <link rel="shortcut icon" href="../img/favicon.ico">
<title>Optimize - RELOG</title> <title>Usage - RELOG</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
@ -74,20 +74,20 @@
<li > <li class="active">
<a href="../install/">Install</a> <a href="./">Usage</a>
</li> </li>
<li > <li >
<a href="../model/">Model</a> <a href="../format/">Data Format</a>
</li> </li>
<li class="active"> <li >
<a href="./">Optimize</a> <a href="../model/">Optimization Model</a>
</li> </li>
@ -100,17 +100,17 @@
</a> </a>
</li> </li>
<li > <li >
<a rel="prev" href="../model/"> <a rel="prev" href="..">
<i class="fas fa-arrow-left"></i> Previous <i class="fas fa-arrow-left"></i> Previous
</a> </a>
</li> </li>
<li class="disabled"> <li >
<a rel="next" > <a rel="next" href="../format/">
Next <i class="fas fa-arrow-right"></i> Next <i class="fas fa-arrow-right"></i>
</a> </a>
</li> </li>
<li> <li>
<a href="https://github.com/ANL-CEEESA/RELOG/edit/master/src/docs/optimize.md"><i class="fab fa-github"></i> Edit on GitHub</a> <a href="https://github.com/ANL-CEEESA/RELOG/edit/master/src/docs/usage.md"><i class="fab fa-github"></i> Edit on GitHub</a>
</li> </li>
</ul> </ul>
</div> </div>
@ -122,18 +122,79 @@
<div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary"> <div class="col-md-3"><div class="bs-sidebar hidden-print affix well" role="complementary">
<ul class="nav bs-sidenav"> <ul class="nav bs-sidenav">
<li class="first-level active"><a href="#optimizing">Optimizing</a></li> <li class="first-level active"><a href="#usage">Usage</a></li>
<li class="second-level"><a href="#1-installation">1. Installation</a></li>
<li class="second-level"><a href="#2-modeling-the-problem">2. Modeling the problem</a></li>
<li class="second-level"><a href="#3-running-the-optimization">3. Running the optimization</a></li>
<li class="second-level"><a href="#4-advanced-options">4. Advanced options</a></li>
<li class="third-level"><a href="#41-changing-the-solver">4.1 Changing the solver</a></li>
</ul> </ul>
</div></div> </div></div>
<div class="col-md-9" role="main"> <div class="col-md-9" role="main">
<h1 id="optimizing">Optimizing</h1> <h1 id="usage">Usage</h1>
<h2 id="1-installation">1. Installation</h2>
<p>To use RELOG, the first step is to install the <a href="https://julialang.org/">Julia programming language</a> on your machine. Note that RELOG was developed and tested with Julia 1.5 and may not be compatible with newer versions. After Julia is installed, launch the Julia console, type <code>]</code> to switch to package manger mode, then run:</p>
<pre><code class="text">(@v1.5) pkg&gt; add https://github.com/ANL-CEEESA/RELOG.git
</code></pre>
<p>After the package and all its dependencies have been installed, please run the RELOG test suite, as shown below, to make sure that the package has been correctly installed:</p>
<pre><code class="text">(@v1.5) pkg&gt; test RELOG
</code></pre>
<p>To update the package to a newer version, type <code>]</code> to enter the package manager mode, then run:</p>
<pre><code class="text">(@v1.5) pkg&gt; update RELOG
</code></pre>
<h2 id="2-modeling-the-problem">2. Modeling the problem</h2>
<p>The two main model components in RELOG are <strong>products</strong> and <strong>plants</strong>.</p>
<p>A <strong>product</strong> is any material that needs to be recycled, any intermediary product produced during the recycling process, or any product recovered at the end of the process. For example, in a NiMH battery recycling study case, products could include (i) the original batteries to be recycled; (ii) the cathode and anode parts of the battery; (iii) rare-earth elements and (iv) scrap metals.</p>
<ul>
<li>
<p>The model assumes that some products are initially available at user-specified locations (described by their latitude, longitude and the amount available), while other products only become available during the recycling process.</p>
</li>
<li>
<p>Transporting products from one location to another incurs a transportation cost (<code>$/km/tonne</code>), spends some amount of energy (<code>J/km/tonne</code>) and may generate multiple types of emissions (<code>tonne/tonne</code>). All these parameters are user-specified and may be product- and time-specific.</p>
</li>
</ul>
<p>A <strong>plant</strong> is a facility that converts one type of product to another. RELOG assumes that each plant receives a single type of product as input and converts this input into multiple types of products. Multiple types of plants, with different inputs, outputs and performance characteristics, may be specified. In the NiMH battery recycling study case, for example, one type of plant could be a <em>disassembly plant</em>, which converts <em>batteries</em> into <em>cathode</em> and <em>anode</em>. Another type of plant could be <em>anode recycling plant</em>, which converts <em>anode</em> into <em>rare-earth elements</em> and <em>scrap metals</em>.</p>
<ul>
<li>
<p>To process each tonne of input material, plants incur a variable operating cost (<code>$/tonne</code>), spend some amount of energy (<code>GJ/tonne</code>), and produce multiple types of emissions (<code>tonne/tonne</code>). Plants also incur a fixed operating cost (<code>$</code>) regardless of the amount of material they process. All these parameters are user-specified and may be region- and time-specific.</p>
</li>
<li>
<p>Plants can be built at user-specified potential locations. Opening a plant incurs a one-time opening cost (<code>$</code>) which may be region- and time-specific. Plants also have a limited capacity (in <code>tonne</code>), which indicates the maximum amount of input material they are able to process per year. When specifying potential locations for each type of plant, it is also possible to specify the minimum and maximum capacity of the plants that can be built at that particular location. Different plants sizes may have different opening costs and fixed operating costs. After a plant is built, it can be further expanded in the following years, up to its maximum capacity.</p>
</li>
<li>
<p>All products that are initially available must be sent to a plant for processing. All products that are generated by a plant can either be sent to another plant for further processing, or disposed of locally for either a profit or a loss (<code>$/tonne</code>). To model environmental regulations, it is also possible to specify the maximum amount of each product that can be disposed of at each location.</p>
</li>
</ul>
<p>All user parameters specified above must be provided to RELOG as a JSON file, which is fully described in the <a href="../format/">data format page</a>.</p>
<h2 id="3-running-the-optimization">3. Running the optimization</h2>
<p>After creating a JSON file describing the reverse manufacturing process and the input data, the following example illustrates how to use the package to find the optimal set of decisions:</p> <p>After creating a JSON file describing the reverse manufacturing process and the input data, the following example illustrates how to use the package to find the optimal set of decisions:</p>
<pre><code class="julia">using RELOG <pre><code class="julia">using RELOG
RELOG.solve(&quot;/home/user/instance.json&quot;) RELOG.solve(&quot;/home/user/instance.json&quot;,
output=&quot;/home/user/solution.json&quot;)
</code></pre> </code></pre>
<p>The optimal logistics plan will be printed to the screen.</p></div> <p>The optimal logistics plan will be stored in the output file specified. See <a href="../format/">data format page</a> for a description of this output file.</p>
<h2 id="4-advanced-options">4. Advanced options</h2>
<h3 id="41-changing-the-solver">4.1 Changing the solver</h3>
<p>By default, RELOG internally uses <a href="https://github.com/coin-or/Cbc">Cbc</a>, an open-source and freely-available Mixed-Integer Linear Programming solver developed by the <a href="https://www.coin-or.org/">COIN-OR Project</a>. For larger-scale test cases, a commercial solver such as Gurobi, CPLEX or XPRESS is recommended. The following snippet shows how to switch from Cbc to Gurobi, for example:</p>
<pre><code class="julia">using RELOG, Gurobi, JuMP
gurobi = optimizer_with_attributes(Gurobi.Optimizer,
&quot;TimeLimit&quot; =&gt; 3600,
&quot;MIPGap&quot; =&gt; 0.001)
RELOG.solve(&quot;instance.json&quot;,
output=&quot;solution.json&quot;,
optimizer=gurobi)
</code></pre></div>
</div> </div>

@ -5,9 +5,9 @@ repo_url: https://github.com/ANL-CEEESA/RELOG
edit_uri: edit/master/src/docs/ edit_uri: edit/master/src/docs/
nav: nav:
- Home: index.md - Home: index.md
- Install: install.md - Usage: usage.md
- Model: model.md - Data Format: format.md
- Optimize: optimize.md - Optimization Model: model.md
plugins: plugins:
- search - search
markdown_extensions: markdown_extensions:

@ -0,0 +1,174 @@
# Data Format
The first step when using RELOG is to describe the reverse logistics pipeline and the relevant data. RELOG accepts as input a JSON file with three sections: `parameters`, `products` and `plants`. Below, we describe each section in more detail.
## Parameters
The **parameters** section describes details about the simulation itself.
| Key | Description
|:--------------------------|---------------|
|`time horizon (years)` | Number of years in the simulation.
|`building period (years)` | List of years in which we are allowed to open new plants. For example, if this parameter is set to `[1,2,3]`, we can only open plants during the first three years. By default, this equals `[1]`; that is, plants can only be opened during the first year. |
### Example
```json
{
"parameters": {
"time horizon (years)": 2,
"building period (years)": [1]
}
}
```
## Products
The **products** section describes all products and subproducts in the simulation. The field `instance["Products"]` is a dictionary mapping the name of the product to a dictionary which describes its characteristics. Each product description contains the following keys:
| Key | Description
|:--------------------------------------|---------------|
|`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.
### Example
```json
{
"products": {
"P1": {
"initial amounts": {
"C1": {
"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]
},
"C3": {
"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.022, 0.020]
},
"P3": {
"transportation cost ($/km/tonne)": [0.0125, 0.0125]
},
"P4": {
"transportation cost ($/km/tonne)": [0.0175, 0.0175]
}
}
}
```
## Processing Plants
The **plants** section describes the available types of reverse manufacturing plants, their potential locations and associated costs, as well as their inputs and outputs. The field `instance["Plants"]` is a dictionary mapping the name of the plant to a dictionary with the following keys:
| Key | Description
|:------------------------|---------------|
| `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.
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.
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.
### Example
```json
{
"plants": {
"F1": {
"input": "P1",
"outputs (tonne/tonne)": {
"P2": 0.2,
"P3": 0.5
},
"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": {
"P2": {
"cost ($/tonne)": [-10.0, -12.0],
"limit (tonne)": [1.0, 1.0]
}
},
"capacities (tonne)": {
"100": {
"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]
}
}
}
}
}
}
}
```
## Current limitations
* Each plant can only be opened exactly once. After open, the plant remains open until the end of the simulation.
* Plants can be expanded at any time, even long after they are open.
* All material available at the beginning of a time period must be entirely processed by the end of that time period. It is not possible to store unprocessed materials from one time period to the next.
* Up to two plant sizes are currently supported. Variable operating costs must be the same for all plant sizes.

@ -1,13 +1,13 @@
# RELOG: Reverse Logistics Optimization # RELOG: Reverse Logistics Optimization
**RELOG** is a supply chain optimization package focusing on reverse logistics and reverse manufacturing. For example, the package can be used to determine where to build recycling plants, what sizes should they have and which customers should be served by which plants. The package supports customized reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods. **RELOG** is a supply chain optimization package focusing on reverse logistics and reverse manufacturing. The package uses Mixed-Integer Linear Programming to determine where to build recycling plants, what size should these plants have and which customers should be served by which plants. The package supports custom reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods.
### Table of Contents ### Table of Contents
* [Installation](install.md) * [Usage](usage.md)
* [Modeling](model.md) * [Data Format](format.md)
* [Optimizing](optimize.md) * [Optimization model](model.md)
### Source Code ### Source Code

@ -1,14 +0,0 @@
Installation
============
The package was developed and tested with Julia 1.3 and may not be compatible with newer versions. To install it, launch the Julia console, type `]` to switch to package manager mode and run:
```text
pkg> add https://github.com/ANL-CEEESA/RELOG.git
```
To make sure that the package has been correctly installed:
```text
pkg> test RELOG
```

@ -1,174 +0,0 @@
# Modeling
The first step when using RELOG is to describe the reverse logistics pipeline and the relevant data. RELOG accepts as input a JSON file with three sections: `parameters`, `products` and `plants`. Below, we describe each section in more detail.
## Parameters
The **parameters** section describes details about the simulation itself.
| Key | Description
|:--------------------------|---------------|
|`time horizon (years)` | Number of years in the simulation.
|`building period (years)` | List of years in which we are allowed to open new plants. For example, if this parameter is set to `[1,2,3]`, we can only open plants during the first three years. By default, this equals `[1]`; that is, plants can only be opened during the first year. |
### Example
```json
{
"parameters": {
"time horizon (years)": 2,
"building period (years)": [1]
}
}
```
## Products
The **products** section describes all products and subproducts in the simulation. The field `instance["Products"]` is a dictionary mapping the name of the product to a dictionary which describes its characteristics. Each product description contains the following keys:
| Key | Description
|:--------------------------------------|---------------|
|`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.
### Example
```json
{
"products": {
"P1": {
"initial amounts": {
"C1": {
"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]
},
"C3": {
"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.022, 0.020]
},
"P3": {
"transportation cost ($/km/tonne)": [0.0125, 0.0125]
},
"P4": {
"transportation cost ($/km/tonne)": [0.0175, 0.0175]
}
}
}
```
## Processing Plants
The **plants** section describes the available types of reverse manufacturing plants, their potential locations and associated costs, as well as their inputs and outputs. The field `instance["Plants"]` is a dictionary mapping the name of the plant to a dictionary with the following keys:
| Key | Description
|:------------------------|---------------|
| `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.
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.
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.
### Example
```json
{
"plants": {
"F1": {
"input": "P1",
"outputs (tonne/tonne)": {
"P2": 0.2,
"P3": 0.5
},
"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": {
"P2": {
"cost ($/tonne)": [-10.0, -12.0],
"limit (tonne)": [1.0, 1.0]
}
},
"capacities (tonne)": {
"100": {
"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]
}
}
}
}
}
}
}
```
## Current limitations
* Each plant can only be opened exactly once. After open, the plant remains open until the end of the simulation.
* Plants can be expanded at any time, even long after they are open.
* All material available at the beginning of a time period must be entirely processed by the end of that time period. It is not possible to store unprocessed materials from one time period to the next.
* Up to two plant sizes are currently supported. Variable operating costs must be the same for all plant sizes.

@ -1,11 +0,0 @@
# Optimizing
After creating a JSON file describing the reverse manufacturing process and the input data, the following example illustrates how to use the package to find the optimal set of decisions:
```julia
using RELOG
RELOG.solve("/home/user/instance.json")
```
The optimal logistics plan will be printed to the screen.

@ -0,0 +1,72 @@
Usage
=====
## 1. Installation
To use RELOG, the first step is to install the [Julia programming language](https://julialang.org/) on your machine. Note that RELOG was developed and tested with Julia 1.5 and may not be compatible with newer versions. After Julia is installed, launch the Julia console, type `]` to switch to package manger mode, then run:
```text
(@v1.5) pkg> add https://github.com/ANL-CEEESA/RELOG.git
```
After the package and all its dependencies have been installed, please run the RELOG test suite, as shown below, to make sure that the package has been correctly installed:
```text
(@v1.5) pkg> test RELOG
```
To update the package to a newer version, type `]` to enter the package manager mode, then run:
```text
(@v1.5) pkg> update RELOG
```
## 2. Modeling the problem
The two main model components in RELOG are **products** and **plants**.
A **product** is any material that needs to be recycled, any intermediary product produced during the recycling process, or any product recovered at the end of the process. For example, in a NiMH battery recycling study case, products could include (i) the original batteries to be recycled; (ii) the cathode and anode parts of the battery; (iii) rare-earth elements and (iv) scrap metals.
* The model assumes that some products are initially available at user-specified locations (described by their latitude, longitude and the amount available), while other products only become available during the recycling process.
* Transporting products from one location to another incurs a transportation cost (`$/km/tonne`), spends some amount of energy (`J/km/tonne`) and may generate multiple types of emissions (`tonne/tonne`). All these parameters are user-specified and may be product- and time-specific.
A **plant** is a facility that converts one type of product to another. RELOG assumes that each plant receives a single type of product as input and converts this input into multiple types of products. Multiple types of plants, with different inputs, outputs and performance characteristics, may be specified. In the NiMH battery recycling study case, for example, one type of plant could be a *disassembly plant*, which converts *batteries* into *cathode* and *anode*. Another type of plant could be *anode recycling plant*, which converts *anode* into *rare-earth elements* and *scrap metals*.
* To process each tonne of input material, plants incur a variable operating cost (`$/tonne`), spend some amount of energy (`GJ/tonne`), and produce multiple types of emissions (`tonne/tonne`). Plants also incur a fixed operating cost (`$`) regardless of the amount of material they process. All these parameters are user-specified and may be region- and time-specific.
* Plants can be built at user-specified potential locations. Opening a plant incurs a one-time opening cost (`$`) which may be region- and time-specific. Plants also have a limited capacity (in `tonne`), which indicates the maximum amount of input material they are able to process per year. When specifying potential locations for each type of plant, it is also possible to specify the minimum and maximum capacity of the plants that can be built at that particular location. Different plants sizes may have different opening costs and fixed operating costs. After a plant is built, it can be further expanded in the following years, up to its maximum capacity.
* All products that are initially available must be sent to a plant for processing. All products that are generated by a plant can either be sent to another plant for further processing, or disposed of locally for either a profit or a loss (`$/tonne`). To model environmental regulations, it is also possible to specify the maximum amount of each product that can be disposed of at each location.
All user parameters specified above must be provided to RELOG as a JSON file, which is fully described in the [data format page](format.md).
## 3. Running the optimization
After creating a JSON file describing the reverse manufacturing process and the input data, the following example illustrates how to use the package to find the optimal set of decisions:
```julia
using RELOG
RELOG.solve("/home/user/instance.json",
output="/home/user/solution.json")
```
The optimal logistics plan will be stored in the output file specified. See [data format page](format.md) for a description of this output file.
## 4. Advanced options
### 4.1 Changing the solver
By default, RELOG internally uses [Cbc](https://github.com/coin-or/Cbc), an open-source and freely-available Mixed-Integer Linear Programming solver developed by the [COIN-OR Project](https://www.coin-or.org/). For larger-scale test cases, a commercial solver such as Gurobi, CPLEX or XPRESS is recommended. The following snippet shows how to switch from Cbc to Gurobi, for example:
```julia
using RELOG, Gurobi, JuMP
gurobi = optimizer_with_attributes(Gurobi.Optimizer,
"TimeLimit" => 3600,
"MIPGap" => 0.001)
RELOG.solve("instance.json",
output="solution.json",
optimizer=gurobi)
```

@ -2,7 +2,7 @@
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved. # Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
# Released under the modified BSD license. See COPYING.md for more details. # Released under the modified BSD license. See COPYING.md for more details.
using JSON, JSONSchema using JSON, JSONSchema, Printf
mutable struct Product mutable struct Product
@ -204,5 +204,8 @@ function parse(json::Dict)::Instance
end end
end end
@info @sprintf("%12d collection centers", length(collection_centers))
@info @sprintf("%12d candidate plant locations", length(plants))
return Instance(T, products, collection_centers, plants, building_period) return Instance(T, products, collection_centers, plants, building_period)
end end

@ -196,9 +196,14 @@ default_milp_optimizer = optimizer_with_attributes(Cbc.Optimizer, "logLevel" =>
default_lp_optimizer = optimizer_with_attributes(Clp.Optimizer, "LogLevel" => 0) default_lp_optimizer = optimizer_with_attributes(Clp.Optimizer, "LogLevel" => 0)
function solve(instance::Instance; function solve(instance::Instance;
milp_optimizer=default_milp_optimizer, optimizer=nothing,
lp_optimizer=default_lp_optimizer, output=nothing)
output_filename=nothing)
milp_optimizer = lp_optimizer = optimizer
if optimizer == nothing
milp_optimizer = optimizer
lp_optimizer = optimizer
else
@info "Building graph..." @info "Building graph..."
graph = RELOG.build_graph(instance) graph = RELOG.build_graph(instance)
@ -234,9 +239,9 @@ function solve(instance::Instance;
@info "Extracting solution..." @info "Extracting solution..."
solution = get_solution(model) solution = get_solution(model)
if output_filename != nothing if output != nothing
@info "Writing solution: $output_filename" @info "Writing solution: $output"
open(output_filename, "w") do file open(output, "w") do file
JSON.print(file, solution, 2) JSON.print(file, solution, 2)
end end
end end

Loading…
Cancel
Save