Gurobi Error for bigger Models: Failed to create model (Java)
ユーザーの入力を待っています。Hello.
I have an Error when i try to run my program for bigger Models.
n<=4 ... it is working
n>4 ... it is not working
Error:
Exception in thread "main" gurobi.GRBException: Failed to create model
at gurobi.GRBModel.<init>(GRBModel.java:68)
at Chess_queenproblem.branchAndBound(Chess_queenproblem.java:82)
at Chess_queenproblem.branchAndBound(Chess_queenproblem.java:192)
..... [it is recursive so i have for each new tray the same error] ...
at Chess_queenproblem.main(Chess_queenproblem.java:53)
Warning: Failed to open log file 'LP.log'
Part of program:
public static void main(String[] arg) throws GRBException
{
//Parameter values
int n = 5;
private static Double[][][][] threatedFields = ....;
private static Boolean[][] fixedFields = ....;
//Start Groubi
env = new GRBEnv(true);
env.set("logFile", "LP.log");
env.set("OutputFlag", "0");
env.start();//Start Branch and Bound
//Start Branch and Bound
solution = branchAndBound(threatedFields, fixedFields,n); == Line 53
env.dispose();
private static boolean[][] branchAndBound(Double[][][][] threatedFields, Boolean[][] fixedFields, int n) throws GRBException
{
GRBModel model = new GRBModel(env);
GRBVar[][] x = new GRBVar[n][n]; == Line 83
... do optimization ...
boolean[][] solutionTrue = branchAndBound(threatedFields, fixedFieldsEnlargedTrue, n); == Line 192
Log:
Gurobi 9.5.1 (win64, Java) logging started Thu May 26 20:36:04 2022 >>> not working n=5
Gurobi 9.5.1 (win64, Java) logging started Thu May 26 20:36:04 2022 >>> working n=4
Set parameter LogFile to value "LP.log"
-
正式なコメント
This post is more than three 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. -
Did you check whether your program does run out of memory? This is often the case for recursive Java programs which require many objects of significant size, cf. StackOverflowError Vs OurOfMemoryError in Java.
Did you try re-writing your program in a sequential way to avoid recursion?
Best regards,
Jaromił0
投稿コメントは受け付けていません。
コメント
2件のコメント