简体   繁体   中英

Simulation for deciding coefficients in a multi objective optimization function (gurobi)

I'm building a fairly large and complex optimization model for Job Shop Scheduling in a industrial quality laboratory and i'm using gurobi.

It's a multiobjective model where i need to minimize the processing time on four different machines, but i also need to prioritize the pipes which would unlock larger quantities of material to be shipped to clients (keeping low stocks).

One pipe can have one or more tests to do associated to it and i also can have multiple pipes associated to a single order; once all the tests needed are done the order can be shipped to the client. The pipes are put in some boxes that then are brought to the machine (one box at a time for a single machine) that processes all the pipes inside.

My objective function is the following:

OBJECTIVE   = gp.quicksum(T[m] for m in machines)
            - gp.quicksum(Pipe_Box[i,ii,c] * box_convenience[i][ii] * k1
            for i in pipes for ii in pipes for c in boxes if pipes.index(ii) > 
            pipes.index(i))
            - gp.quicksum(Weight_Check[i,c,m] * Pipe_Weight_Flag[i] * k2 for 
            i in pipes for c in boxes for m in machines)

First i minimize the machine time.

Second i'm considering the fact that if i put all pipes associated to an order in a single box then i will unlock the order sooner than if i put those pipes in different boxes.

Third and lastly i'm considering all the orders which order weight/number of tests is above 5ton.

T[m], Pipe_Box[i,ii,c] and Weight_Check[i,c,m]

are my variables.

box_convenience[i][ii] and Pipe_Weight_Flag[i]

are binary parameters that tell me if different pipes belong to the same order and if the afromented ratio is >5 tons

k1 ad k2

are the coefficients and i need to understand what is the best configuration of them for the multiobjective function.

I was thinking something along the line of running a simulation with two nested loops, starting both k1 and k2 at zero and incrementing them +100 up until a certain threshold (lets say 3000 thousand each).

In this case i'd have 90 different iterations of the model and therefore different solutions.

I'm wondering if exists a built in tool in gurobi to perform this task or if i can use another approach and use a library like simpy to achieve what i want.

Gurobi saves the objective function in a text file with a proprietary.sol extension (i think, it's a normal text file at the end of the day) which has this structure:

# Solution for model Job Shop Scheduling
# Objective value = 1.9384345683700005e+04
T[M1] = 1000
T[M2] = 5332
...
Pipe_Box[Pipe1,Pipe2,Box1] = 1
Pipe_Box[Pipe1,Pipe2,Box2] = 0
...

I never needed to do something like this and i'm kind of overwhelmed, any input or help will be appreciated a lot!

Edit: I saw that gurobi supports multi objective optimization so the following code would work:

model.setObjectiveN(gp.quicksum(T[m] for m in machines), 2, 1)
model.setObjectiveN(- gp.quicksum(Pipe_Box[i,ii,c] * box_convenience[i][ii]
                    for i in pipes for ii in pipes for c in boxes if 
                    pipes.index(ii) > pipes.index(i), 1, 1)
model.setObjectiveN(- gp.quicksum(Weight_Check[i,c,m] * Pipe_Weight_Flag[i] * k2 
                    for i in pipes for c in boxes for m in machines, 1, 1)

The issue stays the same though, is there a way to change the weight and priority parameters and get different solutions?

This is not always possible, but if you can express both objectives in dollar terms, then this problem goes away.

Otherwise, what I usually do is: (1) find the "box" for the objectives (min / max for each objective) and then (2) do a rough grid search. That generates some results that you can use to refine things. A picture of the (estimated) efficient frontier can help to communicate things and can also help to identify interesting regions that warrant a finer grid (things may be flat in parts of the space).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM