use of org.tweetyproject.math.term.Variable in project TweetyProject by TweetyProjectTeam.
the class SimulatedAnnealingOnConstrProbEx2 method main.
/**
* main method
* @param args arguments
*
* @throws GeneralMathException GeneralMathException
*/
public static void main(String[] args) throws ParserException, GeneralMathException {
// Create toy problem
OptimizationProblem prob = createConstraintSatProb1();
// Create starting point; all variables start at 0
// solve via SimAn
SimulatedAnnealingOnConstrProb solver = new SimulatedAnnealingOnConstrProb(1000000, 1, 10000);
Map<Variable, Term> solution = solver.solve(prob);
System.out.println(solution.toString());
}
use of org.tweetyproject.math.term.Variable in project TweetyProject by TweetyProjectTeam.
the class StochasticLocalSearchOnConstrProbEx method main.
/**
* main method
* @param args arguments
*
* @throws ParserException ParserException
* @throws GeneralMathException GeneralMathExceptions
*/
public static void main(String[] args) throws ParserException, GeneralMathException {
// Create toy problem
OptimizationProblem prob = createConstraintSatProb1();
// Create starting point; all variables start at 0
// solve via SimAn
StochasticLocalSearchOnConstrProb solver = new StochasticLocalSearchOnConstrProb(5000, 1000, 0.5);
Map<Variable, Term> solution = solver.solve(prob);
System.out.println(solution.toString());
}
use of org.tweetyproject.math.term.Variable in project TweetyProject by TweetyProjectTeam.
the class ApacheCommonsCMAESOptimizerEx method main.
/**
* main method
* @param args arguments
*
* @throws ParserException parserEx
* @throws IOException IOException
* @throws GeneralMathException GeneralMathException
*/
public static void main(String[] args) throws ParserException, IOException, GeneralMathException {
// Create toy problem
ConstraintSatisfactionProblem prob = createConstraintSatProb1();
// solve via CommonsCMAESOptimizer
ApacheCommonsCMAESOptimizer solver = new ApacheCommonsCMAESOptimizer(20, 2000000, 0.00001, false, 10, 1, 0.0001);
Map<Variable, Term> solution = solver.solve(prob);
System.out.println(solution.toString());
}
use of org.tweetyproject.math.term.Variable in project TweetyProject by TweetyProjectTeam.
the class ApacheCommonsNonLinearConjugateGradientOptimizerEx method main.
/**
* main method
* @param args arguments
* @throws ParserException ParserException
* @throws IOException IOException
* @throws GeneralMathException GeneralMathException
*/
public static void main(String[] args) throws ParserException, IOException, GeneralMathException {
// Create toy problem
ConstraintSatisfactionProblem prob = createConstraintSatProb1();
Set<Variable> constr = prob.getVariables();
// Create starting point; all variables start at 0
Map<Variable, Term> startingPoint = new HashMap<Variable, Term>();
for (Variable x : constr) {
startingPoint.put(x, new IntegerConstant(0));
}
// solve via ApacheCommonsNonLinearConjugateGradientOptimizer
ApacheCommonsNonLinearConjugateGradientOptimizer solver = new ApacheCommonsNonLinearConjugateGradientOptimizer(1000, 0.00001);
Map<Variable, Term> solution = solver.solve(prob);
System.out.println(solution.toString());
}
use of org.tweetyproject.math.term.Variable in project TweetyProject by TweetyProjectTeam.
the class ApacheCommonsSimplexEx2 method main.
/**
* main method
* @param args arguments
* @throws ParserException ParserException
* @throws IOException IOException
* @throws GeneralMathException GeneralMathException
*/
public static void main(String[] args) throws ParserException, IOException, GeneralMathException {
// Create toy problem
OptimizationProblem prob = createConstraintSatProb1();
Set<Variable> constr = prob.getVariables();
// Create starting point; all variables start at 0
Map<Variable, Term> startingPoint = new HashMap<Variable, Term>();
for (Variable x : constr) {
startingPoint.put(x, new IntegerConstant(0));
}
// solve via BfggsSolver
ApacheCommonsSimplex solver = new ApacheCommonsSimplex();
Map<Variable, Term> solution = solver.solve(prob);
System.out.println(solution.toString());
}
Aggregations