All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.constraints.ProblemFactory Maven / Gradle / Ivy

Go to download

JCP Standard JSR331 “Java Constraint Programming API”. It is used for Modeling and Solving Constraint Satisfaction and Optimization Problems using Java and off-the-shelf Constraint/Linear Solvers

The newest version!
package javax.constraints;

public class ProblemFactory {

	public static Problem newProblem(String problemName) {
		try {
			Problem problem = (Problem) Class.forName(
					"javax.constraints.impl.Problem").newInstance();
			problem.setName(problemName);
			return problem;
		} catch (Exception e) {
			throw new RuntimeException(
					"ProblemFactory: Can not create an instance of the class javax.constraints.impl.Problem",
					e);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy