Exp(an equation)
Answeredfor (Data d:rs.getData()) {
List<Data_Out> listofDouts = new ArrayList<Data_Out>();
for(Data_Out dout:rs.getData_out()) {
if(dout.getDataout_has()== d) {
listofDouts.add(dout);
}
GRBLinExpr expr_reliab = new GRBLinExpr();
for(int i=0; i<listofDouts.size(); i++) {
expr_reliab.addTerm(listofDouts.get(i).getData_out_has_link().getFailure_Rate_FIT(),
listofDouts.get(i).getData_out_gurobi());
}
GRBVar exp_lambda_decision = model.addVar(0.0, GRB.INFINITY, 0.0, GRB.CONTINUOUS, "exp_lambda_decision");
GRBGenConstr test = model.addGenConstrExp(exp_lambda_decision, expr_reliab, "exp_lambda", "test");
}
Hello,
I am wondering how I can exp the expr_reliab (e^(expr_reliab)) in the code above. model.addGenConstrExp doesn't work as it needs two GRB Vars.
Thanks!
Hadi
0
-
Hi Hadi,
If you create an auxiliary variable "reliab", (noting that default lower bound is 0, so change it if need be), add a constraint reliab == expr_reliab, then you can use
GRBGenConstr test = model.addGenConstrExp(exp_lambda_decision, reliab, "exp_lambda", "test"); }
Note, allowing expressions in the arguments is in our roadmap for development but as of right now this is how to do it.
- Riley
0 -
Dear Riley,
Thanks for your reply!
I will test it and get back to you.
Best,
Hadi
0
Please sign in to leave a comment.
Comments
2 comments