diff --git a/docs/404.html b/docs/404.html index 35fbb3a..e989583 100644 --- a/docs/404.html +++ b/docs/404.html @@ -75,19 +75,19 @@
  • - Install + Usage
  • - Model + Data Format
  • - Optimize + Optimization Model
  • diff --git a/docs/format/index.html b/docs/format/index.html new file mode 100644 index 0000000..713af28 --- /dev/null +++ b/docs/format/index.html @@ -0,0 +1,515 @@ + + + + + + + + + + + + + + Data Format - RELOG + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    + +

    Data Format

    +

    The first step when using RELOG is to describe the reverse logistics pipeline and the relevant data. RELOG accepts as input a JSON file with three sections: parameters, products and plants. Below, we describe each section in more detail.

    +

    Parameters

    +

    The parameters section describes details about the simulation itself.

    + + + + + + + + + + + + + + + + + +
    KeyDescription
    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:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeyDescription
    transportation cost ($/km/tonne)The cost to transport this product. Must be a timeseries.
    transportation energy (J/km/tonne)The energy required to transport this product. Must be a timeseries. Optional.
    transportation emissions (tonne/km/tonne)A dictionary mapping the name of each greenhouse gas, produced to transport one tonne of this product along one kilometer, to the amount of gas produced (in tonnes). Must be a timeseries. Optional.
    initial amountsA dictionary mapping the name of each location to its description (see below). If this product is not initially available, this key may be omitted. Must be a timeseries.
    +

    Each product may have some amount available at the beginning of each time period. In this case, the key initial amounts maps to a dictionary with the following keys:

    + + + + + + + + + + + + + + + + + + + + + +
    KeyDescription
    latitude (deg)The latitude of the location.
    longitude (deg)The longitude of the location.
    amount (tonne)The amount of the product initially available at the location. Must be a timeseries.
    +

    Example

    +
    {
    +    "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:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeyDescription
    inputThe name of the product that this plant takes as input. Only one input is accepted per plant.
    outputs (tonne/tonne)A dictionary specifying how many tonnes of each product is produced for each tonnes of input. For example, if the plant outputs 0.5 tonnes of P2 and 0.25 tonnes of P3 for each tonnes of P1 provided, then this entry should be {"P2": 0.5, "P3": 0.25}. If the plant does not output anything, this key may be omitted.
    energy (GJ/tonne)The energy required to process 1 tonne of the input. Must be a timeseries. Optional.
    emissions (tonne/tonne)A dictionary mapping the name of each greenhouse gas, produced to process each tonne of input, to the amount of gas produced (in tonne). Must be a timeseries. Optional.
    locationsA 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:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    KeyDescription
    latitude (deg)The latitude of the location, in degrees.
    longitude (deg)The longitude of the location, in degrees.
    disposalA 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:

    + + + + + + + + + + + + + + + + + +
    KeyDescription
    cost ($/tonne)The cost to dispose of the product. Must be a timeseries.
    limit (tonne)The maximum amount that can be disposed of. If an unlimited amount can be disposed, this key may be omitted. Must be a timeseries.
    +

    The keys in the capacities (tonne) dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys:

    + + + + + + + + + + + + + + + + + + + + + +
    KeyDescription
    opening cost ($)The cost to open a plant of this size.
    fixed operating cost ($)The cost to keep the plant open, even if the plant doesn't process anything. Must be a timeseries.
    variable operating cost ($/tonne)The cost that the plant incurs to process each tonne of input. Must be a timeseries.
    +

    Example

    +
    {
    +    "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

    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html index 8d13217..8f4b464 100644 --- a/docs/index.html +++ b/docs/index.html @@ -75,19 +75,19 @@
  • - Install + Usage
  • - Model + Data Format
  • - Optimize + Optimization Model
  • @@ -105,7 +105,7 @@
  • -
  • @@ -136,12 +136,12 @@

    RELOG: Reverse Logistics Optimization

    -

    RELOG is a supply chain optimization package focusing on reverse logistics and reverse manufacturing. For example, the package can be used to determine where to build recycling plants, what sizes should they have and which customers should be served by which plants. The package supports customized reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods.

    +

    RELOG is a supply chain optimization package focusing on reverse logistics and reverse manufacturing. The package uses Mixed-Integer Linear Programming to determine where to build recycling plants, what size should these plants have and which customers should be served by which plants. The package supports custom reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods.

    Table of Contents

    Source Code

    diff --git a/docs/search/search_index.json b/docs/search/search_index.json index b9a83e6..bef705a 100644 --- a/docs/search/search_index.json +++ b/docs/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 a supply chain optimization package focusing on reverse logistics and reverse manufacturing. For example, the package can be used to determine where to build recycling plants, what sizes should they have and which customers should be served by which plants. The package supports customized reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods. Table of Contents Installation Modeling Optimizing Source Code https://anl-ceeesa.github.io/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 a supply chain optimization package focusing on reverse logistics and reverse manufacturing. For example, the package can be used to determine where to build recycling plants, what sizes should they have and which customers should be served by which plants. The package supports customized reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods.","title":"RELOG: Reverse Logistics Optimization"},{"location":"#table-of-contents","text":"Installation Modeling Optimizing","title":"Table of Contents"},{"location":"#source-code","text":"https://anl-ceeesa.github.io/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":"install/","text":"Installation The package was developed and tested with Julia 1.3 and may not be compatible with newer versions. To install it, launch the Julia console, type ] to switch to package manager mode and run: pkg> add https://github.com/ANL-CEEESA/RELOG.git To make sure that the package has been correctly installed: pkg> test RELOG","title":"Install"},{"location":"install/#installation","text":"The package was developed and tested with Julia 1.3 and may not be compatible with newer versions. To install it, launch the Julia console, type ] to switch to package manager mode and run: pkg> add https://github.com/ANL-CEEESA/RELOG.git To make sure that the package has been correctly installed: pkg> test RELOG","title":"Installation"},{"location":"model/","text":"Modeling The first step when using RELOG is to describe the reverse logistics pipeline and the relevant data. RELOG accepts as input a JSON file with three sections: parameters , products and plants . Below, we describe each section in more detail. Parameters The parameters section describes details about the simulation itself. Key Description time horizon (years) Number of years in the simulation. building period (years) List of years in which we are allowed to open new plants. For example, if this parameter is set to [1,2,3] , we can only open plants during the first three years. By default, this equals [1] ; that is, plants can only be opened during the first year. Example { \"parameters\": { \"time horizon (years)\": 2, \"building period (years)\": [1] } } Products The products section describes all products and subproducts in the simulation. The field instance[\"Products\"] is a dictionary mapping the name of the product to a dictionary which describes its characteristics. Each product description contains the following keys: Key Description transportation cost ($/km/tonne) The cost to transport this product. Must be a timeseries. transportation energy (J/km/tonne) The energy required to transport this product. Must be a timeseries. Optional. transportation emissions (tonne/km/tonne) A dictionary mapping the name of each greenhouse gas, produced to transport one tonne of this product along one kilometer, to the amount of gas produced (in tonnes). Must be a timeseries. Optional. initial amounts A dictionary mapping the name of each location to its description (see below). If this product is not initially available, this key may be omitted. Must be a timeseries. Each product may have some amount available at the beginning of each time period. In this case, the key initial amounts maps to a dictionary with the following keys: Key Description latitude (deg) The latitude of the location. longitude (deg) The longitude of the location. amount (tonne) The amount of the product initially available at the location. Must be a timeseries. Example { \"products\": { \"P1\": { \"initial amounts\": { \"C1\": { \"latitude (deg)\": 7.0, \"longitude (deg)\": 7.0, \"amount (tonne)\": [934.56, 934.56] }, \"C2\": { \"latitude (deg)\": 7.0, \"longitude (deg)\": 19.0, \"amount (tonne)\": [198.95, 198.95] }, \"C3\": { \"latitude (deg)\": 84.0, \"longitude (deg)\": 76.0, \"amount (tonne)\": [212.97, 212.97] } }, \"transportation cost ($/km/tonne)\": [0.015, 0.015], \"transportation energy (J/km/tonne)\": [0.12, 0.11], \"transportation emissions (tonne/km/tonne)\": { \"CO2\": [0.052, 0.050], \"CH4\": [0.003, 0.002] } }, \"P2\": { \"transportation cost ($/km/tonne)\": [0.022, 0.020] }, \"P3\": { \"transportation cost ($/km/tonne)\": [0.0125, 0.0125] }, \"P4\": { \"transportation cost ($/km/tonne)\": [0.0175, 0.0175] } } } Processing Plants The plants section describes the available types of reverse manufacturing plants, their potential locations and associated costs, as well as their inputs and outputs. The field instance[\"Plants\"] is a dictionary mapping the name of the plant to a dictionary with the following keys: Key Description input The name of the product that this plant takes as input. Only one input is accepted per plant. outputs (tonne/tonne) A dictionary specifying how many tonnes of each product is produced for each tonnes of input. For example, if the plant outputs 0.5 tonnes of P2 and 0.25 tonnes of P3 for each tonnes of P1 provided, then this entry should be {\"P2\": 0.5, \"P3\": 0.25} . If the plant does not output anything, this key may be omitted. energy (GJ/tonne) The energy required to process 1 tonne of the input. Must be a timeseries. Optional. emissions (tonne/tonne) A dictionary mapping the name of each greenhouse gas, produced to process each tonne of input, to the amount of gas produced (in tonne). Must be a timeseries. Optional. locations A dictionary mapping the name of the location to a dictionary which describes the site characteristics (see below). Each type of plant is associated with a set of potential locations where it can be built. Each location is represented by a dictionary with the following keys: Key Description latitude (deg) The latitude of the location, in degrees. longitude (deg) The longitude of the location, in degrees. disposal A dictionary describing what products can be disposed locally at the plant. capacities (tonne) A dictionary describing what plant sizes are allowed, and their characteristics. The keys in the disposal dictionary should be the names of the products. The values are dictionaries with the following keys: Key Description cost ($/tonne) The cost to dispose of the product. Must be a timeseries. limit (tonne) The maximum amount that can be disposed of. If an unlimited amount can be disposed, this key may be omitted. Must be a timeseries. The keys in the capacities (tonne) dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys: Key Description opening cost ($) The cost to open a plant of this size. fixed operating cost ($) The cost to keep the plant open, even if the plant doesn't process anything. Must be a timeseries. variable operating cost ($/tonne) The cost that the plant incurs to process each tonne of input. Must be a timeseries. Example { \"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.","title":"Model"},{"location":"model/#modeling","text":"The first step when using RELOG is to describe the reverse logistics pipeline and the relevant data. RELOG accepts as input a JSON file with three sections: parameters , products and plants . Below, we describe each section in more detail.","title":"Modeling"},{"location":"model/#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":"model/#example","text":"{ \"parameters\": { \"time horizon (years)\": 2, \"building period (years)\": [1] } }","title":"Example"},{"location":"model/#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 timeseries. transportation energy (J/km/tonne) The energy required to transport this product. Must be a timeseries. Optional. transportation emissions (tonne/km/tonne) A dictionary mapping the name of each greenhouse gas, produced to transport one tonne of this product along one kilometer, to the amount of gas produced (in tonnes). Must be a timeseries. Optional. initial amounts A dictionary mapping the name of each location to its description (see below). If this product is not initially available, this key may be omitted. Must be a timeseries. Each product may have some amount available at the beginning of each time period. In this case, the key initial amounts maps to a dictionary with the following keys: Key Description latitude (deg) The latitude of the location. longitude (deg) The longitude of the location. amount (tonne) The amount of the product initially available at the location. Must be a timeseries.","title":"Products"},{"location":"model/#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":"model/#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 timeseries. Optional. emissions (tonne/tonne) A dictionary mapping the name of each greenhouse gas, produced to process each tonne of input, to the amount of gas produced (in tonne). Must be a timeseries. Optional. locations A dictionary mapping the name of the location to a dictionary which describes the site characteristics (see below). Each type of plant is associated with a set of potential locations where it can be built. Each location is represented by a dictionary with the following keys: Key Description latitude (deg) The latitude of the location, in degrees. longitude (deg) The longitude of the location, in degrees. disposal A dictionary describing what products can be disposed locally at the plant. capacities (tonne) A dictionary describing what plant sizes are allowed, and their characteristics. The keys in the disposal dictionary should be the names of the products. The values are dictionaries with the following keys: Key Description cost ($/tonne) The cost to dispose of the product. Must be a timeseries. limit (tonne) The maximum amount that can be disposed of. If an unlimited amount can be disposed, this key may be omitted. Must be a timeseries. The keys in the capacities (tonne) dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys: Key Description opening cost ($) The cost to open a plant of this size. fixed operating cost ($) The cost to keep the plant open, even if the plant doesn't process anything. Must be a timeseries. variable operating cost ($/tonne) The cost that the plant incurs to process each tonne of input. Must be a timeseries.","title":"Processing Plants"},{"location":"model/#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":"model/#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":"optimize/","text":"Optimizing After creating a JSON file describing the reverse manufacturing process and the input data, the following example illustrates how to use the package to find the optimal set of decisions: using RELOG RELOG.solve(\"/home/user/instance.json\") The optimal logistics plan will be printed to the screen.","title":"Optimize"},{"location":"optimize/#optimizing","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: using RELOG RELOG.solve(\"/home/user/instance.json\") The optimal logistics plan will be printed to the screen.","title":"Optimizing"}]} \ 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 a supply chain optimization package focusing on reverse logistics and reverse manufacturing. The package uses Mixed-Integer Linear Programming to determine where to build recycling plants, what size should these plants have and which customers should be served by which plants. The package supports custom reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods. Table of Contents Usage Data Format Optimization model Source Code https://anl-ceeesa.github.io/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 a supply chain optimization package focusing on reverse logistics and reverse manufacturing. The package uses Mixed-Integer Linear Programming to determine where to build recycling plants, what size should these plants have and which customers should be served by which plants. The package supports custom reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods.","title":"RELOG: Reverse Logistics Optimization"},{"location":"#table-of-contents","text":"Usage Data Format Optimization model","title":"Table of Contents"},{"location":"#source-code","text":"https://anl-ceeesa.github.io/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":"Data Format The first step when using RELOG is to describe the reverse logistics pipeline and the relevant data. RELOG accepts as input a JSON file with three sections: parameters , products and plants . Below, we describe each section in more detail. Parameters The parameters section describes details about the simulation itself. Key Description time horizon (years) Number of years in the simulation. building period (years) List of years in which we are allowed to open new plants. For example, if this parameter is set to [1,2,3] , we can only open plants during the first three years. By default, this equals [1] ; that is, plants can only be opened during the first year. Example { \"parameters\": { \"time horizon (years)\": 2, \"building period (years)\": [1] } } Products The products section describes all products and subproducts in the simulation. The field instance[\"Products\"] is a dictionary mapping the name of the product to a dictionary which describes its characteristics. Each product description contains the following keys: Key Description transportation cost ($/km/tonne) The cost to transport this product. Must be a timeseries. transportation energy (J/km/tonne) The energy required to transport this product. Must be a timeseries. Optional. transportation emissions (tonne/km/tonne) A dictionary mapping the name of each greenhouse gas, produced to transport one tonne of this product along one kilometer, to the amount of gas produced (in tonnes). Must be a timeseries. Optional. initial amounts A dictionary mapping the name of each location to its description (see below). If this product is not initially available, this key may be omitted. Must be a timeseries. Each product may have some amount available at the beginning of each time period. In this case, the key initial amounts maps to a dictionary with the following keys: Key Description latitude (deg) The latitude of the location. longitude (deg) The longitude of the location. amount (tonne) The amount of the product initially available at the location. Must be a timeseries. Example { \"products\": { \"P1\": { \"initial amounts\": { \"C1\": { \"latitude (deg)\": 7.0, \"longitude (deg)\": 7.0, \"amount (tonne)\": [934.56, 934.56] }, \"C2\": { \"latitude (deg)\": 7.0, \"longitude (deg)\": 19.0, \"amount (tonne)\": [198.95, 198.95] }, \"C3\": { \"latitude (deg)\": 84.0, \"longitude (deg)\": 76.0, \"amount (tonne)\": [212.97, 212.97] } }, \"transportation cost ($/km/tonne)\": [0.015, 0.015], \"transportation energy (J/km/tonne)\": [0.12, 0.11], \"transportation emissions (tonne/km/tonne)\": { \"CO2\": [0.052, 0.050], \"CH4\": [0.003, 0.002] } }, \"P2\": { \"transportation cost ($/km/tonne)\": [0.022, 0.020] }, \"P3\": { \"transportation cost ($/km/tonne)\": [0.0125, 0.0125] }, \"P4\": { \"transportation cost ($/km/tonne)\": [0.0175, 0.0175] } } } Processing Plants The plants section describes the available types of reverse manufacturing plants, their potential locations and associated costs, as well as their inputs and outputs. The field instance[\"Plants\"] is a dictionary mapping the name of the plant to a dictionary with the following keys: Key Description input The name of the product that this plant takes as input. Only one input is accepted per plant. outputs (tonne/tonne) A dictionary specifying how many tonnes of each product is produced for each tonnes of input. For example, if the plant outputs 0.5 tonnes of P2 and 0.25 tonnes of P3 for each tonnes of P1 provided, then this entry should be {\"P2\": 0.5, \"P3\": 0.25} . If the plant does not output anything, this key may be omitted. energy (GJ/tonne) The energy required to process 1 tonne of the input. Must be a timeseries. Optional. emissions (tonne/tonne) A dictionary mapping the name of each greenhouse gas, produced to process each tonne of input, to the amount of gas produced (in tonne). Must be a timeseries. Optional. locations A dictionary mapping the name of the location to a dictionary which describes the site characteristics (see below). Each type of plant is associated with a set of potential locations where it can be built. Each location is represented by a dictionary with the following keys: Key Description latitude (deg) The latitude of the location, in degrees. longitude (deg) The longitude of the location, in degrees. disposal A dictionary describing what products can be disposed locally at the plant. capacities (tonne) A dictionary describing what plant sizes are allowed, and their characteristics. The keys in the disposal dictionary should be the names of the products. The values are dictionaries with the following keys: Key Description cost ($/tonne) The cost to dispose of the product. Must be a timeseries. limit (tonne) The maximum amount that can be disposed of. If an unlimited amount can be disposed, this key may be omitted. Must be a timeseries. The keys in the capacities (tonne) dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys: Key Description opening cost ($) The cost to open a plant of this size. fixed operating cost ($) The cost to keep the plant open, even if the plant doesn't process anything. Must be a timeseries. variable operating cost ($/tonne) The cost that the plant incurs to process each tonne of input. Must be a timeseries. Example { \"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.","title":"Data Format"},{"location":"format/#data-format","text":"The first step when using RELOG is to describe the reverse logistics pipeline and the relevant data. RELOG accepts as input a JSON file with three sections: parameters , products and plants . Below, we describe each section in more detail.","title":"Data Format"},{"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 timeseries. transportation energy (J/km/tonne) The energy required to transport this product. Must be a timeseries. Optional. transportation emissions (tonne/km/tonne) A dictionary mapping the name of each greenhouse gas, produced to transport one tonne of this product along one kilometer, to the amount of gas produced (in tonnes). Must be a timeseries. Optional. initial amounts A dictionary mapping the name of each location to its description (see below). If this product is not initially available, this key may be omitted. Must be a timeseries. Each product may have some amount available at the beginning of each time period. In this case, the key initial amounts maps to a dictionary with the following keys: Key Description latitude (deg) The latitude of the location. longitude (deg) The longitude of the location. amount (tonne) The amount of the product initially available at the location. Must be a timeseries.","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 timeseries. Optional. emissions (tonne/tonne) A dictionary mapping the name of each greenhouse gas, produced to process each tonne of input, to the amount of gas produced (in tonne). Must be a timeseries. Optional. locations A dictionary mapping the name of the location to a dictionary which describes the site characteristics (see below). Each type of plant is associated with a set of potential locations where it can be built. Each location is represented by a dictionary with the following keys: Key Description latitude (deg) The latitude of the location, in degrees. longitude (deg) The longitude of the location, in degrees. disposal A dictionary describing what products can be disposed locally at the plant. capacities (tonne) A dictionary describing what plant sizes are allowed, and their characteristics. The keys in the disposal dictionary should be the names of the products. The values are dictionaries with the following keys: Key Description cost ($/tonne) The cost to dispose of the product. Must be a timeseries. limit (tonne) The maximum amount that can be disposed of. If an unlimited amount can be disposed, this key may be omitted. Must be a timeseries. The keys in the capacities (tonne) dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys: Key Description opening cost ($) The cost to open a plant of this size. fixed operating cost ($) The cost to keep the plant open, even if the plant doesn't process anything. Must be a timeseries. variable operating cost ($/tonne) The cost that the plant incurs to process each tonne of input. Must be a timeseries.","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":"model/","text":"","title":"Optimization Model"},{"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: using RELOG RELOG.solve(\"/home/user/instance.json\", output=\"/home/user/solution.json\") The optimal logistics plan will be stored in the output file specified. See data format page for a description of this output file. 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: using RELOG RELOG.solve(\"/home/user/instance.json\", output=\"/home/user/solution.json\") The optimal logistics plan will be stored in the output file specified. See data format page for a description of this output file.","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/docs/sitemap.xml b/docs/sitemap.xml index a7d883a..f9ce46f 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,19 +1,19 @@ None - 2020-08-07 + 2020-08-21 daily None - 2020-08-07 + 2020-08-21 daily None - 2020-08-07 + 2020-08-21 daily None - 2020-08-07 + 2020-08-21 daily \ No newline at end of file diff --git a/docs/sitemap.xml.gz b/docs/sitemap.xml.gz index dd72a1a..e8bde5e 100644 Binary files a/docs/sitemap.xml.gz and b/docs/sitemap.xml.gz differ diff --git a/docs/optimize/index.html b/docs/usage/index.html similarity index 53% rename from docs/optimize/index.html rename to docs/usage/index.html index 2123908..9a69520 100644 --- a/docs/optimize/index.html +++ b/docs/usage/index.html @@ -11,7 +11,7 @@ - Optimize - RELOG + Usage - RELOG @@ -74,20 +74,20 @@ -
  • - Install +
  • + Usage
  • - Model + Data Format
  • -
  • - Optimize +
  • + Optimization Model
  • @@ -100,17 +100,17 @@
  • -
  • -
  • -
  • - Edit on GitHub + Edit on GitHub
  • @@ -122,18 +122,79 @@
    -

    Optimizing

    +

    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.

    + +

    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.

    + +

    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:

    using RELOG
    -RELOG.solve("/home/user/instance.json")
    +RELOG.solve("/home/user/instance.json",
    +            output="/home/user/solution.json")
     
    -

    The optimal logistics plan will be printed to the screen.

    +

    The optimal logistics plan will be stored in the output file specified. See data format page for a description of this output file.

    +

    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)
    +
    diff --git a/mkdocs.yml b/mkdocs.yml index 3c636b4..14e79f9 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -5,9 +5,9 @@ repo_url: https://github.com/ANL-CEEESA/RELOG edit_uri: edit/master/src/docs/ nav: - Home: index.md - - Install: install.md - - Model: model.md - - Optimize: optimize.md + - Usage: usage.md + - Data Format: format.md + - Optimization Model: model.md plugins: - search markdown_extensions: diff --git a/src/docs/format.md b/src/docs/format.md new file mode 100644 index 0000000..c40a436 --- /dev/null +++ b/src/docs/format.md @@ -0,0 +1,174 @@ +# Data Format + +The first step when using RELOG is to describe the reverse logistics pipeline and the relevant data. RELOG accepts as input a JSON file with three sections: `parameters`, `products` and `plants`. Below, we describe each section in more detail. + +## Parameters + +The **parameters** section describes details about the simulation itself. + +| Key | Description +|:--------------------------|---------------| +|`time horizon (years)` | Number of years in the simulation. +|`building period (years)` | List of years in which we are allowed to open new plants. For example, if this parameter is set to `[1,2,3]`, we can only open plants during the first three years. By default, this equals `[1]`; that is, plants can only be opened during the first year. | + + +### Example +```json +{ + "parameters": { + "time horizon (years)": 2, + "building period (years)": [1] + } +} +``` + +## Products + +The **products** section describes all products and subproducts in the simulation. The field `instance["Products"]` is a dictionary mapping the name of the product to a dictionary which describes its characteristics. Each product description contains the following keys: + +| Key | Description +|:--------------------------------------|---------------| +|`transportation cost ($/km/tonne)` | The cost to transport this product. Must be a timeseries. +|`transportation energy (J/km/tonne)` | The energy required to transport this product. Must be a timeseries. Optional. +|`transportation emissions (tonne/km/tonne)` | A dictionary mapping the name of each greenhouse gas, produced to transport one tonne of this product along one kilometer, to the amount of gas produced (in tonnes). Must be a timeseries. Optional. +|`initial amounts` | A dictionary mapping the name of each location to its description (see below). If this product is not initially available, this key may be omitted. Must be a timeseries. + +Each product may have some amount available at the beginning of each time period. In this case, the key `initial amounts` maps to a dictionary with the following keys: + +| Key | Description +|:------------------------|---------------| +| `latitude (deg)` | The latitude of the location. +| `longitude (deg)` | The longitude of the location. +| `amount (tonne)` | The amount of the product initially available at the location. Must be a timeseries. + +### Example + +```json +{ + "products": { + "P1": { + "initial amounts": { + "C1": { + "latitude (deg)": 7.0, + "longitude (deg)": 7.0, + "amount (tonne)": [934.56, 934.56] + }, + "C2": { + "latitude (deg)": 7.0, + "longitude (deg)": 19.0, + "amount (tonne)": [198.95, 198.95] + }, + "C3": { + "latitude (deg)": 84.0, + "longitude (deg)": 76.0, + "amount (tonne)": [212.97, 212.97] + } + }, + "transportation cost ($/km/tonne)": [0.015, 0.015], + "transportation energy (J/km/tonne)": [0.12, 0.11], + "transportation emissions (tonne/km/tonne)": { + "CO2": [0.052, 0.050], + "CH4": [0.003, 0.002] + } + }, + "P2": { + "transportation cost ($/km/tonne)": [0.022, 0.020] + }, + "P3": { + "transportation cost ($/km/tonne)": [0.0125, 0.0125] + }, + "P4": { + "transportation cost ($/km/tonne)": [0.0175, 0.0175] + } + } +} +``` + +## Processing Plants + +The **plants** section describes the available types of reverse manufacturing plants, their potential locations and associated costs, as well as their inputs and outputs. The field `instance["Plants"]` is a dictionary mapping the name of the plant to a dictionary with the following keys: + +| Key | Description +|:------------------------|---------------| +| `input` | The name of the product that this plant takes as input. Only one input is accepted per plant. +| `outputs (tonne/tonne)` | A dictionary specifying how many tonnes of each product is produced for each tonnes of input. For example, if the plant outputs 0.5 tonnes of P2 and 0.25 tonnes of P3 for each tonnes of P1 provided, then this entry should be `{"P2": 0.5, "P3": 0.25}`. If the plant does not output anything, this key may be omitted. +|`energy (GJ/tonne)` | The energy required to process 1 tonne of the input. Must be a timeseries. Optional. +|`emissions (tonne/tonne)` | A dictionary mapping the name of each greenhouse gas, produced to process each tonne of input, to the amount of gas produced (in tonne). Must be a timeseries. Optional. +| `locations` | A dictionary mapping the name of the location to a dictionary which describes the site characteristics (see below). + +Each type of plant is associated with a set of potential locations where it can be built. Each location is represented by a dictionary with the following keys: + +| Key | Description +|:------------------------------|---------------| +| `latitude (deg)` | The latitude of the location, in degrees. +| `longitude (deg)` | The longitude of the location, in degrees. +| `disposal` | A dictionary describing what products can be disposed locally at the plant. +| `capacities (tonne)` | A dictionary describing what plant sizes are allowed, and their characteristics. + +The keys in the `disposal` dictionary should be the names of the products. The values are dictionaries with the following keys: + +| Key | Description +|:------------------------|---------------| +| `cost ($/tonne)` | The cost to dispose of the product. Must be a timeseries. +| `limit (tonne)` | The maximum amount that can be disposed of. If an unlimited amount can be disposed, this key may be omitted. Must be a timeseries. + + +The keys in the `capacities (tonne)` dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys: + +| Key | Description +|:--------------------------------------|---------------| +| `opening cost ($)` | The cost to open a plant of this size. +| `fixed operating cost ($)` | The cost to keep the plant open, even if the plant doesn't process anything. Must be a timeseries. +| `variable operating cost ($/tonne)` | The cost that the plant incurs to process each tonne of input. Must be a timeseries. + +### Example + +```json +{ + "plants": { + "F1": { + "input": "P1", + "outputs (tonne/tonne)": { + "P2": 0.2, + "P3": 0.5 + }, + "energy (GJ/tonne)": [0.12, 0.11], + "emissions (tonne/tonne)": { + "CO2": [0.052, 0.050], + "CH4": [0.003, 0.002] + }, + "locations": { + "L1": { + "latitude (deg)": 0.0, + "longitude (deg)": 0.0, + "disposal": { + "P2": { + "cost ($/tonne)": [-10.0, -12.0], + "limit (tonne)": [1.0, 1.0] + } + }, + "capacities (tonne)": { + "100": { + "opening cost ($)": [500, 530], + "fixed operating cost ($)": [300.0, 310.0], + "variable operating cost ($/tonne)": [5.0, 5.2] + }, + "500": { + "opening cost ($)": [750, 760], + "fixed operating cost ($)": [400.0, 450.0], + "variable operating cost ($/tonne)": [5.0, 5.2] + } + } + } + } + } + } +} +``` + +## Current limitations + +* Each plant can only be opened exactly once. After open, the plant remains open until the end of the simulation. +* Plants can be expanded at any time, even long after they are open. +* All material available at the beginning of a time period must be entirely processed by the end of that time period. It is not possible to store unprocessed materials from one time period to the next. +* Up to two plant sizes are currently supported. Variable operating costs must be the same for all plant sizes. \ No newline at end of file diff --git a/src/docs/index.md b/src/docs/index.md index c8acbe2..7b0e56b 100644 --- a/src/docs/index.md +++ b/src/docs/index.md @@ -1,13 +1,13 @@ # RELOG: Reverse Logistics Optimization -**RELOG** is a supply chain optimization package focusing on reverse logistics and reverse manufacturing. For example, the package can be used to determine where to build recycling plants, what sizes should they have and which customers should be served by which plants. The package supports customized reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods. +**RELOG** is a supply chain optimization package focusing on reverse logistics and reverse manufacturing. The package uses Mixed-Integer Linear Programming to determine where to build recycling plants, what size should these plants have and which customers should be served by which plants. The package supports custom reverse logistics pipelines, with multiple types of plants, multiple types of product and multiple time periods. ### Table of Contents - * [Installation](install.md) - * [Modeling](model.md) - * [Optimizing](optimize.md) + * [Usage](usage.md) + * [Data Format](format.md) + * [Optimization model](model.md) ### Source Code diff --git a/src/docs/install.md b/src/docs/install.md deleted file mode 100644 index 219656d..0000000 --- a/src/docs/install.md +++ /dev/null @@ -1,14 +0,0 @@ -Installation -============ - -The package was developed and tested with Julia 1.3 and may not be compatible with newer versions. To install it, launch the Julia console, type `]` to switch to package manager mode and run: - -```text -pkg> add https://github.com/ANL-CEEESA/RELOG.git -``` - -To make sure that the package has been correctly installed: - -```text -pkg> test RELOG -``` \ No newline at end of file diff --git a/src/docs/model.md b/src/docs/model.md index 817a5b0..e69de29 100644 --- a/src/docs/model.md +++ b/src/docs/model.md @@ -1,174 +0,0 @@ -# Modeling - -The first step when using RELOG is to describe the reverse logistics pipeline and the relevant data. RELOG accepts as input a JSON file with three sections: `parameters`, `products` and `plants`. Below, we describe each section in more detail. - -## Parameters - -The **parameters** section describes details about the simulation itself. - -| Key | Description -|:--------------------------|---------------| -|`time horizon (years)` | Number of years in the simulation. -|`building period (years)` | List of years in which we are allowed to open new plants. For example, if this parameter is set to `[1,2,3]`, we can only open plants during the first three years. By default, this equals `[1]`; that is, plants can only be opened during the first year. | - - -### Example -```json -{ - "parameters": { - "time horizon (years)": 2, - "building period (years)": [1] - } -} -``` - -## Products - -The **products** section describes all products and subproducts in the simulation. The field `instance["Products"]` is a dictionary mapping the name of the product to a dictionary which describes its characteristics. Each product description contains the following keys: - -| Key | Description -|:--------------------------------------|---------------| -|`transportation cost ($/km/tonne)` | The cost to transport this product. Must be a timeseries. -|`transportation energy (J/km/tonne)` | The energy required to transport this product. Must be a timeseries. Optional. -|`transportation emissions (tonne/km/tonne)` | A dictionary mapping the name of each greenhouse gas, produced to transport one tonne of this product along one kilometer, to the amount of gas produced (in tonnes). Must be a timeseries. Optional. -|`initial amounts` | A dictionary mapping the name of each location to its description (see below). If this product is not initially available, this key may be omitted. Must be a timeseries. - -Each product may have some amount available at the beginning of each time period. In this case, the key `initial amounts` maps to a dictionary with the following keys: - -| Key | Description -|:------------------------|---------------| -| `latitude (deg)` | The latitude of the location. -| `longitude (deg)` | The longitude of the location. -| `amount (tonne)` | The amount of the product initially available at the location. Must be a timeseries. - -### Example - -```json -{ - "products": { - "P1": { - "initial amounts": { - "C1": { - "latitude (deg)": 7.0, - "longitude (deg)": 7.0, - "amount (tonne)": [934.56, 934.56] - }, - "C2": { - "latitude (deg)": 7.0, - "longitude (deg)": 19.0, - "amount (tonne)": [198.95, 198.95] - }, - "C3": { - "latitude (deg)": 84.0, - "longitude (deg)": 76.0, - "amount (tonne)": [212.97, 212.97] - } - }, - "transportation cost ($/km/tonne)": [0.015, 0.015], - "transportation energy (J/km/tonne)": [0.12, 0.11], - "transportation emissions (tonne/km/tonne)": { - "CO2": [0.052, 0.050], - "CH4": [0.003, 0.002] - } - }, - "P2": { - "transportation cost ($/km/tonne)": [0.022, 0.020] - }, - "P3": { - "transportation cost ($/km/tonne)": [0.0125, 0.0125] - }, - "P4": { - "transportation cost ($/km/tonne)": [0.0175, 0.0175] - } - } -} -``` - -## Processing Plants - -The **plants** section describes the available types of reverse manufacturing plants, their potential locations and associated costs, as well as their inputs and outputs. The field `instance["Plants"]` is a dictionary mapping the name of the plant to a dictionary with the following keys: - -| Key | Description -|:------------------------|---------------| -| `input` | The name of the product that this plant takes as input. Only one input is accepted per plant. -| `outputs (tonne/tonne)` | A dictionary specifying how many tonnes of each product is produced for each tonnes of input. For example, if the plant outputs 0.5 tonnes of P2 and 0.25 tonnes of P3 for each tonnes of P1 provided, then this entry should be `{"P2": 0.5, "P3": 0.25}`. If the plant does not output anything, this key may be omitted. -|`energy (GJ/tonne)` | The energy required to process 1 tonne of the input. Must be a timeseries. Optional. -|`emissions (tonne/tonne)` | A dictionary mapping the name of each greenhouse gas, produced to process each tonne of input, to the amount of gas produced (in tonne). Must be a timeseries. Optional. -| `locations` | A dictionary mapping the name of the location to a dictionary which describes the site characteristics (see below). - -Each type of plant is associated with a set of potential locations where it can be built. Each location is represented by a dictionary with the following keys: - -| Key | Description -|:------------------------------|---------------| -| `latitude (deg)` | The latitude of the location, in degrees. -| `longitude (deg)` | The longitude of the location, in degrees. -| `disposal` | A dictionary describing what products can be disposed locally at the plant. -| `capacities (tonne)` | A dictionary describing what plant sizes are allowed, and their characteristics. - -The keys in the `disposal` dictionary should be the names of the products. The values are dictionaries with the following keys: - -| Key | Description -|:------------------------|---------------| -| `cost ($/tonne)` | The cost to dispose of the product. Must be a timeseries. -| `limit (tonne)` | The maximum amount that can be disposed of. If an unlimited amount can be disposed, this key may be omitted. Must be a timeseries. - - -The keys in the `capacities (tonne)` dictionary should be the amounts (in tonnes). The values are dictionaries with the following keys: - -| Key | Description -|:--------------------------------------|---------------| -| `opening cost ($)` | The cost to open a plant of this size. -| `fixed operating cost ($)` | The cost to keep the plant open, even if the plant doesn't process anything. Must be a timeseries. -| `variable operating cost ($/tonne)` | The cost that the plant incurs to process each tonne of input. Must be a timeseries. - -### Example - -```json -{ - "plants": { - "F1": { - "input": "P1", - "outputs (tonne/tonne)": { - "P2": 0.2, - "P3": 0.5 - }, - "energy (GJ/tonne)": [0.12, 0.11], - "emissions (tonne/tonne)": { - "CO2": [0.052, 0.050], - "CH4": [0.003, 0.002] - }, - "locations": { - "L1": { - "latitude (deg)": 0.0, - "longitude (deg)": 0.0, - "disposal": { - "P2": { - "cost ($/tonne)": [-10.0, -12.0], - "limit (tonne)": [1.0, 1.0] - } - }, - "capacities (tonne)": { - "100": { - "opening cost ($)": [500, 530], - "fixed operating cost ($)": [300.0, 310.0], - "variable operating cost ($/tonne)": [5.0, 5.2] - }, - "500": { - "opening cost ($)": [750, 760], - "fixed operating cost ($)": [400.0, 450.0], - "variable operating cost ($/tonne)": [5.0, 5.2] - } - } - } - } - } - } -} -``` - -## Current limitations - -* Each plant can only be opened exactly once. After open, the plant remains open until the end of the simulation. -* Plants can be expanded at any time, even long after they are open. -* All material available at the beginning of a time period must be entirely processed by the end of that time period. It is not possible to store unprocessed materials from one time period to the next. -* Up to two plant sizes are currently supported. Variable operating costs must be the same for all plant sizes. \ No newline at end of file diff --git a/src/docs/optimize.md b/src/docs/optimize.md deleted file mode 100644 index 26bdcca..0000000 --- a/src/docs/optimize.md +++ /dev/null @@ -1,11 +0,0 @@ -# Optimizing - -After creating a JSON file describing the reverse manufacturing process and the input data, the following example illustrates how to use the package to find the optimal set of decisions: - -```julia -using RELOG -RELOG.solve("/home/user/instance.json") -``` - -The optimal logistics plan will be printed to the screen. - diff --git a/src/docs/usage.md b/src/docs/usage.md new file mode 100644 index 0000000..c97d589 --- /dev/null +++ b/src/docs/usage.md @@ -0,0 +1,72 @@ +Usage +===== + +## 1. Installation + +To use RELOG, the first step is to install the [Julia programming language](https://julialang.org/) on your machine. Note that RELOG was developed and tested with Julia 1.5 and may not be compatible with newer versions. After Julia is installed, launch the Julia console, type `]` to switch to package manger mode, then run: + +```text +(@v1.5) pkg> add https://github.com/ANL-CEEESA/RELOG.git +``` + +After the package and all its dependencies have been installed, please run the RELOG test suite, as shown below, to make sure that the package has been correctly installed: + +```text +(@v1.5) pkg> test RELOG +``` + +To update the package to a newer version, type `]` to enter the package manager mode, then run: + +```text +(@v1.5) pkg> update RELOG +``` + +## 2. Modeling the problem + +The two main model components in RELOG are **products** and **plants**. + +A **product** is any material that needs to be recycled, any intermediary product produced during the recycling process, or any product recovered at the end of the process. For example, in a NiMH battery recycling study case, products could include (i) the original batteries to be recycled; (ii) the cathode and anode parts of the battery; (iii) rare-earth elements and (iv) scrap metals. + +* The model assumes that some products are initially available at user-specified locations (described by their latitude, longitude and the amount available), while other products only become available during the recycling process. + +* Transporting products from one location to another incurs a transportation cost (`$/km/tonne`), spends some amount of energy (`J/km/tonne`) and may generate multiple types of emissions (`tonne/tonne`). All these parameters are user-specified and may be product- and time-specific. + +A **plant** is a facility that converts one type of product to another. RELOG assumes that each plant receives a single type of product as input and converts this input into multiple types of products. Multiple types of plants, with different inputs, outputs and performance characteristics, may be specified. In the NiMH battery recycling study case, for example, one type of plant could be a *disassembly plant*, which converts *batteries* into *cathode* and *anode*. Another type of plant could be *anode recycling plant*, which converts *anode* into *rare-earth elements* and *scrap metals*. + +* To process each tonne of input material, plants incur a variable operating cost (`$/tonne`), spend some amount of energy (`GJ/tonne`), and produce multiple types of emissions (`tonne/tonne`). Plants also incur a fixed operating cost (`$`) regardless of the amount of material they process. All these parameters are user-specified and may be region- and time-specific. + +* Plants can be built at user-specified potential locations. Opening a plant incurs a one-time opening cost (`$`) which may be region- and time-specific. Plants also have a limited capacity (in `tonne`), which indicates the maximum amount of input material they are able to process per year. When specifying potential locations for each type of plant, it is also possible to specify the minimum and maximum capacity of the plants that can be built at that particular location. Different plants sizes may have different opening costs and fixed operating costs. After a plant is built, it can be further expanded in the following years, up to its maximum capacity. + +* All products that are initially available must be sent to a plant for processing. All products that are generated by a plant can either be sent to another plant for further processing, or disposed of locally for either a profit or a loss (`$/tonne`). To model environmental regulations, it is also possible to specify the maximum amount of each product that can be disposed of at each location. + +All user parameters specified above must be provided to RELOG as a JSON file, which is fully described in the [data format page](format.md). + +## 3. Running the optimization + +After creating a JSON file describing the reverse manufacturing process and the input data, the following example illustrates how to use the package to find the optimal set of decisions: + +```julia +using RELOG +RELOG.solve("/home/user/instance.json", + output="/home/user/solution.json") +``` + +The optimal logistics plan will be stored in the output file specified. See [data format page](format.md) for a description of this output file. + +## 4. Advanced options + +### 4.1 Changing the solver + +By default, RELOG internally uses [Cbc](https://github.com/coin-or/Cbc), an open-source and freely-available Mixed-Integer Linear Programming solver developed by the [COIN-OR Project](https://www.coin-or.org/). For larger-scale test cases, a commercial solver such as Gurobi, CPLEX or XPRESS is recommended. The following snippet shows how to switch from Cbc to Gurobi, for example: + +```julia +using RELOG, Gurobi, JuMP + +gurobi = optimizer_with_attributes(Gurobi.Optimizer, + "TimeLimit" => 3600, + "MIPGap" => 0.001) + +RELOG.solve("instance.json", + output="solution.json", + optimizer=gurobi) +``` diff --git a/src/instance.jl b/src/instance.jl index a8ac440..c07e72d 100644 --- a/src/instance.jl +++ b/src/instance.jl @@ -2,7 +2,7 @@ # Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved. # Released under the modified BSD license. See COPYING.md for more details. -using JSON, JSONSchema +using JSON, JSONSchema, Printf mutable struct Product @@ -204,5 +204,8 @@ function parse(json::Dict)::Instance end end + @info @sprintf("%12d collection centers", length(collection_centers)) + @info @sprintf("%12d candidate plant locations", length(plants)) + return Instance(T, products, collection_centers, plants, building_period) end diff --git a/src/model.jl b/src/model.jl index f0efe1f..9aee946 100644 --- a/src/model.jl +++ b/src/model.jl @@ -196,9 +196,14 @@ default_milp_optimizer = optimizer_with_attributes(Cbc.Optimizer, "logLevel" => default_lp_optimizer = optimizer_with_attributes(Clp.Optimizer, "LogLevel" => 0) function solve(instance::Instance; - milp_optimizer=default_milp_optimizer, - lp_optimizer=default_lp_optimizer, - output_filename=nothing) + optimizer=nothing, + output=nothing) + + milp_optimizer = lp_optimizer = optimizer + if optimizer == nothing + milp_optimizer = optimizer + lp_optimizer = optimizer + else @info "Building graph..." graph = RELOG.build_graph(instance) @@ -234,9 +239,9 @@ function solve(instance::Instance; @info "Extracting solution..." solution = get_solution(model) - if output_filename != nothing - @info "Writing solution: $output_filename" - open(output_filename, "w") do file + if output != nothing + @info "Writing solution: $output" + open(output, "w") do file JSON.print(file, solution, 2) end end