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:

# 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)