如何在我的Julia代码中更改CPLEX参数?

时间:2019-04-11 20:31:59

标签: julia cplex

我正在使用CPLEX求解器运行我的ILP模型。ILP模型是通过Julia / MultiJuMP实现的。

我想限制问题的优化时间。如果我正在使用OPL,则只需添加cucumber.runtime.CucumberException: You're not allowed to extend classes that define Step Definitions or hooks. class com.example.GoogleCalcStepDefinition extends class com.example.DemoApplicationTests at cucumber.runtime.java.MethodScanner.validateMethod(MethodScanner.java:76) at cucumber.runtime.java.MethodScanner.scan(MethodScanner.java:62) at cucumber.runtime.java.MethodScanner.scan(MethodScanner.java:43) at cucumber.runtime.java.JavaBackend.loadGlue(JavaBackend.java:83) at cucumber.runner.Runner.<init>(Runner.java:28) at cucumber.runner.ThreadLocalRunnerSupplier.createRunner(ThreadLocalRunnerSupplier.java:42) at cucumber.runner.ThreadLocalRunnerSupplier.access$000(ThreadLocalRunnerSupplier.java:13) at cucumber.runner.ThreadLocalRunnerSupplier$1.initialValue(ThreadLocalRunnerSupplier.java:22) at cucumber.runner.ThreadLocalRunnerSupplier$1.initialValue(ThreadLocalRunnerSupplier.java:19) at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:180) at java.lang.ThreadLocal.get(ThreadLocal.java:170) at cucumber.runner.ThreadLocalRunnerSupplier.get(ThreadLocalRunnerSupplier.java:38) at cucumber.api.junit.Cucumber.<init>(Cucumber.java:106) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) Process finished with exit code -1

在Julia中,我输入了以下代码:

Cplex.tilimt=100

它不起作用。

1 个答案:

答案 0 :(得分:1)

https://github.com/JuliaOpt/CPLEX.jl/blob/master/README.md的最后一节开始,Julia似乎使用了在CPLEX的C API中显示的旧参数名称。例如,CplexSolver(CPX_PARAM_EPINT=1e-8)

以下是该参数的CPLEX文档的链接:https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/EpInt.html。如您所见,该名称显示为“ V12.6.0之前的名称”列中的第一行。

对于时间限制,您应该使用CPX_PARAM_TILIM,因为这是https://www.ibm.com/support/knowledgecenter/SSSA5P_12.9.0/ilog.odms.cplex.help/CPLEX/Parameters/topics/TiLim.html中的名称。