Exp(an equation)
回答済みfor (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
-
正式なコメント
This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
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
投稿コメントは受け付けていません。
コメント
3件のコメント