'+ title + '
' + summary +'
diff --git a/dev/404.html b/dev/404.html new file mode 100644 index 0000000..51a7eb5 --- /dev/null +++ b/dev/404.html @@ -0,0 +1,232 @@ + + + +
+ + + + + + + + + +In this page, we describe the input and output JSON formats used by RELOG. In addition to these, RELOG can also produce simplified reports in tabular data format.
+RELOG accepts as input a JSON file with three sections: parameters
, products
and plants
. Below, we describe each section in more detail.
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. |
+
{
+ "parameters": {
+ "time horizon (years)": 2,
+ "building period (years)": [1]
+ }
+}
+
+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 time series. | +
transportation energy (J/km/tonne) |
+The energy required to transport this product. Must be a time series. 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 time series. 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 time series. | +
disposal limit (tonne) |
+Total amount of product that can be disposed of across all collection centers. If omitted, all product must be processed. This parameter has no effect on product disposal at plants. | +
disposal cost ($/tonne) |
+Cost of disposing one tonne of this product at a collection center. If omitted, defaults to zero. This parameter has no effect on product disposal costs at plants. | +
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 time series. | +
{
+ "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]
+ },
+ "disposal cost ($/tonne)": [-10.0, -12.0],
+ "disposal limit (tonne)": [1.0, 1.0],
+ },
+ "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]
+ }
+ }
+}
+
+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 time series. 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 time series. 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. | +
storage |
+A dictionary describing the plant's storage. | +
capacities (tonne) |
+A dictionary describing what plant sizes are allowed, and their characteristics. | +
The storage
dictionary should contain the following keys:
Key | +Description | +
---|---|
cost ($/tonne) |
+The cost to store a tonne of input product for one time period. Must be a time series. | +
limit (tonne) |
+The maximum amount of input product this plant can have in storage at any given time. | +
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 time series. | +
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 time series. | +
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 time series. | +
variable operating cost ($/tonne) |
+The cost that the plant incurs to process each tonne of input. Must be a time series. | +
{
+ "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]
+ }
+ },
+ "storage": {
+ "cost ($/tonne)": [5.0, 5.3],
+ "limit (tonne)": 100.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]
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+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 latitude (deg)
and longitude (deg)
are expected. For example, instead of:
{
+ "initial amounts": {
+ "C1": {
+ "latitude (deg)": 37.27182,
+ "longitude (deg)": -119.2704,
+ "amount (tonne)": [934.56, 934.56]
+ },
+ }
+}
+
+is is possible to write:
+{
+ "initial amounts": {
+ "C1": {
+ "location": "us-state:CA",
+ "amount (tonne)": [934.56, 934.56]
+ },
+ }
+}
+
+Location names follow the format db:id
, where db
is the name of the database and id
is the identifier for a specific location. RELOG currently includes the following databases:
Database | +Description | +Examples | +
---|---|---|
us-state |
+List of states of the United States. | +us-state:IL (State of Illinois) |
+
2018-us-county |
+List of United States counties, as of 2018. IDs are 5-digit FIPS codes. | +2018-us-county:17043 (DuPage county in Illinois) |
+
To be documented.
RELOG is an open-source 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.
+RELOG: Reverse Logistics Optimization
+Copyright © 2020, UChicago Argonne, LLC. All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted
+provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice, this list of
+ conditions and the following disclaimer in the documentation and/or other materials provided
+ with the distribution.
+3. Neither the name of the copyright holder nor the names of its contributors may be used to
+ endorse or promote products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
In this page, we describe the precise mathematical optimization model used by RELOG to find the optimal logistics plan. This model is a variation of the classical Facility Location Problem, which has been widely studied in the operations research literature. To simplify the exposition, we present the simplified case where there is only one type of plant.
+Plants:
+$/tonne/km
)$/tonne
)$
)$
)$/tonne
)$/tonne
)$/tonne
)tonne
)tonne
)tonne
)Products:
+tonne/tonne
)tonne
)Transportation:
+$/tonne/km
)km
)tonne
)bool
)tonne
)bool
)tonne
)tonne
)tonne
)tonne
)RELOG minimizes the overall capital, production and transportation costs:
++ +
+In the first line, we have (i) opening costs, if plant starts operating at time $t$, (ii) fixed operating costs, if plant is operational, (iii) additional fixed operating costs coming from expansion performed in all previous time periods up to the current one, and finally (iv) the expansion costs during the current time period. +In the second line, we have storage and variable processing costs. +In the third line, we have transportation costs. +In the fourth line, we have the disposal costs.
++ +
++ +
++ +
++ +
++ +
++ +
++ +
++ +
++ +
In addition to the full output format described in data formats, 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).
+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.
+Report showing plant costs, capacities, energy expenditure and utilization factors. Generated by RELOG.write_plants_report(solution, filename)
.
Column | +Description | +
---|---|
plant type |
+Plant type. | +
location name |
+Location name. | +
year |
+What year this row corresponds to. This reports includes one row for each year. | +
latitude (deg) |
+Latitude of the plant. | +
longitude (deg) |
+Longitude of the plant. | +
capacity (tonne) |
+Capacity of the plant at this point in time. | +
amount received (tonne) |
+Amount of input material received by the plant this year. | +
amount processed (tonne) |
+Amount of input material processed by the plant this year. | +
amount in storage (tonne) |
+Amount of input material in storage at the end of the year. | +
utilization factor (%) |
+Amount processed by the plant this year divided by current plant capacity. | +
energy (GJ) |
+Amount of energy expended by the plant this year. | +
opening cost ($) |
+Amount spent opening the plant. This value is only positive if the plant became operational this year. | +
expansion cost ($) |
+Amount spent this year expanding the plant capacity. | +
fixed operating cost ($) |
+Amount spent for keeping the plant operational this year. | +
variable operating cost ($) |
+Amount spent this year to process the input material. | +
storage cost ($) |
+Amount spent this year on storage. | +
total cost ($) |
+Sum of all previous plant costs. | +
import pandas as pd
+import seaborn as sns; sns.set()
+
+data = pd.read_csv("plants_report.csv")
+sns.barplot(x="year",
+ y="total cost ($)",
+ hue="plant type",
+ data=data.groupby(["plant type", "year"])
+ .sum()
+ .reset_index());
+
+import pandas as pd
+import geopandas as gp
+
+# Plot base map
+world = gp.read_file(gp.datasets.get_path('naturalearth_lowres'))
+ax = world.plot(color='white', edgecolor='50', figsize=(13,6))
+ax.set_ylim([23, 50])
+ax.set_xlim([-128, -65])
+
+# Plot plant locations
+data = pd.read_csv("nimh_plants.csv")
+points = gp.points_from_xy(data["longitude (deg)"],
+ data["latitude (deg)"])
+gp.GeoDataFrame(data, geometry=points).plot(ax=ax);
+
+Report showing amount of products produced, sent and disposed of by each plant, as well as disposal costs. Generated by RELOG.write_plant_outputs_report(solution, filename)
.
Column | +Description | +
---|---|
plant type |
+Plant type. | +
location name |
+Location name. | +
year |
+What year this row corresponds to. This reports includes one row for each year. | +
product name |
+Product being produced. | +
amount produced (tonne) |
+Amount of product produced this year. | +
amount sent (tonne) |
+Amount of product produced by this plant and sent to another plant for further processing this year. | +
amount disposed (tonne) |
+Amount produced produced by this plant and immediately disposed of locally this year. | +
disposal cost ($) |
+Disposal cost for this year. | +
import pandas as pd
+import seaborn as sns; sns.set()
+
+data = pd.read_csv("plant_outputs_report.csv")
+sns.barplot(x="amount produced (tonne)",
+ y="product name",
+ hue="year",
+ data=data.groupby(["product name", "year"])
+ .sum()
+ .reset_index());
+
+Report showing amount of emissions produced by each plant. Generated by RELOG.write_plant_emissions_report(solution, filename)
.
Column | +Description | +
---|---|
plant type |
+Plant type. | +
location name |
+Location name. | +
year |
+Year. | +
emission type |
+Type of emission. | +
amount (tonne) |
+Amount of emission produced by the plant this year. | +
import pandas as pd
+import seaborn as sns; sns.set()
+
+data = pd.read_csv("plant_emissions_report.csv")
+sns.barplot(x="plant type",
+ y="emission amount (tonne)",
+ hue="emission type",
+ data=data.groupby(["plant type", "emission type"])
+ .sum()
+ .reset_index());
+
+Report showing primary product amounts, locations and marginal costs. Generated by RELOG.write_products_report(solution, filename)
.
Column | +Description | +
---|---|
product name |
+Product name. | +
location name |
+Name of the collection center. | +
latitude (deg) |
+Latitude of the collection center. | +
longitude (deg) |
+Longitude of the collection center. | +
year |
+What year this row corresponds to. This reports includes one row for each year. | +
amount (tonne) |
+Amount of product available at this collection center. | +
amount disposed (tonne) |
+Amount of product disposed of at this collection center. | +
marginal cost ($/tonne) |
+Cost to process one additional tonne of this product coming from this collection center. | +
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 RELOG.write_transportation_report(solution, filename)
.
Column | +Description | +
---|---|
source type |
+If product is being shipped from an initial location, equals Origin . If product is being shipped from a plant, equals plant type. |
+
source location name |
+Name of the location where the product is being shipped from. | +
source latitude (deg) |
+Latitude of the source location. | +
source longitude (deg) |
+Longitude of the source location. | +
destination type |
+Type of plant the product is being shipped to. | +
destination location name |
+Name of the location where the product is being shipped to. | +
destination latitude (deg) |
+Latitude of the destination location. | +
destination longitude (deg) |
+Longitude of the destination location. | +
product |
+Product being shipped. | +
year |
+Year. | +
distance (km) |
+Distance between source and destination. | +
amount (tonne) |
+Total amount of product being shipped between the two locations this year. | +
amount-distance (tonne-km) |
+Total amount being shipped this year times distance. | +
transportation cost ($) |
+Cost to transport this amount of product between the two locations for this year. | +
transportation energy (GJ) |
+Energy expended transporting this amount of product between the two locations. | +
import pandas as pd
+import seaborn as sns; sns.set()
+
+data = pd.read_csv("transportation_report.csv")
+sns.barplot(x="product",
+ y="amount-distance (tonne-km)",
+ hue="year",
+ data=data.groupby(["product", "year"])
+ .sum()
+ .reset_index());
+
+import pandas as pd
+import geopandas as gp
+from shapely.geometry import Point, LineString
+import matplotlib.pyplot as plt
+from matplotlib import collections
+
+# Plot base map
+world = gp.read_file(gp.datasets.get_path('naturalearth_lowres'))
+ax = world.plot(color='white', edgecolor='50', figsize=(14,7))
+ax.set_ylim([23, 50])
+ax.set_xlim([-128, -65])
+
+# Draw transportation lines
+data = pd.read_csv("transportation_report.csv")
+lines = [[(row["source longitude (deg)"], row["source latitude (deg)"]),
+ (row["destination longitude (deg)"], row["destination latitude (deg)"])
+ ] for (index, row) in data.iterrows()]
+ax.add_collection(collections.LineCollection(lines,
+ linewidths=0.25,
+ zorder=1,
+ alpha=0.5,
+ color="50"))
+
+# Draw source points
+points = gp.points_from_xy(data["source longitude (deg)"],
+ data["source latitude (deg)"])
+gp.GeoDataFrame(data, geometry=points).plot(ax=ax,
+ color="0.5",
+ markersize=1);
+
+# Draw destination points
+points = gp.points_from_xy(data["destination longitude (deg)"],
+ data["destination latitude (deg)"])
+gp.GeoDataFrame(data, geometry=points).plot(ax=ax,
+ color="red",
+ markersize=50);
+
+Report showing emissions for each trip between initial locations and plants, and between pairs of plants. Generated by RELOG.write_transportation_emissions_report(solution, filename)
.
Column | +Description | +
---|---|
source type |
+If product is being shipped from an initial location, equals Origin . If product is being shipped from a plant, equals plant type. |
+
source location name |
+Name of the location where the product is being shipped from. | +
source latitude (deg) |
+Latitude of the source location. | +
source longitude (deg) |
+Longitude of the source location. | +
destination type |
+Type of plant the product is being shipped to. | +
destination location name |
+Name of the location where the product is being shipped to. | +
destination latitude (deg) |
+Latitude of the destination location. | +
destination longitude (deg) |
+Longitude of the destination location. | +
product |
+Product being shipped. | +
year |
+Year. | +
distance (km) |
+Distance between source and destination. | +
shipped amount (tonne) |
+Total amount of product being shipped between the two locations this year. | +
shipped amount-distance (tonne-km) |
+Total amount being shipped this year times distance. | +
emission type |
+Type of emission. | +
emission amount (tonne) |
+Amount of emission produced by transportation segment this year. | +
import pandas as pd
+import seaborn as sns; sns.set()
+
+data = pd.read_csv("transportation_emissions_report.csv")
+sns.barplot(x="emission type",
+ y="emission amount (tonne)",
+ hue="product",
+ data=data.groupby(["product", "emission type"])
+ .sum()
+ .reset_index());
+
+' + summary +'
No results found
"); + } +} + +function doSearch () { + var query = document.getElementById('mkdocs-search-query').value; + if (query.length > min_search_length) { + if (!window.Worker) { + displayResults(search(query)); + } else { + searchWorker.postMessage({query: query}); + } + } else { + // Clear results for short queries + displayResults([]); + } +} + +function initSearch () { + var search_input = document.getElementById('mkdocs-search-query'); + if (search_input) { + search_input.addEventListener("keyup", doSearch); + } + var term = getSearchTermFromLocation(); + if (term) { + search_input.value = term; + doSearch(); + } +} + +function onWorkerMessage (e) { + if (e.data.allowSearch) { + initSearch(); + } else if (e.data.results) { + var results = e.data.results; + displayResults(results); + } else if (e.data.config) { + min_search_length = e.data.config.min_search_length-1; + } +} + +if (!window.Worker) { + console.log('Web Worker API not supported'); + // load index in main thread + $.getScript(joinUrl(base_url, "search/worker.js")).done(function () { + console.log('Loaded worker'); + init(); + window.postMessage = function (msg) { + onWorkerMessage({data: msg}); + }; + }).fail(function (jqxhr, settings, exception) { + console.error('Could not load worker.js'); + }); +} else { + // Wrap search in a web worker + var searchWorker = new Worker(joinUrl(base_url, "search/worker.js")); + searchWorker.postMessage({init: true}); + searchWorker.onmessage = onWorkerMessage; +} diff --git a/dev/search/search_index.json b/dev/search/search_index.json new file mode 100644 index 0000000..d944d4b --- /dev/null +++ b/dev/search/search_index.json @@ -0,0 +1 @@ +{"config":{"lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"RELOG: Reverse Logistics Optimization RELOG is an open-source 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 Usage Input and Output Data Formats Simplified Solution Reports Optimization Model Source Code https://github.com/ANL-CEEESA/RELOG Authors Alinson S. Xavier, Argonne National Laboratory < axavier@anl.gov > Nwike Iloeje, Argonne National Laboratory < ciloeje@anl.gov > License RELOG: Reverse Logistics Optimization Copyright \u00a9 2020, UChicago Argonne, LLC. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","title":"Home"},{"location":"#relog-reverse-logistics-optimization","text":"RELOG is an open-source 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.","title":"RELOG: Reverse Logistics Optimization"},{"location":"#table-of-contents","text":"Usage Input and Output Data Formats Simplified Solution Reports Optimization Model","title":"Table of Contents"},{"location":"#source-code","text":"https://github.com/ANL-CEEESA/RELOG","title":"Source Code"},{"location":"#authors","text":"Alinson S. Xavier, Argonne National Laboratory < axavier@anl.gov > Nwike Iloeje, Argonne National Laboratory < ciloeje@anl.gov >","title":"Authors"},{"location":"#license","text":"RELOG: Reverse Logistics Optimization Copyright \u00a9 2020, UChicago Argonne, LLC. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","title":"License"},{"location":"format/","text":"Input and Output Data Formats In this page, we describe the input and output JSON formats used by RELOG. In addition to these, RELOG can also produce simplified reports in tabular data format. Input Data Format (JSON) 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 { \"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 time series. transportation energy (J/km/tonne) The energy required to transport this product. Must be a time series. 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 time series. 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 time series. disposal limit (tonne) Total amount of product that can be disposed of across all collection centers. If omitted, all product must be processed. This parameter has no effect on product disposal at plants. disposal cost ($/tonne) Cost of disposing one tonne of this product at a collection center. If omitted, defaults to zero. This parameter has no effect on product disposal costs at plants. 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 time series. Example { \"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] }, \"disposal cost ($/tonne)\": [-10.0, -12.0], \"disposal limit (tonne)\": [1.0, 1.0], }, \"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 time series. 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 time series. 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. storage A dictionary describing the plant's storage. capacities (tonne) A dictionary describing what plant sizes are allowed, and their characteristics. The storage dictionary should contain the following keys: Key Description cost ($/tonne) The cost to store a tonne of input product for one time period. Must be a time series. limit (tonne) The maximum amount of input product this plant can have in storage at any given time. 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 time series. 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 time series. 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 time series. variable operating cost ($/tonne) The cost that the plant incurs to process each tonne of input. Must be a time series. Example { \"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] } }, \"storage\": { \"cost ($/tonne)\": [5.0, 5.3], \"limit (tonne)\": 100.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] } } } } } } } Geographic database 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 latitude (deg) and longitude (deg) are expected. For example, instead of: { \"initial amounts\": { \"C1\": { \"latitude (deg)\": 37.27182, \"longitude (deg)\": -119.2704, \"amount (tonne)\": [934.56, 934.56] }, } } is is possible to write: { \"initial amounts\": { \"C1\": { \"location\": \"us-state:CA\", \"amount (tonne)\": [934.56, 934.56] }, } } Location names follow the format db:id , where db is the name of the database and id is the identifier for a specific location. RELOG currently includes the following databases: Database Description Examples us-state List of states of the United States. us-state:IL (State of Illinois) 2018-us-county List of United States counties, as of 2018. IDs are 5-digit FIPS codes. 2018-us-county:17043 (DuPage county in Illinois) 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. Output Data Format (JSON) To be documented.","title":"Data Format"},{"location":"format/#input-and-output-data-formats","text":"In this page, we describe the input and output JSON formats used by RELOG. In addition to these, RELOG can also produce simplified reports in tabular data format.","title":"Input and Output Data Formats"},{"location":"format/#input-data-format-json","text":"RELOG accepts as input a JSON file with three sections: parameters , products and plants . Below, we describe each section in more detail.","title":"Input Data Format (JSON)"},{"location":"format/#parameters","text":"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.","title":"Parameters"},{"location":"format/#example","text":"{ \"parameters\": { \"time horizon (years)\": 2, \"building period (years)\": [1] } }","title":"Example"},{"location":"format/#products","text":"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 time series. transportation energy (J/km/tonne) The energy required to transport this product. Must be a time series. 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 time series. 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 time series. disposal limit (tonne) Total amount of product that can be disposed of across all collection centers. If omitted, all product must be processed. This parameter has no effect on product disposal at plants. disposal cost ($/tonne) Cost of disposing one tonne of this product at a collection center. If omitted, defaults to zero. This parameter has no effect on product disposal costs at plants. 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 time series.","title":"Products"},{"location":"format/#example_1","text":"{ \"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] }, \"disposal cost ($/tonne)\": [-10.0, -12.0], \"disposal limit (tonne)\": [1.0, 1.0], }, \"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] } } }","title":"Example"},{"location":"format/#processing-plants","text":"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 time series. 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 time series. 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. storage A dictionary describing the plant's storage. capacities (tonne) A dictionary describing what plant sizes are allowed, and their characteristics. The storage dictionary should contain the following keys: Key Description cost ($/tonne) The cost to store a tonne of input product for one time period. Must be a time series. limit (tonne) The maximum amount of input product this plant can have in storage at any given time. 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 time series. 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 time series. 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 time series. variable operating cost ($/tonne) The cost that the plant incurs to process each tonne of input. Must be a time series.","title":"Processing plants"},{"location":"format/#example_2","text":"{ \"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] } }, \"storage\": { \"cost ($/tonne)\": [5.0, 5.3], \"limit (tonne)\": 100.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] } } } } } } }","title":"Example"},{"location":"format/#geographic-database","text":"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 latitude (deg) and longitude (deg) are expected. For example, instead of: { \"initial amounts\": { \"C1\": { \"latitude (deg)\": 37.27182, \"longitude (deg)\": -119.2704, \"amount (tonne)\": [934.56, 934.56] }, } } is is possible to write: { \"initial amounts\": { \"C1\": { \"location\": \"us-state:CA\", \"amount (tonne)\": [934.56, 934.56] }, } } Location names follow the format db:id , where db is the name of the database and id is the identifier for a specific location. RELOG currently includes the following databases: Database Description Examples us-state List of states of the United States. us-state:IL (State of Illinois) 2018-us-county List of United States counties, as of 2018. IDs are 5-digit FIPS codes. 2018-us-county:17043 (DuPage county in Illinois)","title":"Geographic database"},{"location":"format/#current-limitations","text":"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.","title":"Current limitations"},{"location":"format/#output-data-format-json","text":"To be documented.","title":"Output Data Format (JSON)"},{"location":"model/","text":"Optimization Model In this page, we describe the precise mathematical optimization model used by RELOG to find the optimal logistics plan. This model is a variation of the classical Facility Location Problem, which has been widely studied in the operations research literature. To simplify the exposition, we present the simplified case where there is only one type of plant. Mathematical Description Sets $L$ - Set of locations holding the original material to be recycled $M$ - Set of materials recovered during the reverse manufacturing process $P$ - Set of potential plants to open $T = { 1, \\ldots, t^{max} } $ - Set of time periods Constants Plants: $c^\\text{disp}_{pmt}$ - Cost of disposing one tonne of material $m$ at plant $p$ during time $t$ ( $/tonne/km ) $c^\\text{exp}_{pt}$ - Cost of adding one tonne of capacity to plant $p$ at time $t$ ( $/tonne ) $c^\\text{open}_{pt}$ - Cost of opening plant $p$ at time $t$, at minimum capacity ( $ ) $c^\\text{f-base}_{pt}$ - Fixed cost of keeping plant $p$ open during time period $t$ ( $ ) $c^\\text{f-exp}_{pt}$ - Increase in fixed cost for each additional tonne of capacity ( $/tonne ) $c^\\text{var}_{pt}$ - Variable cost of processing one tonne of input at plant $p$ at time $t$ ( $/tonne ) $c^\\text{store}_{pt}$ - Cost of storing one tonne of original material at plant $p$ at time $t$ ( $/tonne ) $m^\\text{min}_p$ - Minimum capacity of plant $p$ ( tonne ) $m^\\text{max}_p$ - Maximum capacity of plant $p$ ( tonne ) $m^\\text{disp}_{pmt}$ - Maximum amount of material $m$ that plant $p$ can dispose of during time $t$ ( tonne ) $m^\\text{store}_p$ - Maximum amount of original material that plant $p$ can store for later processing. Products: $\\alpha_{pm}$ - Amount of material $m$ recovered by plant $t$ for each tonne of original material ( tonne/tonne ) $m^\\text{initial}_{lt}$ - Amount of original material to be recycled at location $l$ during time $t$ ( tonne ) Transportation: $c^\\text{tr}_{t}$ - Transportation cost during time $t$ ( $/tonne/km ) $d_{lp}$ - Distance between plant $p$ and location $l$ ( km ) Decision variables $q_{mpt}$ - Amount of material $m$ recovered by plant $p$ during time $t$ ( tonne ) $u_{pt}$ - Binary variable that equals 1 if plant $p$ starts operating at time $t$ ( bool ) $w_{pt}$ - Extra capacity (amount above the minimum) added to plant $p$ during time $t$ ( tonne ) $x_{pt}$ - Binary variable that equals 1 if plant $p$ is operational at time $t$ ( bool ) $y_{lpt}$ - Amount of product sent from location $l$ to plant $p$ during time $t$ ( tonne ) $z^{\\text{disp}}_{mpt}$ - Amount of material $m$ disposed of by plant $p$ during time $t$ ( tonne ) $z^{\\text{store}}_{pt}$ - Amount of original material in storage at plant $p$ by the end of time period $t$ ( tonne ) $z^{\\text{proc}}_{mpt}$ - Amount of original material processed by plant $p$ during time period $t$ ( tonne ) Objective function RELOG minimizes the overall capital, production and transportation costs: \\begin{align*} \\text{minimize} \\;\\; & \\sum_{t \\in T} \\sum_{p \\in P} \\left[ c^\\text{open}_{pt} u_{pt} + c^\\text{f-base}_{pt} x_{pt} + \\sum_{i=1}^t c^\\text{f-exp}_{pt} w_{pi} + c^{\\text{exp}}_{pt} w_{pt} \\right] + \\\\ & \\sum_{t \\in T} \\sum_{p \\in P} \\left[ c^{\\text{store}}_{pt} z^{\\text{store}}_{pt} + c^{\\text{proc}}_{pt} z^{\\text{proc}}_{pt} \\right] + \\\\ & \\sum_{t \\in T} \\sum_{l \\in L} \\sum_{p \\in P} c^{\\text{tr}}_t d_{lp} y_{lpt} \\\\ & \\sum_{t \\in T} \\sum_{p \\in P} \\sum_{m \\in M} c^{\\text{disp}}_{pmt} z_{pmt} \\end{align*} In the first line, we have (i) opening costs, if plant starts operating at time $t$, (ii) fixed operating costs, if plant is operational, (iii) additional fixed operating costs coming from expansion performed in all previous time periods up to the current one, and finally (iv) the expansion costs during the current time period. In the second line, we have storage and variable processing costs. In the third line, we have transportation costs. In the fourth line, we have the disposal costs. Constraints All original materials must be sent to a plant: \\begin{align} & \\sum_{p \\in P} y_{lpt} = m^\\text{initial}_{lt} & \\forall l \\in L, t \\in T \\end{align} Amount received equals amount processed plus stored. Furthermore, all original material should be processed by the end of the simulation. \\begin{align} & \\sum_{l \\in L} y_{lpt} + z^{\\text{store}}_{p,t-1} = z^{\\text{proc}}_{pt} + z^{\\text{store}}_{p,t} & \\forall p \\in P, t \\in T \\\\ & z^{\\text{store}}_{p,0} = 0 & \\forall p \\in P \\\\ & z^{\\text{store}}_{p,t^{\\max}} = 0 & \\forall p \\in P \\end{align} Plants have a limited processing capacity. Furthermore, if a plant is closed, it has zero processing capacity: \\begin{align} & z^{\\text{proc}}_{pt} \\leq m^\\text{min}_p x_p + \\sum_{i=1}^t w_p & \\forall p \\in P, t \\in T \\end{align} Plants have limited storage capacity. Furthermore, if a plant is closed, is has zero storage capacity: \\begin{align} & z^{\\text{store}}_{pt} \\leq m^\\text{store}_p x_p & \\forall p \\in P, t \\in T \\end{align} Plants can only be expanded up to their maximum capacity. Furthermore, if a plant is closed, it cannot be expanded: \\begin{align} & \\sum_{i=1}^t w_p \\leq m^\\text{max}_p x_p & \\forall p \\in P, t \\in T \\end{align} Amount of recovered material is proportional to amount processed: \\begin{align} & q_{mpt} = \\alpha_{pm} z^{\\text{proc}}_{pt} & \\forall m \\in M, p \\in P, t \\in T \\end{align} Because we only consider a single type of plant, all recovered material must be immediately disposed of. In RELOG's full model, recovered materials may be sent to another plant for further processing. \\begin{align} & q_{mpt} = z_{mpt} & \\forall m \\in M, p \\in P, t \\in T \\end{align} A plant is operational at time $t$ if it was operational at time $t-1$ or it was built at time $t$. This constraint also prevents a plant from being built multiple times. \\begin{align} & x_{pt} = x_{p,t-1} + u_{pt} & \\forall p \\in P, t \\in T \\setminus \\{1\\} \\\\ & x_{p,1} = u_{p,1} & \\forall p \\in P \\end{align} Variable bounds: \\begin{align} & q_{mpt} \\geq 0 & \\forall m \\in M, p \\in P, t \\in T \\\\ & u_{pt} \\in \\{0,1\\} & \\forall p \\in P, t \\in T \\\\ & w_{pt} \\geq 0 & \\forall p \\in P, t \\in T \\\\ & x_{pt} \\in \\{0,1\\} & \\forall p \\in P, t \\in T \\\\ & y_{lpt} \\geq 0 & \\forall l \\in L, p \\in P, t \\in T \\\\ & z^{\\text{store}}_{pt} \\geq 0 & p \\in P, t \\in T \\\\ & z^{\\text{disp}}_{mpt}, z^{\\text{proc}}_{mpt} \\geq 0 & \\forall m \\in M, p \\in P, t \\in T \\end{align}","title":"Optimization Model"},{"location":"model/#optimization-model","text":"In this page, we describe the precise mathematical optimization model used by RELOG to find the optimal logistics plan. This model is a variation of the classical Facility Location Problem, which has been widely studied in the operations research literature. To simplify the exposition, we present the simplified case where there is only one type of plant.","title":"Optimization Model"},{"location":"model/#mathematical-description","text":"","title":"Mathematical Description"},{"location":"model/#sets","text":"$L$ - Set of locations holding the original material to be recycled $M$ - Set of materials recovered during the reverse manufacturing process $P$ - Set of potential plants to open $T = { 1, \\ldots, t^{max} } $ - Set of time periods","title":"Sets"},{"location":"model/#constants","text":"Plants: $c^\\text{disp}_{pmt}$ - Cost of disposing one tonne of material $m$ at plant $p$ during time $t$ ( $/tonne/km ) $c^\\text{exp}_{pt}$ - Cost of adding one tonne of capacity to plant $p$ at time $t$ ( $/tonne ) $c^\\text{open}_{pt}$ - Cost of opening plant $p$ at time $t$, at minimum capacity ( $ ) $c^\\text{f-base}_{pt}$ - Fixed cost of keeping plant $p$ open during time period $t$ ( $ ) $c^\\text{f-exp}_{pt}$ - Increase in fixed cost for each additional tonne of capacity ( $/tonne ) $c^\\text{var}_{pt}$ - Variable cost of processing one tonne of input at plant $p$ at time $t$ ( $/tonne ) $c^\\text{store}_{pt}$ - Cost of storing one tonne of original material at plant $p$ at time $t$ ( $/tonne ) $m^\\text{min}_p$ - Minimum capacity of plant $p$ ( tonne ) $m^\\text{max}_p$ - Maximum capacity of plant $p$ ( tonne ) $m^\\text{disp}_{pmt}$ - Maximum amount of material $m$ that plant $p$ can dispose of during time $t$ ( tonne ) $m^\\text{store}_p$ - Maximum amount of original material that plant $p$ can store for later processing. Products: $\\alpha_{pm}$ - Amount of material $m$ recovered by plant $t$ for each tonne of original material ( tonne/tonne ) $m^\\text{initial}_{lt}$ - Amount of original material to be recycled at location $l$ during time $t$ ( tonne ) Transportation: $c^\\text{tr}_{t}$ - Transportation cost during time $t$ ( $/tonne/km ) $d_{lp}$ - Distance between plant $p$ and location $l$ ( km )","title":"Constants"},{"location":"model/#decision-variables","text":"$q_{mpt}$ - Amount of material $m$ recovered by plant $p$ during time $t$ ( tonne ) $u_{pt}$ - Binary variable that equals 1 if plant $p$ starts operating at time $t$ ( bool ) $w_{pt}$ - Extra capacity (amount above the minimum) added to plant $p$ during time $t$ ( tonne ) $x_{pt}$ - Binary variable that equals 1 if plant $p$ is operational at time $t$ ( bool ) $y_{lpt}$ - Amount of product sent from location $l$ to plant $p$ during time $t$ ( tonne ) $z^{\\text{disp}}_{mpt}$ - Amount of material $m$ disposed of by plant $p$ during time $t$ ( tonne ) $z^{\\text{store}}_{pt}$ - Amount of original material in storage at plant $p$ by the end of time period $t$ ( tonne ) $z^{\\text{proc}}_{mpt}$ - Amount of original material processed by plant $p$ during time period $t$ ( tonne )","title":"Decision variables"},{"location":"model/#objective-function","text":"RELOG minimizes the overall capital, production and transportation costs: \\begin{align*} \\text{minimize} \\;\\; & \\sum_{t \\in T} \\sum_{p \\in P} \\left[ c^\\text{open}_{pt} u_{pt} + c^\\text{f-base}_{pt} x_{pt} + \\sum_{i=1}^t c^\\text{f-exp}_{pt} w_{pi} + c^{\\text{exp}}_{pt} w_{pt} \\right] + \\\\ & \\sum_{t \\in T} \\sum_{p \\in P} \\left[ c^{\\text{store}}_{pt} z^{\\text{store}}_{pt} + c^{\\text{proc}}_{pt} z^{\\text{proc}}_{pt} \\right] + \\\\ & \\sum_{t \\in T} \\sum_{l \\in L} \\sum_{p \\in P} c^{\\text{tr}}_t d_{lp} y_{lpt} \\\\ & \\sum_{t \\in T} \\sum_{p \\in P} \\sum_{m \\in M} c^{\\text{disp}}_{pmt} z_{pmt} \\end{align*} In the first line, we have (i) opening costs, if plant starts operating at time $t$, (ii) fixed operating costs, if plant is operational, (iii) additional fixed operating costs coming from expansion performed in all previous time periods up to the current one, and finally (iv) the expansion costs during the current time period. In the second line, we have storage and variable processing costs. In the third line, we have transportation costs. In the fourth line, we have the disposal costs.","title":"Objective function"},{"location":"model/#constraints","text":"All original materials must be sent to a plant: \\begin{align} & \\sum_{p \\in P} y_{lpt} = m^\\text{initial}_{lt} & \\forall l \\in L, t \\in T \\end{align} Amount received equals amount processed plus stored. Furthermore, all original material should be processed by the end of the simulation. \\begin{align} & \\sum_{l \\in L} y_{lpt} + z^{\\text{store}}_{p,t-1} = z^{\\text{proc}}_{pt} + z^{\\text{store}}_{p,t} & \\forall p \\in P, t \\in T \\\\ & z^{\\text{store}}_{p,0} = 0 & \\forall p \\in P \\\\ & z^{\\text{store}}_{p,t^{\\max}} = 0 & \\forall p \\in P \\end{align} Plants have a limited processing capacity. Furthermore, if a plant is closed, it has zero processing capacity: \\begin{align} & z^{\\text{proc}}_{pt} \\leq m^\\text{min}_p x_p + \\sum_{i=1}^t w_p & \\forall p \\in P, t \\in T \\end{align} Plants have limited storage capacity. Furthermore, if a plant is closed, is has zero storage capacity: \\begin{align} & z^{\\text{store}}_{pt} \\leq m^\\text{store}_p x_p & \\forall p \\in P, t \\in T \\end{align} Plants can only be expanded up to their maximum capacity. Furthermore, if a plant is closed, it cannot be expanded: \\begin{align} & \\sum_{i=1}^t w_p \\leq m^\\text{max}_p x_p & \\forall p \\in P, t \\in T \\end{align} Amount of recovered material is proportional to amount processed: \\begin{align} & q_{mpt} = \\alpha_{pm} z^{\\text{proc}}_{pt} & \\forall m \\in M, p \\in P, t \\in T \\end{align} Because we only consider a single type of plant, all recovered material must be immediately disposed of. In RELOG's full model, recovered materials may be sent to another plant for further processing. \\begin{align} & q_{mpt} = z_{mpt} & \\forall m \\in M, p \\in P, t \\in T \\end{align} A plant is operational at time $t$ if it was operational at time $t-1$ or it was built at time $t$. This constraint also prevents a plant from being built multiple times. \\begin{align} & x_{pt} = x_{p,t-1} + u_{pt} & \\forall p \\in P, t \\in T \\setminus \\{1\\} \\\\ & x_{p,1} = u_{p,1} & \\forall p \\in P \\end{align} Variable bounds: \\begin{align} & q_{mpt} \\geq 0 & \\forall m \\in M, p \\in P, t \\in T \\\\ & u_{pt} \\in \\{0,1\\} & \\forall p \\in P, t \\in T \\\\ & w_{pt} \\geq 0 & \\forall p \\in P, t \\in T \\\\ & x_{pt} \\in \\{0,1\\} & \\forall p \\in P, t \\in T \\\\ & y_{lpt} \\geq 0 & \\forall l \\in L, p \\in P, t \\in T \\\\ & z^{\\text{store}}_{pt} \\geq 0 & p \\in P, t \\in T \\\\ & z^{\\text{disp}}_{mpt}, z^{\\text{proc}}_{mpt} \\geq 0 & \\forall m \\in M, p \\in P, t \\in T \\end{align}","title":"Constraints"},{"location":"reports/","text":"Simplified Solution Reports In addition to the full output format described in data formats , 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). 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. Plants report Report showing plant costs, capacities, energy expenditure and utilization factors. Generated by RELOG.write_plants_report(solution, filename) . Column Description plant type Plant type. location name Location name. year What year this row corresponds to. This reports includes one row for each year. latitude (deg) Latitude of the plant. longitude (deg) Longitude of the plant. capacity (tonne) Capacity of the plant at this point in time. amount received (tonne) Amount of input material received by the plant this year. amount processed (tonne) Amount of input material processed by the plant this year. amount in storage (tonne) Amount of input material in storage at the end of the year. utilization factor (%) Amount processed by the plant this year divided by current plant capacity. energy (GJ) Amount of energy expended by the plant this year. opening cost ($) Amount spent opening the plant. This value is only positive if the plant became operational this year. expansion cost ($) Amount spent this year expanding the plant capacity. fixed operating cost ($) Amount spent for keeping the plant operational this year. variable operating cost ($) Amount spent this year to process the input material. storage cost ($) Amount spent this year on storage. total cost ($) Sum of all previous plant costs. Sample charts Bar plot with total plant costs per year, grouped by plant type (in Python): import pandas as pd import seaborn as sns; sns.set() data = pd.read_csv(\"plants_report.csv\") sns.barplot(x=\"year\", y=\"total cost ($)\", hue=\"plant type\", data=data.groupby([\"plant type\", \"year\"]) .sum() .reset_index()); Map showing plant locations (in Python): import pandas as pd import geopandas as gp # Plot base map world = gp.read_file(gp.datasets.get_path('naturalearth_lowres')) ax = world.plot(color='white', edgecolor='50', figsize=(13,6)) ax.set_ylim([23, 50]) ax.set_xlim([-128, -65]) # Plot plant locations data = pd.read_csv(\"nimh_plants.csv\") points = gp.points_from_xy(data[\"longitude (deg)\"], data[\"latitude (deg)\"]) gp.GeoDataFrame(data, geometry=points).plot(ax=ax); Plant outputs report Report showing amount of products produced, sent and disposed of by each plant, as well as disposal costs. Generated by RELOG.write_plant_outputs_report(solution, filename) . Column Description plant type Plant type. location name Location name. year What year this row corresponds to. This reports includes one row for each year. product name Product being produced. amount produced (tonne) Amount of product produced this year. amount sent (tonne) Amount of product produced by this plant and sent to another plant for further processing this year. amount disposed (tonne) Amount produced produced by this plant and immediately disposed of locally this year. disposal cost ($) Disposal cost for this year. Sample charts Bar plot showing total amount produced for each product, grouped by year (in Python): import pandas as pd import seaborn as sns; sns.set() data = pd.read_csv(\"plant_outputs_report.csv\") sns.barplot(x=\"amount produced (tonne)\", y=\"product name\", hue=\"year\", data=data.groupby([\"product name\", \"year\"]) .sum() .reset_index()); Plant emissions report Report showing amount of emissions produced by each plant. Generated by RELOG.write_plant_emissions_report(solution, filename) . Column Description plant type Plant type. location name Location name. year Year. emission type Type of emission. amount (tonne) Amount of emission produced by the plant this year. Sample charts Bar plot showing total emission by plant type, grouped type of emissions (in Python): import pandas as pd import seaborn as sns; sns.set() data = pd.read_csv(\"plant_emissions_report.csv\") sns.barplot(x=\"plant type\", y=\"emission amount (tonne)\", hue=\"emission type\", data=data.groupby([\"plant type\", \"emission type\"]) .sum() .reset_index()); Products report Report showing primary product amounts, locations and marginal costs. Generated by RELOG.write_products_report(solution, filename) . Column Description product name Product name. location name Name of the collection center. latitude (deg) Latitude of the collection center. longitude (deg) Longitude of the collection center. year What year this row corresponds to. This reports includes one row for each year. amount (tonne) Amount of product available at this collection center. amount disposed (tonne) Amount of product disposed of at this collection center. marginal cost ($/tonne) Cost to process one additional tonne of this product coming from this collection center. Transportation report 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 RELOG.write_transportation_report(solution, filename) . Column Description source type If product is being shipped from an initial location, equals Origin . If product is being shipped from a plant, equals plant type. source location name Name of the location where the product is being shipped from. source latitude (deg) Latitude of the source location. source longitude (deg) Longitude of the source location. destination type Type of plant the product is being shipped to. destination location name Name of the location where the product is being shipped to. destination latitude (deg) Latitude of the destination location. destination longitude (deg) Longitude of the destination location. product Product being shipped. year Year. distance (km) Distance between source and destination. amount (tonne) Total amount of product being shipped between the two locations this year. amount-distance (tonne-km) Total amount being shipped this year times distance. transportation cost ($) Cost to transport this amount of product between the two locations for this year. transportation energy (GJ) Energy expended transporting this amount of product between the two locations. Sample charts Bar plot showing total amount-distance for each product type, grouped by year (in Python): import pandas as pd import seaborn as sns; sns.set() data = pd.read_csv(\"transportation_report.csv\") sns.barplot(x=\"product\", y=\"amount-distance (tonne-km)\", hue=\"year\", data=data.groupby([\"product\", \"year\"]) .sum() .reset_index()); Map of transportation lines (in Python): import pandas as pd import geopandas as gp from shapely.geometry import Point, LineString import matplotlib.pyplot as plt from matplotlib import collections # Plot base map world = gp.read_file(gp.datasets.get_path('naturalearth_lowres')) ax = world.plot(color='white', edgecolor='50', figsize=(14,7)) ax.set_ylim([23, 50]) ax.set_xlim([-128, -65]) # Draw transportation lines data = pd.read_csv(\"transportation_report.csv\") lines = [[(row[\"source longitude (deg)\"], row[\"source latitude (deg)\"]), (row[\"destination longitude (deg)\"], row[\"destination latitude (deg)\"]) ] for (index, row) in data.iterrows()] ax.add_collection(collections.LineCollection(lines, linewidths=0.25, zorder=1, alpha=0.5, color=\"50\")) # Draw source points points = gp.points_from_xy(data[\"source longitude (deg)\"], data[\"source latitude (deg)\"]) gp.GeoDataFrame(data, geometry=points).plot(ax=ax, color=\"0.5\", markersize=1); # Draw destination points points = gp.points_from_xy(data[\"destination longitude (deg)\"], data[\"destination latitude (deg)\"]) gp.GeoDataFrame(data, geometry=points).plot(ax=ax, color=\"red\", markersize=50); Transportation emissions report Report showing emissions for each trip between initial locations and plants, and between pairs of plants. Generated by RELOG.write_transportation_emissions_report(solution, filename) . Column Description source type If product is being shipped from an initial location, equals Origin . If product is being shipped from a plant, equals plant type. source location name Name of the location where the product is being shipped from. source latitude (deg) Latitude of the source location. source longitude (deg) Longitude of the source location. destination type Type of plant the product is being shipped to. destination location name Name of the location where the product is being shipped to. destination latitude (deg) Latitude of the destination location. destination longitude (deg) Longitude of the destination location. product Product being shipped. year Year. distance (km) Distance between source and destination. shipped amount (tonne) Total amount of product being shipped between the two locations this year. shipped amount-distance (tonne-km) Total amount being shipped this year times distance. emission type Type of emission. emission amount (tonne) Amount of emission produced by transportation segment this year. Sample charts Bar plot showing total emission amount by emission type, grouped by type of product being transported (in Python): import pandas as pd import seaborn as sns; sns.set() data = pd.read_csv(\"transportation_emissions_report.csv\") sns.barplot(x=\"emission type\", y=\"emission amount (tonne)\", hue=\"product\", data=data.groupby([\"product\", \"emission type\"]) .sum() .reset_index());","title":"Reports"},{"location":"reports/#simplified-solution-reports","text":"In addition to the full output format described in data formats , 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). 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.","title":"Simplified Solution Reports"},{"location":"reports/#plants-report","text":"Report showing plant costs, capacities, energy expenditure and utilization factors. Generated by RELOG.write_plants_report(solution, filename) . Column Description plant type Plant type. location name Location name. year What year this row corresponds to. This reports includes one row for each year. latitude (deg) Latitude of the plant. longitude (deg) Longitude of the plant. capacity (tonne) Capacity of the plant at this point in time. amount received (tonne) Amount of input material received by the plant this year. amount processed (tonne) Amount of input material processed by the plant this year. amount in storage (tonne) Amount of input material in storage at the end of the year. utilization factor (%) Amount processed by the plant this year divided by current plant capacity. energy (GJ) Amount of energy expended by the plant this year. opening cost ($) Amount spent opening the plant. This value is only positive if the plant became operational this year. expansion cost ($) Amount spent this year expanding the plant capacity. fixed operating cost ($) Amount spent for keeping the plant operational this year. variable operating cost ($) Amount spent this year to process the input material. storage cost ($) Amount spent this year on storage. total cost ($) Sum of all previous plant costs.","title":"Plants report"},{"location":"reports/#sample-charts","text":"Bar plot with total plant costs per year, grouped by plant type (in Python): import pandas as pd import seaborn as sns; sns.set() data = pd.read_csv(\"plants_report.csv\") sns.barplot(x=\"year\", y=\"total cost ($)\", hue=\"plant type\", data=data.groupby([\"plant type\", \"year\"]) .sum() .reset_index()); Map showing plant locations (in Python): import pandas as pd import geopandas as gp # Plot base map world = gp.read_file(gp.datasets.get_path('naturalearth_lowres')) ax = world.plot(color='white', edgecolor='50', figsize=(13,6)) ax.set_ylim([23, 50]) ax.set_xlim([-128, -65]) # Plot plant locations data = pd.read_csv(\"nimh_plants.csv\") points = gp.points_from_xy(data[\"longitude (deg)\"], data[\"latitude (deg)\"]) gp.GeoDataFrame(data, geometry=points).plot(ax=ax);","title":"Sample charts"},{"location":"reports/#plant-outputs-report","text":"Report showing amount of products produced, sent and disposed of by each plant, as well as disposal costs. Generated by RELOG.write_plant_outputs_report(solution, filename) . Column Description plant type Plant type. location name Location name. year What year this row corresponds to. This reports includes one row for each year. product name Product being produced. amount produced (tonne) Amount of product produced this year. amount sent (tonne) Amount of product produced by this plant and sent to another plant for further processing this year. amount disposed (tonne) Amount produced produced by this plant and immediately disposed of locally this year. disposal cost ($) Disposal cost for this year.","title":"Plant outputs report"},{"location":"reports/#sample-charts_1","text":"Bar plot showing total amount produced for each product, grouped by year (in Python): import pandas as pd import seaborn as sns; sns.set() data = pd.read_csv(\"plant_outputs_report.csv\") sns.barplot(x=\"amount produced (tonne)\", y=\"product name\", hue=\"year\", data=data.groupby([\"product name\", \"year\"]) .sum() .reset_index());","title":"Sample charts"},{"location":"reports/#plant-emissions-report","text":"Report showing amount of emissions produced by each plant. Generated by RELOG.write_plant_emissions_report(solution, filename) . Column Description plant type Plant type. location name Location name. year Year. emission type Type of emission. amount (tonne) Amount of emission produced by the plant this year.","title":"Plant emissions report"},{"location":"reports/#sample-charts_2","text":"Bar plot showing total emission by plant type, grouped type of emissions (in Python): import pandas as pd import seaborn as sns; sns.set() data = pd.read_csv(\"plant_emissions_report.csv\") sns.barplot(x=\"plant type\", y=\"emission amount (tonne)\", hue=\"emission type\", data=data.groupby([\"plant type\", \"emission type\"]) .sum() .reset_index());","title":"Sample charts"},{"location":"reports/#products-report","text":"Report showing primary product amounts, locations and marginal costs. Generated by RELOG.write_products_report(solution, filename) . Column Description product name Product name. location name Name of the collection center. latitude (deg) Latitude of the collection center. longitude (deg) Longitude of the collection center. year What year this row corresponds to. This reports includes one row for each year. amount (tonne) Amount of product available at this collection center. amount disposed (tonne) Amount of product disposed of at this collection center. marginal cost ($/tonne) Cost to process one additional tonne of this product coming from this collection center.","title":"Products report"},{"location":"reports/#transportation-report","text":"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 RELOG.write_transportation_report(solution, filename) . Column Description source type If product is being shipped from an initial location, equals Origin . If product is being shipped from a plant, equals plant type. source location name Name of the location where the product is being shipped from. source latitude (deg) Latitude of the source location. source longitude (deg) Longitude of the source location. destination type Type of plant the product is being shipped to. destination location name Name of the location where the product is being shipped to. destination latitude (deg) Latitude of the destination location. destination longitude (deg) Longitude of the destination location. product Product being shipped. year Year. distance (km) Distance between source and destination. amount (tonne) Total amount of product being shipped between the two locations this year. amount-distance (tonne-km) Total amount being shipped this year times distance. transportation cost ($) Cost to transport this amount of product between the two locations for this year. transportation energy (GJ) Energy expended transporting this amount of product between the two locations.","title":"Transportation report"},{"location":"reports/#sample-charts_3","text":"Bar plot showing total amount-distance for each product type, grouped by year (in Python): import pandas as pd import seaborn as sns; sns.set() data = pd.read_csv(\"transportation_report.csv\") sns.barplot(x=\"product\", y=\"amount-distance (tonne-km)\", hue=\"year\", data=data.groupby([\"product\", \"year\"]) .sum() .reset_index()); Map of transportation lines (in Python): import pandas as pd import geopandas as gp from shapely.geometry import Point, LineString import matplotlib.pyplot as plt from matplotlib import collections # Plot base map world = gp.read_file(gp.datasets.get_path('naturalearth_lowres')) ax = world.plot(color='white', edgecolor='50', figsize=(14,7)) ax.set_ylim([23, 50]) ax.set_xlim([-128, -65]) # Draw transportation lines data = pd.read_csv(\"transportation_report.csv\") lines = [[(row[\"source longitude (deg)\"], row[\"source latitude (deg)\"]), (row[\"destination longitude (deg)\"], row[\"destination latitude (deg)\"]) ] for (index, row) in data.iterrows()] ax.add_collection(collections.LineCollection(lines, linewidths=0.25, zorder=1, alpha=0.5, color=\"50\")) # Draw source points points = gp.points_from_xy(data[\"source longitude (deg)\"], data[\"source latitude (deg)\"]) gp.GeoDataFrame(data, geometry=points).plot(ax=ax, color=\"0.5\", markersize=1); # Draw destination points points = gp.points_from_xy(data[\"destination longitude (deg)\"], data[\"destination latitude (deg)\"]) gp.GeoDataFrame(data, geometry=points).plot(ax=ax, color=\"red\", markersize=50);","title":"Sample charts"},{"location":"reports/#transportation-emissions-report","text":"Report showing emissions for each trip between initial locations and plants, and between pairs of plants. Generated by RELOG.write_transportation_emissions_report(solution, filename) . Column Description source type If product is being shipped from an initial location, equals Origin . If product is being shipped from a plant, equals plant type. source location name Name of the location where the product is being shipped from. source latitude (deg) Latitude of the source location. source longitude (deg) Longitude of the source location. destination type Type of plant the product is being shipped to. destination location name Name of the location where the product is being shipped to. destination latitude (deg) Latitude of the destination location. destination longitude (deg) Longitude of the destination location. product Product being shipped. year Year. distance (km) Distance between source and destination. shipped amount (tonne) Total amount of product being shipped between the two locations this year. shipped amount-distance (tonne-km) Total amount being shipped this year times distance. emission type Type of emission. emission amount (tonne) Amount of emission produced by transportation segment this year.","title":"Transportation emissions report"},{"location":"reports/#sample-charts_4","text":"Bar plot showing total emission amount by emission type, grouped by type of product being transported (in Python): import pandas as pd import seaborn as sns; sns.set() data = pd.read_csv(\"transportation_emissions_report.csv\") sns.barplot(x=\"emission type\", y=\"emission amount (tonne)\", hue=\"product\", data=data.groupby([\"product\", \"emission type\"]) .sum() .reset_index());","title":"Sample charts"},{"location":"usage/","text":"Usage 1. Installation To use RELOG, the first step is to install the Julia programming language 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: (@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: (@v1.5) pkg> test RELOG To update the package to a newer version, type ] to enter the package manager mode, then run: (@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. Products that are initially available must be sent to a plant for processing during the same time period they became available. 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. Products received by a plant can be either processed immediately or stored for later processing. Plants have a maximum storage capacity ( tonne ). Storage costs ( $/tonne ) can also be specified. All products 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 . 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: # Import package using RELOG # Solve optimization problem solution = RELOG.solve(\"/home/user/instance.json\") # Write full solution in JSON format RELOG.write(solution, \"solution.json\") # Write simplified reports in CSV format RELOG.write_plants_report(solution, \"plants.csv\") RELOG.write_transportation_report(solution, \"transportation.csv\") For a complete description of the file formats above, and for a complete list of available reports, see the data format page . 4. What-If Analysis 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. To simplify this what-if analysis, RELOG provides the resolve 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 resolve 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. The following snippet shows how to use the method: # Import package using RELOG # Optimize for the average scenario solution_avg, model_avg = RELOG.solve(\"input_avg.json\", return_model=true) # Write reports for the average scenario RELOG.write_plants_report(solution_avg, \"plants_avg.csv\") RELOG.write_transportation_report(solution_avg, \"transportation_avg.csv\") # Re-optimize for the high-demand scenario, keeping plants fixed solution_high = RELOG.resolve(model_avg, \"input_high.json\") # Write reports for the high-demand scenario RELOG.write_plants_report(solution_high, \"plants_high.csv\") RELOG.write_transportation_report(solution_high, \"transportation_high.csv\") To use the resolve method, the new input file should be very similar to the original one. Only the following entries are allowed to change: Products: Transportation costs, energy, emissions and initial amounts (latitude, longitude and amount). Plants: Energy and emissions. Plant's location: Latitude and longitude. Plant's storage: Cost. Plant's capacity: Opening cost, fixed operating cost and variable operating cost. 5. Advanced options 5.1 Changing the solver By default, RELOG internally uses Cbc , an open-source and freely-available Mixed-Integer Linear Programming solver developed by the COIN-OR Project . 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: using RELOG, Gurobi, JuMP gurobi = optimizer_with_attributes(Gurobi.Optimizer, \"TimeLimit\" => 3600, \"MIPGap\" => 0.001) RELOG.solve(\"instance.json\", output=\"solution.json\", optimizer=gurobi) 5.2 Multi-period heuristics 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: First, RELOG creates a single-period version of the problem, in which most values are replaced by their averages. This single-period problem is typically much easier to solve. After solving the simplified problem, RELOG resolves the multi-period version of the problem, but considering only candidate plant locations that were selected by the optimal solution to the single-period version of the problem. All remaining candidate plant locations are removed. To solve an instance using this heuristic, use the option heuristic=true , as shown below. using RELOG solution = RELOG.solve(\"/home/user/instance.json\", heuristic=true)","title":"Usage"},{"location":"usage/#usage","text":"","title":"Usage"},{"location":"usage/#1-installation","text":"To use RELOG, the first step is to install the Julia programming language 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: (@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: (@v1.5) pkg> test RELOG To update the package to a newer version, type ] to enter the package manager mode, then run: (@v1.5) pkg> update RELOG","title":"1. Installation"},{"location":"usage/#2-modeling-the-problem","text":"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. Products that are initially available must be sent to a plant for processing during the same time period they became available. 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. Products received by a plant can be either processed immediately or stored for later processing. Plants have a maximum storage capacity ( tonne ). Storage costs ( $/tonne ) can also be specified. All products 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 .","title":"2. Modeling the problem"},{"location":"usage/#3-running-the-optimization","text":"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: # Import package using RELOG # Solve optimization problem solution = RELOG.solve(\"/home/user/instance.json\") # Write full solution in JSON format RELOG.write(solution, \"solution.json\") # Write simplified reports in CSV format RELOG.write_plants_report(solution, \"plants.csv\") RELOG.write_transportation_report(solution, \"transportation.csv\") For a complete description of the file formats above, and for a complete list of available reports, see the data format page .","title":"3. Running the optimization"},{"location":"usage/#4-what-if-analysis","text":"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. To simplify this what-if analysis, RELOG provides the resolve 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 resolve 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. The following snippet shows how to use the method: # Import package using RELOG # Optimize for the average scenario solution_avg, model_avg = RELOG.solve(\"input_avg.json\", return_model=true) # Write reports for the average scenario RELOG.write_plants_report(solution_avg, \"plants_avg.csv\") RELOG.write_transportation_report(solution_avg, \"transportation_avg.csv\") # Re-optimize for the high-demand scenario, keeping plants fixed solution_high = RELOG.resolve(model_avg, \"input_high.json\") # Write reports for the high-demand scenario RELOG.write_plants_report(solution_high, \"plants_high.csv\") RELOG.write_transportation_report(solution_high, \"transportation_high.csv\") To use the resolve method, the new input file should be very similar to the original one. Only the following entries are allowed to change: Products: Transportation costs, energy, emissions and initial amounts (latitude, longitude and amount). Plants: Energy and emissions. Plant's location: Latitude and longitude. Plant's storage: Cost. Plant's capacity: Opening cost, fixed operating cost and variable operating cost.","title":"4. What-If Analysis"},{"location":"usage/#5-advanced-options","text":"","title":"5. Advanced options"},{"location":"usage/#51-changing-the-solver","text":"By default, RELOG internally uses Cbc , an open-source and freely-available Mixed-Integer Linear Programming solver developed by the COIN-OR Project . 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: using RELOG, Gurobi, JuMP gurobi = optimizer_with_attributes(Gurobi.Optimizer, \"TimeLimit\" => 3600, \"MIPGap\" => 0.001) RELOG.solve(\"instance.json\", output=\"solution.json\", optimizer=gurobi)","title":"5.1 Changing the solver"},{"location":"usage/#52-multi-period-heuristics","text":"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: First, RELOG creates a single-period version of the problem, in which most values are replaced by their averages. This single-period problem is typically much easier to solve. After solving the simplified problem, RELOG resolves the multi-period version of the problem, but considering only candidate plant locations that were selected by the optimal solution to the single-period version of the problem. All remaining candidate plant locations are removed. To solve an instance using this heuristic, use the option heuristic=true , as shown below. using RELOG solution = RELOG.solve(\"/home/user/instance.json\", heuristic=true)","title":"5.2 Multi-period heuristics"}]} \ No newline at end of file diff --git a/dev/search/worker.js b/dev/search/worker.js new file mode 100644 index 0000000..9cce2f7 --- /dev/null +++ b/dev/search/worker.js @@ -0,0 +1,130 @@ +var base_path = 'function' === typeof importScripts ? '.' : '/search/'; +var allowSearch = false; +var index; +var documents = {}; +var lang = ['en']; +var data; + +function getScript(script, callback) { + console.log('Loading script: ' + script); + $.getScript(base_path + script).done(function () { + callback(); + }).fail(function (jqxhr, settings, exception) { + console.log('Error: ' + exception); + }); +} + +function getScriptsInOrder(scripts, callback) { + if (scripts.length === 0) { + callback(); + return; + } + getScript(scripts[0], function() { + getScriptsInOrder(scripts.slice(1), callback); + }); +} + +function loadScripts(urls, callback) { + if( 'function' === typeof importScripts ) { + importScripts.apply(null, urls); + callback(); + } else { + getScriptsInOrder(urls, callback); + } +} + +function onJSONLoaded () { + data = JSON.parse(this.responseText); + var scriptsToLoad = ['lunr.js']; + if (data.config && data.config.lang && data.config.lang.length) { + lang = data.config.lang; + } + if (lang.length > 1 || lang[0] !== "en") { + scriptsToLoad.push('lunr.stemmer.support.js'); + if (lang.length > 1) { + scriptsToLoad.push('lunr.multi.js'); + } + for (var i=0; i < lang.length; i++) { + if (lang[i] != 'en') { + scriptsToLoad.push(['lunr', lang[i], 'js'].join('.')); + } + } + } + loadScripts(scriptsToLoad, onScriptsLoaded); +} + +function onScriptsLoaded () { + console.log('All search scripts loaded, building Lunr index...'); + if (data.config && data.config.separator && data.config.separator.length) { + lunr.tokenizer.separator = new RegExp(data.config.separator); + } + + if (data.index) { + index = lunr.Index.load(data.index); + data.docs.forEach(function (doc) { + documents[doc.location] = doc; + }); + console.log('Lunr pre-built index loaded, search ready'); + } else { + index = lunr(function () { + if (lang.length === 1 && lang[0] !== "en" && lunr[lang[0]]) { + this.use(lunr[lang[0]]); + } else if (lang.length > 1) { + this.use(lunr.multiLanguage.apply(null, lang)); // spread operator not supported in all browsers: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator#Browser_compatibility + } + this.field('title'); + this.field('text'); + this.ref('location'); + + for (var i=0; i < data.docs.length; i++) { + var doc = data.docs[i]; + this.add(doc); + documents[doc.location] = doc; + } + }); + console.log('Lunr index built, search ready'); + } + allowSearch = true; + postMessage({config: data.config}); + postMessage({allowSearch: allowSearch}); +} + +function init () { + var oReq = new XMLHttpRequest(); + oReq.addEventListener("load", onJSONLoaded); + var index_path = base_path + '/search_index.json'; + if( 'function' === typeof importScripts ){ + index_path = 'search_index.json'; + } + oReq.open("GET", index_path); + oReq.send(); +} + +function search (query) { + if (!allowSearch) { + console.error('Assets for search still loading'); + return; + } + + var resultDocuments = []; + var results = index.search(query); + for (var i=0; i < results.length; i++){ + var result = results[i]; + doc = documents[result.ref]; + doc.summary = doc.text.substring(0, 200); + resultDocuments.push(doc); + } + return resultDocuments; +} + +if( 'function' === typeof importScripts ) { + onmessage = function (e) { + if (e.data.init) { + init(); + } else if (e.data.query) { + postMessage({ results: search(e.data.query) }); + } else { + console.error("Worker - Unrecognized message: " + e); + } + }; +} diff --git a/dev/sitemap.xml b/dev/sitemap.xml new file mode 100644 index 0000000..7ce0980 --- /dev/null +++ b/dev/sitemap.xml @@ -0,0 +1,23 @@ + +To use RELOG, the first step is to install the Julia programming language 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:
(@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:
+(@v1.5) pkg> test RELOG
+
+To update the package to a newer version, type ]
to enter the package manager mode, then run:
(@v1.5) pkg> update RELOG
+
+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.
+Products that are initially available must be sent to a plant for processing during the same time period they became available.
+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.
Products received by a plant can be either processed immediately or stored for later processing. Plants have a maximum storage capacity (tonne
). Storage costs ($/tonne
) can also be specified.
All products 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.
+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:
+# Import package
+using RELOG
+
+# Solve optimization problem
+solution = RELOG.solve("/home/user/instance.json")
+
+# Write full solution in JSON format
+RELOG.write(solution, "solution.json")
+
+# Write simplified reports in CSV format
+RELOG.write_plants_report(solution, "plants.csv")
+RELOG.write_transportation_report(solution, "transportation.csv")
+
+For a complete description of the file formats above, and for a complete list of available reports, see the data format page.
+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.
+To simplify this what-if analysis, RELOG provides the resolve
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 resolve
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.
The following snippet shows how to use the method:
+# Import package
+using RELOG
+
+# Optimize for the average scenario
+solution_avg, model_avg = RELOG.solve("input_avg.json", return_model=true)
+
+# Write reports for the average scenario
+RELOG.write_plants_report(solution_avg, "plants_avg.csv")
+RELOG.write_transportation_report(solution_avg, "transportation_avg.csv")
+
+# Re-optimize for the high-demand scenario, keeping plants fixed
+solution_high = RELOG.resolve(model_avg, "input_high.json")
+
+# Write reports for the high-demand scenario
+RELOG.write_plants_report(solution_high, "plants_high.csv")
+RELOG.write_transportation_report(solution_high, "transportation_high.csv")
+
+To use the resolve
method, the new input file should be very similar to the original one. Only the following entries are allowed to change:
By default, RELOG internally uses Cbc, an open-source and freely-available Mixed-Integer Linear Programming solver developed by the COIN-OR Project. 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:
+using RELOG, Gurobi, JuMP
+
+gurobi = optimizer_with_attributes(Gurobi.Optimizer,
+ "TimeLimit" => 3600,
+ "MIPGap" => 0.001)
+
+RELOG.solve("instance.json",
+ output="solution.json",
+ optimizer=gurobi)
+
+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:
+First, RELOG creates a single-period version of the problem, in which most values are replaced by their averages. This single-period problem is typically much easier to solve.
+After solving the simplified problem, RELOG resolves the multi-period version of the problem, but considering only candidate plant locations that were selected by the optimal solution to the single-period version of the problem. All remaining candidate plant locations are removed.
+To solve an instance using this heuristic, use the option heuristic=true
, as shown below.
using RELOG
+
+solution = RELOG.solve("/home/user/instance.json",
+ heuristic=true)
+