diff --git a/0.4/images/ex_transportation_amount_distance.png b/0.4/images/ex_transportation_amount_distance.png index 8c52266..284e891 100644 Binary files a/0.4/images/ex_transportation_amount_distance.png and b/0.4/images/ex_transportation_amount_distance.png differ diff --git a/0.4/index.html b/0.4/index.html index d3f16a9..4e0545b 100644 --- a/0.4/index.html +++ b/0.4/index.html @@ -290,5 +290,5 @@ POSSIBILITY OF SUCH DAMAGE. diff --git a/0.4/reports/index.html b/0.4/reports/index.html index e402585..e1d790c 100644 --- a/0.4/reports/index.html +++ b/0.4/reports/index.html @@ -281,7 +281,7 @@ gp.GeoDataFrame(data, geometry=points).plot(ax=ax); What year this row corresponds to. This reports includes one row for each year in the simulation. -product +product name Product being produced. diff --git a/0.4/search/search_index.json b/0.4/search/search_index.json index ee40508..a0d9406 100644 --- a/0.4/search/search_index.json +++ b/0.4/search/search_index.json @@ -1 +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. 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] } }, \"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. capacities (tonne) A dictionary describing what plant sizes are allowed, and their characteristics. The keys in the disposal dictionary should be the names of the products. The values are dictionaries with the following keys: Key Description cost ($/tonne) The cost to dispose of the product. Must be a 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] } }, \"capacities (tonne)\": { \"100\": { \"opening cost ($)\": [500, 530], \"fixed operating cost ($)\": [300.0, 310.0], \"variable operating cost ($/tonne)\": [5.0, 5.2] }, \"500\": { \"opening cost ($)\": [750, 760], \"fixed operating cost ($)\": [400.0, 450.0], \"variable operating cost ($/tonne)\": [5.0, 5.2] } } } } } } } Current limitations Each plant can only be opened exactly once. After open, the plant remains open until the end of the simulation. Plants can be expanded at any time, even long after they are open. All material available at the beginning of a time period must be entirely processed by the end of that time period. It is not possible to store unprocessed materials from one time period to the next. Up to two plant sizes are currently supported. Variable operating costs must be the same for all plant sizes. 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. 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] } }, \"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. capacities (tonne) A dictionary describing what plant sizes are allowed, and their characteristics. The keys in the disposal dictionary should be the names of the products. The values are dictionaries with the following keys: Key Description cost ($/tonne) The cost to dispose of the product. Must be a 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] } }, \"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/#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 ) $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 ) 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_{mpt}$ - Amount of material $m$ disposed of by plant $p$ during time $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_{l \\in L} \\sum_{p \\in P} \\left[ c^{\\text{tr}}_t d_{lp} + c^{\\text{var}}_{pt} \\right] 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 the transportation costs and the variable operating costs. In the third 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} Plants have a limited capacity: \\begin{align} & \\sum_{l \\in L} y_{lpt} \\leq m^\\text{min}_p x_p + \\sum_{i=1}^t w_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 the plant input: \\begin{align} & q_{mpt} = \\alpha_{pm} \\sum_{l \\in L} y_{lpt} & \\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 \\\\ & m^\\text{disp}_{mpt} \\geq z_{mpt} \\geq 0 & \\forall m \\in M, p \\in P, t \\in T \\end{align} Complete optimization model \\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_{l \\in L} \\sum_{p \\in P} \\left[ c^{\\text{tr}}_t d_{lp} + c^{\\text{var}}_{pt} \\right] y_{lpt} + \\\\ & \\sum_{t \\in T} \\sum_{p \\in P} \\sum_{m \\in M} c^{\\text{disp}}_{pmt} z_{pmt} \\\\ \\text{subject to } & \\sum_{p \\in P} y_{lpt} = m^\\text{initial}_{lt} & \\forall l \\in L, t \\in T \\\\ & \\sum_{l \\in L} y_{lpt} \\leq m^\\text{min}_p x_p + \\sum_{i=1}^t w_p & \\forall p \\in P, t \\in T \\\\ & \\sum_{i=1}^t w_p \\leq m^\\text{max}_p x_p & \\forall p \\in P, t \\in T \\\\ & q_{mpt} = \\alpha_{pm} \\sum_{l \\in L} y_{lpt} & \\forall m \\in M, p \\in P, t \\in T \\\\ & q_{mpt} = z_{mpt} & \\forall m \\in M, p \\in P, t \\in T \\\\ & 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 \\\\ & 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 \\\\ & m^\\text{disp}_{mpt} \\geq z_{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 ) $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 ) 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_{mpt}$ - Amount of material $m$ disposed of by plant $p$ during time $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_{l \\in L} \\sum_{p \\in P} \\left[ c^{\\text{tr}}_t d_{lp} + c^{\\text{var}}_{pt} \\right] 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 the transportation costs and the variable operating costs. In the third 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} Plants have a limited capacity: \\begin{align} & \\sum_{l \\in L} y_{lpt} \\leq m^\\text{min}_p x_p + \\sum_{i=1}^t w_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 the plant input: \\begin{align} & q_{mpt} = \\alpha_{pm} \\sum_{l \\in L} y_{lpt} & \\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 \\\\ & m^\\text{disp}_{mpt} \\geq z_{mpt} \\geq 0 & \\forall m \\in M, p \\in P, t \\in T \\end{align}","title":"Constraints"},{"location":"model/#complete-optimization-model","text":"\\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_{l \\in L} \\sum_{p \\in P} \\left[ c^{\\text{tr}}_t d_{lp} + c^{\\text{var}}_{pt} \\right] y_{lpt} + \\\\ & \\sum_{t \\in T} \\sum_{p \\in P} \\sum_{m \\in M} c^{\\text{disp}}_{pmt} z_{pmt} \\\\ \\text{subject to } & \\sum_{p \\in P} y_{lpt} = m^\\text{initial}_{lt} & \\forall l \\in L, t \\in T \\\\ & \\sum_{l \\in L} y_{lpt} \\leq m^\\text{min}_p x_p + \\sum_{i=1}^t w_p & \\forall p \\in P, t \\in T \\\\ & \\sum_{i=1}^t w_p \\leq m^\\text{max}_p x_p & \\forall p \\in P, t \\in T \\\\ & q_{mpt} = \\alpha_{pm} \\sum_{l \\in L} y_{lpt} & \\forall m \\in M, p \\in P, t \\in T \\\\ & q_{mpt} = z_{mpt} & \\forall m \\in M, p \\in P, t \\in T \\\\ & 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 \\\\ & 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 \\\\ & m^\\text{disp}_{mpt} \\geq z_{mpt} \\geq 0 & \\forall m \\in M, p \\in P, t \\in T \\end{align*}","title":"Complete optimization model"},{"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) . For a concrete example, see nimh_plants.csv . 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 in the simulation. latitude (deg) Latitude of the plant. longitude (deg) Longitude of the plant. capacity (tonne) Capacity of the plant at this point in time. amount processed (tonne) Amount of input material received by the plant this 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 for processing the input material this year. 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) . For a concrete example, see nimh_plant_outputs.csv . 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 in the simulation. product 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) . For a concrete example, see nimh_plant_emissions.csv . 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()); 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) . For a concrete example, see nimh_transportation.csv . 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) . For a concrete example, see nimh_transportation_emissions.csv . 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) . For a concrete example, see nimh_plants.csv . 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 in the simulation. latitude (deg) Latitude of the plant. longitude (deg) Longitude of the plant. capacity (tonne) Capacity of the plant at this point in time. amount processed (tonne) Amount of input material received by the plant this 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 for processing the input material this year. 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) . For a concrete example, see nimh_plant_outputs.csv . 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 in the simulation. product 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) . For a concrete example, see nimh_plant_emissions.csv . 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/#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) . For a concrete example, see nimh_transportation.csv . 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) . For a concrete example, see nimh_transportation_emissions.csv . 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. Transporting products from one location to another incurs a transportation cost ( $/km/tonne ), spends some amount of energy ( J/km/tonne ) and may generate multiple types of emissions ( tonne/tonne ). All these parameters are user-specified and may be product- and time-specific. A plant is a facility that converts one type of product to another. RELOG assumes that each plant receives a single type of product as input and converts this input into multiple types of products. Multiple types of plants, with different inputs, outputs and performance characteristics, may be specified. In the NiMH battery recycling study case, for example, one type of plant could be a disassembly plant , which converts batteries into cathode and anode . Another type of plant could be anode recycling plant , which converts anode into rare-earth elements and scrap metals . To process each tonne of input material, plants incur a variable operating cost ( $/tonne ), spend some amount of energy ( GJ/tonne ), and produce multiple types of emissions ( tonne/tonne ). Plants also incur a fixed operating cost ( $ ) regardless of the amount of material they process. All these parameters are user-specified and may be region- and time-specific. Plants can be built at user-specified potential locations. Opening a plant incurs a one-time opening cost ( $ ) which may be region- and time-specific. Plants also have a limited capacity (in tonne ), which indicates the maximum amount of input material they are able to process per year. When specifying potential locations for each type of plant, it is also possible to specify the minimum and maximum capacity of the plants that can be built at that particular location. Different plants sizes may have different opening costs and fixed operating costs. After a plant is built, it can be further expanded in the following years, up to its maximum capacity. All products that are initially available must be sent to a plant for processing. All products that are generated by a plant can either be sent to another plant for further processing, or disposed of locally for either a profit or a loss ( $/tonne ). To model environmental regulations, it is also possible to specify the maximum amount of each product that can be disposed of at each location. All user parameters specified above must be provided to RELOG as a JSON file, which is fully described in the data format page . 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. Advanced options 4.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)","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. Transporting products from one location to another incurs a transportation cost ( $/km/tonne ), spends some amount of energy ( J/km/tonne ) and may generate multiple types of emissions ( tonne/tonne ). All these parameters are user-specified and may be product- and time-specific. A plant is a facility that converts one type of product to another. RELOG assumes that each plant receives a single type of product as input and converts this input into multiple types of products. Multiple types of plants, with different inputs, outputs and performance characteristics, may be specified. In the NiMH battery recycling study case, for example, one type of plant could be a disassembly plant , which converts batteries into cathode and anode . Another type of plant could be anode recycling plant , which converts anode into rare-earth elements and scrap metals . To process each tonne of input material, plants incur a variable operating cost ( $/tonne ), spend some amount of energy ( GJ/tonne ), and produce multiple types of emissions ( tonne/tonne ). Plants also incur a fixed operating cost ( $ ) regardless of the amount of material they process. All these parameters are user-specified and may be region- and time-specific. Plants can be built at user-specified potential locations. Opening a plant incurs a one-time opening cost ( $ ) which may be region- and time-specific. Plants also have a limited capacity (in tonne ), which indicates the maximum amount of input material they are able to process per year. When specifying potential locations for each type of plant, it is also possible to specify the minimum and maximum capacity of the plants that can be built at that particular location. Different plants sizes may have different opening costs and fixed operating costs. After a plant is built, it can be further expanded in the following years, up to its maximum capacity. All products that are initially available must be sent to a plant for processing. All products that are generated by a plant can either be sent to another plant for further processing, or disposed of locally for either a profit or a loss ( $/tonne ). To model environmental regulations, it is also possible to specify the maximum amount of each product that can be disposed of at each location. All user parameters specified above must be provided to RELOG as a JSON file, which is fully described in the data format page .","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-advanced-options","text":"","title":"4. Advanced options"},{"location":"usage/#41-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":"4.1 Changing the solver"}]} \ No newline at end of file +{"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. 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] } }, \"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. capacities (tonne) A dictionary describing what plant sizes are allowed, and their characteristics. The keys in the disposal dictionary should be the names of the products. The values are dictionaries with the following keys: Key Description cost ($/tonne) The cost to dispose of the product. Must be a 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] } }, \"capacities (tonne)\": { \"100\": { \"opening cost ($)\": [500, 530], \"fixed operating cost ($)\": [300.0, 310.0], \"variable operating cost ($/tonne)\": [5.0, 5.2] }, \"500\": { \"opening cost ($)\": [750, 760], \"fixed operating cost ($)\": [400.0, 450.0], \"variable operating cost ($/tonne)\": [5.0, 5.2] } } } } } } } Current limitations Each plant can only be opened exactly once. After open, the plant remains open until the end of the simulation. Plants can be expanded at any time, even long after they are open. All material available at the beginning of a time period must be entirely processed by the end of that time period. It is not possible to store unprocessed materials from one time period to the next. Up to two plant sizes are currently supported. Variable operating costs must be the same for all plant sizes. 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. 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] } }, \"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. capacities (tonne) A dictionary describing what plant sizes are allowed, and their characteristics. The keys in the disposal dictionary should be the names of the products. The values are dictionaries with the following keys: Key Description cost ($/tonne) The cost to dispose of the product. Must be a 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] } }, \"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/#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 ) $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 ) 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_{mpt}$ - Amount of material $m$ disposed of by plant $p$ during time $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_{l \\in L} \\sum_{p \\in P} \\left[ c^{\\text{tr}}_t d_{lp} + c^{\\text{var}}_{pt} \\right] 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 the transportation costs and the variable operating costs. In the third 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} Plants have a limited capacity: \\begin{align} & \\sum_{l \\in L} y_{lpt} \\leq m^\\text{min}_p x_p + \\sum_{i=1}^t w_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 the plant input: \\begin{align} & q_{mpt} = \\alpha_{pm} \\sum_{l \\in L} y_{lpt} & \\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 \\\\ & m^\\text{disp}_{mpt} \\geq z_{mpt} \\geq 0 & \\forall m \\in M, p \\in P, t \\in T \\end{align} Complete optimization model \\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_{l \\in L} \\sum_{p \\in P} \\left[ c^{\\text{tr}}_t d_{lp} + c^{\\text{var}}_{pt} \\right] y_{lpt} + \\\\ & \\sum_{t \\in T} \\sum_{p \\in P} \\sum_{m \\in M} c^{\\text{disp}}_{pmt} z_{pmt} \\\\ \\text{subject to } & \\sum_{p \\in P} y_{lpt} = m^\\text{initial}_{lt} & \\forall l \\in L, t \\in T \\\\ & \\sum_{l \\in L} y_{lpt} \\leq m^\\text{min}_p x_p + \\sum_{i=1}^t w_p & \\forall p \\in P, t \\in T \\\\ & \\sum_{i=1}^t w_p \\leq m^\\text{max}_p x_p & \\forall p \\in P, t \\in T \\\\ & q_{mpt} = \\alpha_{pm} \\sum_{l \\in L} y_{lpt} & \\forall m \\in M, p \\in P, t \\in T \\\\ & q_{mpt} = z_{mpt} & \\forall m \\in M, p \\in P, t \\in T \\\\ & 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 \\\\ & 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 \\\\ & m^\\text{disp}_{mpt} \\geq z_{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 ) $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 ) 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_{mpt}$ - Amount of material $m$ disposed of by plant $p$ during time $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_{l \\in L} \\sum_{p \\in P} \\left[ c^{\\text{tr}}_t d_{lp} + c^{\\text{var}}_{pt} \\right] 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 the transportation costs and the variable operating costs. In the third 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} Plants have a limited capacity: \\begin{align} & \\sum_{l \\in L} y_{lpt} \\leq m^\\text{min}_p x_p + \\sum_{i=1}^t w_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 the plant input: \\begin{align} & q_{mpt} = \\alpha_{pm} \\sum_{l \\in L} y_{lpt} & \\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 \\\\ & m^\\text{disp}_{mpt} \\geq z_{mpt} \\geq 0 & \\forall m \\in M, p \\in P, t \\in T \\end{align}","title":"Constraints"},{"location":"model/#complete-optimization-model","text":"\\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_{l \\in L} \\sum_{p \\in P} \\left[ c^{\\text{tr}}_t d_{lp} + c^{\\text{var}}_{pt} \\right] y_{lpt} + \\\\ & \\sum_{t \\in T} \\sum_{p \\in P} \\sum_{m \\in M} c^{\\text{disp}}_{pmt} z_{pmt} \\\\ \\text{subject to } & \\sum_{p \\in P} y_{lpt} = m^\\text{initial}_{lt} & \\forall l \\in L, t \\in T \\\\ & \\sum_{l \\in L} y_{lpt} \\leq m^\\text{min}_p x_p + \\sum_{i=1}^t w_p & \\forall p \\in P, t \\in T \\\\ & \\sum_{i=1}^t w_p \\leq m^\\text{max}_p x_p & \\forall p \\in P, t \\in T \\\\ & q_{mpt} = \\alpha_{pm} \\sum_{l \\in L} y_{lpt} & \\forall m \\in M, p \\in P, t \\in T \\\\ & q_{mpt} = z_{mpt} & \\forall m \\in M, p \\in P, t \\in T \\\\ & 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 \\\\ & 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 \\\\ & m^\\text{disp}_{mpt} \\geq z_{mpt} \\geq 0 & \\forall m \\in M, p \\in P, t \\in T \\end{align*}","title":"Complete optimization model"},{"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) . For a concrete example, see nimh_plants.csv . 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 in the simulation. latitude (deg) Latitude of the plant. longitude (deg) Longitude of the plant. capacity (tonne) Capacity of the plant at this point in time. amount processed (tonne) Amount of input material received by the plant this 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 for processing the input material this year. 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) . For a concrete example, see nimh_plant_outputs.csv . 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 in the simulation. 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) . For a concrete example, see nimh_plant_emissions.csv . 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()); 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) . For a concrete example, see nimh_transportation.csv . 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) . For a concrete example, see nimh_transportation_emissions.csv . 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) . For a concrete example, see nimh_plants.csv . 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 in the simulation. latitude (deg) Latitude of the plant. longitude (deg) Longitude of the plant. capacity (tonne) Capacity of the plant at this point in time. amount processed (tonne) Amount of input material received by the plant this 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 for processing the input material this year. 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) . For a concrete example, see nimh_plant_outputs.csv . 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 in the simulation. 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) . For a concrete example, see nimh_plant_emissions.csv . 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/#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) . For a concrete example, see nimh_transportation.csv . 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) . For a concrete example, see nimh_transportation_emissions.csv . 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. Transporting products from one location to another incurs a transportation cost ( $/km/tonne ), spends some amount of energy ( J/km/tonne ) and may generate multiple types of emissions ( tonne/tonne ). All these parameters are user-specified and may be product- and time-specific. A plant is a facility that converts one type of product to another. RELOG assumes that each plant receives a single type of product as input and converts this input into multiple types of products. Multiple types of plants, with different inputs, outputs and performance characteristics, may be specified. In the NiMH battery recycling study case, for example, one type of plant could be a disassembly plant , which converts batteries into cathode and anode . Another type of plant could be anode recycling plant , which converts anode into rare-earth elements and scrap metals . To process each tonne of input material, plants incur a variable operating cost ( $/tonne ), spend some amount of energy ( GJ/tonne ), and produce multiple types of emissions ( tonne/tonne ). Plants also incur a fixed operating cost ( $ ) regardless of the amount of material they process. All these parameters are user-specified and may be region- and time-specific. Plants can be built at user-specified potential locations. Opening a plant incurs a one-time opening cost ( $ ) which may be region- and time-specific. Plants also have a limited capacity (in tonne ), which indicates the maximum amount of input material they are able to process per year. When specifying potential locations for each type of plant, it is also possible to specify the minimum and maximum capacity of the plants that can be built at that particular location. Different plants sizes may have different opening costs and fixed operating costs. After a plant is built, it can be further expanded in the following years, up to its maximum capacity. All products that are initially available must be sent to a plant for processing. All products that are generated by a plant can either be sent to another plant for further processing, or disposed of locally for either a profit or a loss ( $/tonne ). To model environmental regulations, it is also possible to specify the maximum amount of each product that can be disposed of at each location. All user parameters specified above must be provided to RELOG as a JSON file, which is fully described in the data format page . 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. Advanced options 4.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)","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. Transporting products from one location to another incurs a transportation cost ( $/km/tonne ), spends some amount of energy ( J/km/tonne ) and may generate multiple types of emissions ( tonne/tonne ). All these parameters are user-specified and may be product- and time-specific. A plant is a facility that converts one type of product to another. RELOG assumes that each plant receives a single type of product as input and converts this input into multiple types of products. Multiple types of plants, with different inputs, outputs and performance characteristics, may be specified. In the NiMH battery recycling study case, for example, one type of plant could be a disassembly plant , which converts batteries into cathode and anode . Another type of plant could be anode recycling plant , which converts anode into rare-earth elements and scrap metals . To process each tonne of input material, plants incur a variable operating cost ( $/tonne ), spend some amount of energy ( GJ/tonne ), and produce multiple types of emissions ( tonne/tonne ). Plants also incur a fixed operating cost ( $ ) regardless of the amount of material they process. All these parameters are user-specified and may be region- and time-specific. Plants can be built at user-specified potential locations. Opening a plant incurs a one-time opening cost ( $ ) which may be region- and time-specific. Plants also have a limited capacity (in tonne ), which indicates the maximum amount of input material they are able to process per year. When specifying potential locations for each type of plant, it is also possible to specify the minimum and maximum capacity of the plants that can be built at that particular location. Different plants sizes may have different opening costs and fixed operating costs. After a plant is built, it can be further expanded in the following years, up to its maximum capacity. All products that are initially available must be sent to a plant for processing. All products that are generated by a plant can either be sent to another plant for further processing, or disposed of locally for either a profit or a loss ( $/tonne ). To model environmental regulations, it is also possible to specify the maximum amount of each product that can be disposed of at each location. All user parameters specified above must be provided to RELOG as a JSON file, which is fully described in the data format page .","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-advanced-options","text":"","title":"4. Advanced options"},{"location":"usage/#41-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":"4.1 Changing the solver"}]} \ No newline at end of file diff --git a/0.4/sitemap.xml b/0.4/sitemap.xml index 46f1201..93e033d 100644 --- a/0.4/sitemap.xml +++ b/0.4/sitemap.xml @@ -1,23 +1,23 @@ None - 2020-09-18 + 2020-09-21 daily None - 2020-09-18 + 2020-09-21 daily None - 2020-09-18 + 2020-09-21 daily None - 2020-09-18 + 2020-09-21 daily None - 2020-09-18 + 2020-09-21 daily \ No newline at end of file diff --git a/0.4/sitemap.xml.gz b/0.4/sitemap.xml.gz index efde09f..e9108c1 100644 Binary files a/0.4/sitemap.xml.gz and b/0.4/sitemap.xml.gz differ