@@ -10,9 +10,9 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
package com.google.ortools.java;
|
||||
|
||||
package com.google.ortools.examples;
|
||||
|
||||
import com.google.ortools.Loader;
|
||||
import com.google.ortools.linearsolver.MPConstraint;
|
||||
import com.google.ortools.linearsolver.MPObjective;
|
||||
import com.google.ortools.linearsolver.MPSolver;
|
||||
@@ -20,14 +20,8 @@ import com.google.ortools.linearsolver.MPVariable;
|
||||
|
||||
/**
|
||||
* Linear programming example that shows how to use the API.
|
||||
*
|
||||
*/
|
||||
|
||||
public class LinearProgramming {
|
||||
static {
|
||||
System.loadLibrary("jniortools");
|
||||
}
|
||||
|
||||
private static void runLinearProgrammingExample(String solverType, boolean printModel) {
|
||||
MPSolver solver = MPSolver.createSolver(solverType);
|
||||
if (solver == null) {
|
||||
@@ -115,6 +109,7 @@ public class LinearProgramming {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Loader.loadNativeLibraries();
|
||||
System.out.println("---- Linear programming example with GLOP (recommended) ----");
|
||||
runLinearProgrammingExample("GLOP", true);
|
||||
System.out.println("---- Linear programming example with CLP ----");
|
||||
|
||||
Reference in New Issue
Block a user