Update 0.5 docs

docs
Alinson S. Xavier 4 years ago
parent 4dbf20c1fa
commit 6e68a330d5

@ -136,6 +136,7 @@
<li class="third-level"><a href="#parameters">Parameters</a></li> <li class="third-level"><a href="#parameters">Parameters</a></li>
<li class="third-level"><a href="#products">Products</a></li> <li class="third-level"><a href="#products">Products</a></li>
<li class="third-level"><a href="#processing-plants">Processing plants</a></li> <li class="third-level"><a href="#processing-plants">Processing plants</a></li>
<li class="third-level"><a href="#geographic-database">Geographic database</a></li>
<li class="third-level"><a href="#current-limitations">Current limitations</a></li> <li class="third-level"><a href="#current-limitations">Current limitations</a></li>
<li class="second-level"><a href="#output-data-format-json">Output Data Format (JSON)</a></li> <li class="second-level"><a href="#output-data-format-json">Output Data Format (JSON)</a></li>
@ -436,6 +437,50 @@
} }
} }
</code></pre> </code></pre>
<h3 id="geographic-database">Geographic database</h3>
<p>Instead of specifying locations using latitudes and longitudes, it is also possible to specify them using unique identifiers, such as the name of a US state, or the county FIPS code. This works anywhere <code>latitude (deg)</code> and <code>longitude (deg)</code> are expected. For example, instead of:</p>
<pre><code class="language-json">{
&quot;initial amounts&quot;: {
&quot;C1&quot;: {
&quot;latitude (deg)&quot;: 37.27182,
&quot;longitude (deg)&quot;: -119.2704,
&quot;amount (tonne)&quot;: [934.56, 934.56]
},
}
}
</code></pre>
<p>is is possible to write:</p>
<pre><code class="language-json">{
&quot;initial amounts&quot;: {
&quot;C1&quot;: {
&quot;location&quot;: &quot;us-state:CA&quot;,
&quot;amount (tonne)&quot;: [934.56, 934.56]
},
}
}
</code></pre>
<p>Location names follow the format <code>db:id</code>, where <code>db</code> is the name of the database and <code>id</code> is the identifier for a specific location. RELOG currently includes the following databases:</p>
<table>
<thead>
<tr>
<th>Database</th>
<th>Description</th>
<th>Examples</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>us-state</code></td>
<td>List of states of the United States.</td>
<td><code>us-state:IL</code> (State of Illinois)</td>
</tr>
<tr>
<td><code>2018-us-county</code></td>
<td>List of United States counties, as of 2018. IDs are 5-digit FIPS codes.</td>
<td><code>2018-us-county:17043</code> (DuPage county in Illinois)</td>
</tr>
</tbody>
</table>
<h3 id="current-limitations">Current limitations</h3> <h3 id="current-limitations">Current limitations</h3>
<ul> <ul>
<li>Each plant can only be opened exactly once. After open, the plant remains open until the end of the simulation.</li> <li>Each plant can only be opened exactly once. After open, the plant remains open until the end of the simulation.</li>

@ -296,5 +296,5 @@ POSSIBILITY OF SUCH DAMAGE.
<!-- <!--
MkDocs version : 1.1.2 MkDocs version : 1.1.2
Build Date UTC : 2021-01-06 15:17:22.880432+00:00 Build Date UTC : 2021-10-15 13:15:56.812011+00:00
--> -->

@ -140,6 +140,8 @@
<li class="second-level"><a href="#plant-emissions-report">Plant emissions report</a></li> <li class="second-level"><a href="#plant-emissions-report">Plant emissions report</a></li>
<li class="third-level"><a href="#sample-charts_2">Sample charts</a></li> <li class="third-level"><a href="#sample-charts_2">Sample charts</a></li>
<li class="second-level"><a href="#products-report">Products report</a></li>
<li class="second-level"><a href="#transportation-report">Transportation report</a></li> <li class="second-level"><a href="#transportation-report">Transportation report</a></li>
<li class="third-level"><a href="#sample-charts_3">Sample charts</a></li> <li class="third-level"><a href="#sample-charts_3">Sample charts</a></li>
@ -154,8 +156,7 @@
<p>In addition to the full output format described in <a href="../format/">data formats</a>, RELOG can also generate a number of simplified reports in tabular data format (CSV), which can be more easily processed by spreadsheet software (such as Microsoft Excel), by data analysis libraries (such as Pandas) or by relational databases (such as SQLite).</p> <p>In addition to the full output format described in <a href="../format/">data formats</a>, RELOG can also generate a number of simplified reports in tabular data format (CSV), which can be more easily processed by spreadsheet software (such as Microsoft Excel), by data analysis libraries (such as Pandas) or by relational databases (such as SQLite).</p>
<p>In this page, we also illustrate what types of charts and visualizations can be produced from these tabular data files. The sample charts have been produced using Python, matplotlib, seaborn and geopandas.</p> <p>In this page, we also illustrate what types of charts and visualizations can be produced from these tabular data files. The sample charts have been produced using Python, matplotlib, seaborn and geopandas.</p>
<h2 id="plants-report">Plants report</h2> <h2 id="plants-report">Plants report</h2>
<p>Report showing plant costs, capacities, energy expenditure and utilization factors.</p> <p>Report showing plant costs, capacities, energy expenditure and utilization factors. Generated by <code>RELOG.write_plants_report(solution, filename)</code>.</p>
<p>Generated by <code>RELOG.write_plants_report(solution, filename)</code>. For a concrete example, see <a href="https://github.com/ANL-CEEESA/RELOG/blob/master/test/fixtures/nimh_plants.csv">nimh_plants.csv</a>.</p>
<table> <table>
<thead> <thead>
<tr> <tr>
@ -174,7 +175,7 @@
</tr> </tr>
<tr> <tr>
<td align="left"><code>year</code></td> <td align="left"><code>year</code></td>
<td>What year this row corresponds to. This reports includes one row for each year in the simulation.</td> <td>What year this row corresponds to. This reports includes one row for each year.</td>
</tr> </tr>
<tr> <tr>
<td align="left"><code>latitude (deg)</code></td> <td align="left"><code>latitude (deg)</code></td>
@ -270,8 +271,7 @@ gp.GeoDataFrame(data, geometry=points).plot(ax=ax);
</code></pre> </code></pre>
<p><img src="../images/ex_plant_locations.png" width="1000px"/></p> <p><img src="../images/ex_plant_locations.png" width="1000px"/></p>
<h2 id="plant-outputs-report">Plant outputs report</h2> <h2 id="plant-outputs-report">Plant outputs report</h2>
<p>Report showing amount of products produced, sent and disposed of by each plant, as well as disposal costs.</p> <p>Report showing amount of products produced, sent and disposed of by each plant, as well as disposal costs. Generated by <code>RELOG.write_plant_outputs_report(solution, filename)</code>.</p>
<p>Generated by <code>RELOG.write_plant_outputs_report(solution, filename)</code>. For a concrete example, see <a href="https://github.com/ANL-CEEESA/RELOG/blob/master/test/fixtures/nimh_plant_outputs.csv">nimh_plant_outputs.csv</a>.</p>
<table> <table>
<thead> <thead>
<tr> <tr>
@ -290,7 +290,7 @@ gp.GeoDataFrame(data, geometry=points).plot(ax=ax);
</tr> </tr>
<tr> <tr>
<td align="left"><code>year</code></td> <td align="left"><code>year</code></td>
<td>What year this row corresponds to. This reports includes one row for each year in the simulation.</td> <td>What year this row corresponds to. This reports includes one row for each year.</td>
</tr> </tr>
<tr> <tr>
<td align="left"><code>product name</code></td> <td align="left"><code>product name</code></td>
@ -331,8 +331,7 @@ sns.barplot(x=&quot;amount produced (tonne)&quot;,
</code></pre> </code></pre>
<p><img src="../images/ex_amount_produced.png" width="500px"/></p> <p><img src="../images/ex_amount_produced.png" width="500px"/></p>
<h2 id="plant-emissions-report">Plant emissions report</h2> <h2 id="plant-emissions-report">Plant emissions report</h2>
<p>Report showing amount of emissions produced by each plant.</p> <p>Report showing amount of emissions produced by each plant. Generated by <code>RELOG.write_plant_emissions_report(solution, filename)</code>.</p>
<p>Generated by <code>RELOG.write_plant_emissions_report(solution, filename)</code>. For a concrete example, see <a href="https://github.com/ANL-CEEESA/RELOG/blob/master/test/fixtures/nimh_plant_emissions.csv">nimh_plant_emissions.csv</a>.</p>
<table> <table>
<thead> <thead>
<tr> <tr>
@ -379,9 +378,48 @@ sns.barplot(x=&quot;plant type&quot;,
.reset_index()); .reset_index());
</code></pre> </code></pre>
<p><img src="../images/ex_emissions.png" width="500px"/></p> <p><img src="../images/ex_emissions.png" width="500px"/></p>
<h2 id="products-report">Products report</h2>
<p>Report showing primary product amounts, locations and marginal costs. Generated by <code>RELOG.write_products_report(solution, filename)</code>.</p>
<table>
<thead>
<tr>
<th align="left">Column</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>product name</code></td>
<td>Product name.</td>
</tr>
<tr>
<td align="left"><code>location name</code></td>
<td>Name of the collection center.</td>
</tr>
<tr>
<td align="left"><code>latitude (deg)</code></td>
<td>Latitude of the collection center.</td>
</tr>
<tr>
<td align="left"><code>longitude (deg)</code></td>
<td>Longitude of the collection center.</td>
</tr>
<tr>
<td align="left"><code>year</code></td>
<td>What year this row corresponds to. This reports includes one row for each year.</td>
</tr>
<tr>
<td align="left"><code>amount (tonne)</code></td>
<td>Amount of product available at this collection center.</td>
</tr>
<tr>
<td align="left"><code>marginal cost ($/tonne)</code></td>
<td>Cost to process one additional tonne of this product coming from this collection center.</td>
</tr>
</tbody>
</table>
<h2 id="transportation-report">Transportation report</h2> <h2 id="transportation-report">Transportation report</h2>
<p>Report showing amount of product sent from initial locations to plants, and from one plant to another. Includes the distance between each pair of locations, amount-distance shipped, transportation costs and energy expenditure.</p> <p>Report showing amount of product sent from initial locations to plants, and from one plant to another. Includes the distance between each pair of locations, amount-distance shipped, transportation costs and energy expenditure. Generated by <code>RELOG.write_transportation_report(solution, filename)</code>.</p>
<p>Generated by <code>RELOG.write_transportation_report(solution, filename)</code>. For a concrete example, see <a href="https://github.com/ANL-CEEESA/RELOG/blob/master/test/fixtures/nimh_transportation.csv">nimh_transportation.csv</a>.</p>
<table> <table>
<thead> <thead>
<tr> <tr>
@ -510,8 +548,7 @@ gp.GeoDataFrame(data, geometry=points).plot(ax=ax,
</code></pre> </code></pre>
<p><img src="../images/ex_transportation.png" width="1000px"/></p> <p><img src="../images/ex_transportation.png" width="1000px"/></p>
<h2 id="transportation-emissions-report">Transportation emissions report</h2> <h2 id="transportation-emissions-report">Transportation emissions report</h2>
<p>Report showing emissions for each trip between initial locations and plants, and between pairs of plants.</p> <p>Report showing emissions for each trip between initial locations and plants, and between pairs of plants. Generated by <code>RELOG.write_transportation_emissions_report(solution, filename)</code>.</p>
<p>Generated by <code>RELOG.write_transportation_emissions_report(solution, filename)</code>. For a concrete example, see <a href="https://github.com/ANL-CEEESA/RELOG/blob/master/test/fixtures/nimh_transportation_emissions.csv">nimh_transportation_emissions.csv</a>.</p>
<table> <table>
<thead> <thead>
<tr> <tr>

File diff suppressed because one or more lines are too long

@ -1,23 +1,23 @@
<?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>2021-01-06</lastmod> <lastmod>2021-10-15</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2021-01-06</lastmod> <lastmod>2021-10-15</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2021-01-06</lastmod> <lastmod>2021-10-15</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2021-01-06</lastmod> <lastmod>2021-10-15</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url><url> </url><url>
<loc>None</loc> <loc>None</loc>
<lastmod>2021-01-06</lastmod> <lastmod>2021-10-15</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
</url> </url>
</urlset> </urlset>

Binary file not shown.

@ -137,10 +137,12 @@
<li class="second-level"><a href="#3-running-the-optimization">3. Running the optimization</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="second-level"><a href="#4-what-if-analysis">4. What-If Analysis</a></li>
<li class="third-level"><a href="#41-changing-the-solver">4.1 Changing the solver</a></li> <li class="second-level"><a href="#5-advanced-options">5. Advanced options</a></li>
<li class="third-level"><a href="#42-multi-period-heuristics">4.2 Multi-period heuristics</a></li>
<li class="third-level"><a href="#51-changing-the-solver">5.1 Changing the solver</a></li>
<li class="third-level"><a href="#52-multi-period-heuristics">5.2 Multi-period heuristics</a></li>
</ul> </ul>
</div></div> </div></div>
<div class="col-md-9" role="main"> <div class="col-md-9" role="main">
@ -202,8 +204,37 @@ RELOG.write_plants_report(solution, &quot;plants.csv&quot;)
RELOG.write_transportation_report(solution, &quot;transportation.csv&quot;) RELOG.write_transportation_report(solution, &quot;transportation.csv&quot;)
</code></pre> </code></pre>
<p>For a complete description of the file formats above, and for a complete list of available reports, see the <a href="../format/">data format page</a>.</p> <p>For a complete description of the file formats above, and for a complete list of available reports, see the <a href="../format/">data format page</a>.</p>
<h2 id="4-advanced-options">4. Advanced options</h2> <h2 id="4-what-if-analysis">4. What-If Analysis</h2>
<h3 id="41-changing-the-solver">4.1 Changing the solver</h3> <p>Fundamentally, RELOG decides when and where to build plants based on a deterministic optimization problem that minimizes costs for a particular input file provided by the user. In practical situations, it may not be possible to perfectly estimate some (or most) entries in this input file in advance, such as costs, demands and emissions. In this situation, it may be interesting to evaluate how well does the facility location plan produced by RELOG work if costs, demands and emissions turn out to be different.</p>
<p>To simplify this what-if analysis, RELOG provides the <code>resolve</code> method, which updates a previous solution based on a new scenario, but keeps some of the previous decisions fixed. More precisely, given an optimal solution produced by RELOG and a new input file describing the new scenario, the <code>resolve</code> method reoptimizes the supply chain and produces a new solution which still builds the same set of plants as before, in exactly the same locations and with the same capacities, but that may now utilize the plants differently, based on the new data. For example, in the new solution, plants that were previously used at full capacity may now be utilized at half-capacity instead. As another example, regions that were previously served by a certain plant may now be served by a different one.</p>
<p>The following snippet shows how to use the method:</p>
<pre><code class="language-julia"># Import package
using RELOG
# Optimize for the average scenario
solution_avg, model_avg = RELOG.solve(&quot;input_avg.json&quot;, return_model=true)
# Write reports for the average scenario
RELOG.write_plants_report(solution_avg, &quot;plants_avg.csv&quot;)
RELOG.write_transportation_report(solution_avg, &quot;transportation_avg.csv&quot;)
# Re-optimize for the high-demand scenario, keeping plants fixed
solution_high = RELOG.resolve(model_avg, &quot;input_high.json&quot;)
# Write reports for the high-demand scenario
RELOG.write_plants_report(solution_high, &quot;plants_high.csv&quot;)
RELOG.write_transportation_report(solution_high, &quot;transportation_high.csv&quot;)
</code></pre>
<p>To use the <code>resolve</code> method, the new input file should be very similar to the original one. Only the following entries are allowed to change:</p>
<ul>
<li><strong>Products:</strong> Transportation costs, energy, emissions and initial amounts (latitude, longitude and amount).</li>
<li><strong>Plants:</strong> Energy and emissions.</li>
<li><strong>Plant's location:</strong> Latitude and longitude.</li>
<li><strong>Plant's storage:</strong> Cost.</li>
<li><strong>Plant's capacity:</strong> Opening cost, fixed operating cost and variable operating cost.</li>
</ul>
<h2 id="5-advanced-options">5. Advanced options</h2>
<h3 id="51-changing-the-solver">5.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> <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="language-julia">using RELOG, Gurobi, JuMP <pre><code class="language-julia">using RELOG, Gurobi, JuMP
@ -215,7 +246,7 @@ RELOG.solve(&quot;instance.json&quot;,
output=&quot;solution.json&quot;, output=&quot;solution.json&quot;,
optimizer=gurobi) optimizer=gurobi)
</code></pre> </code></pre>
<h3 id="42-multi-period-heuristics">4.2 Multi-period heuristics</h3> <h3 id="52-multi-period-heuristics">5.2 Multi-period heuristics</h3>
<p>For large-scale instances, it may be too time-consuming to find an exact optimal solution to the multi-period version of the problem. For these situations, RELOG includes a heuristic solution method, which proceeds as follows:</p> <p>For large-scale instances, it may be too time-consuming to find an exact optimal solution to the multi-period version of the problem. For these situations, RELOG includes a heuristic solution method, which proceeds as follows:</p>
<ol> <ol>
<li> <li>

Loading…
Cancel
Save