krieger.oclsolve
Class Problem

java.lang.Object
  extended by krieger.oclsolve.Problem
All Implemented Interfaces:
java.io.Serializable

public class Problem
extends java.lang.Object
implements java.io.Serializable

Represents an OCL constraint satisfaction problem. May also handle OCL queries for evaluation.

See Also:
Serialized Form

Constructor Summary
Problem()
           
 
Method Summary
 void addConstraint(BooleanExpression constraint)
          Conjoins the given constraint with the problem.
 void addQuery(Expression query)
          Registers the given query for evaluation.
 void maximize(IntegerExpression f)
          Equivalent to minimize(f.minus()).
 void minimize(IntegerExpression f)
          Sets the objective function to be minimized when solving the problem.
 void setTimeout(java.lang.Integer timeout)
          Sets the timeout for constraint solving.
 boolean solve()
          Solves the constraint satisfaction problem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Problem

public Problem()
Method Detail

addConstraint

public void addConstraint(BooleanExpression constraint)
Conjoins the given constraint with the problem.


addQuery

public void addQuery(Expression query)
Registers the given query for evaluation. After the problem has been solved, the query can be evaluated.


minimize

public void minimize(IntegerExpression f)
Sets the objective function to be minimized when solving the problem.


maximize

public void maximize(IntegerExpression f)
Equivalent to minimize(f.minus()).


setTimeout

public void setTimeout(java.lang.Integer timeout)
Sets the timeout for constraint solving.

Parameters:
timeout - The timeout, may be null.

solve

public boolean solve()
Solves the constraint satisfaction problem.

Returns:
true if solved.