AnyLogic
Expand
Font size

public class ConstraintProcessor
extends Object

Constructor Summary

ConstructorDescription
ConstraintProcessor() 

Method Summary

Modifier and TypeMethodDescription
static List<Pair<Pattern,String>>getOptQuestParameterNameTransformers(Map<OptQuestVariable,String> optQuestParameterNames)
Converts mapping {Parameter -> NewName} to pairs {Pattern_For_Parameter_Name -> NewName}
static LinearConstraintparseLinearConstraint(Collection<OptQuestVariable> optParameters, String expression, ConstraintTypeEnum type, double bound)
Parses expression and if it is linear, returns a result
static com.opttek.optquest.COptQuestConstraintprepareLinearConstraint(LinearConstraint linearConstraint) 
static com.opttek.optquest.COptQuestStringConstraintprepareNonLinearConstraint(Map<OptQuestVariable,String> variables, String expression, ConstraintTypeEnum type, double bound) 
static StringtransformExpression(String expression, List<Pair<Pattern,String>> transformations)
Applies all patterns to given expression

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

ConstraintProcessor

public ConstraintProcessor()

Method Details

parseLinearConstraint

public static LinearConstraint parseLinearConstraint(Collection<OptQuestVariable> optParameters,
 String expression,
 ConstraintTypeEnum type,
 double bound)
Parses expression and if it is linear, returns a result
Parameters:
optParameters -
c -
Returns:
new LinearConstraint if c represents a valid linear constraint or null if parsing was unsuccessful

getOptQuestParameterNameTransformers

public static List<Pair<Pattern,String>> getOptQuestParameterNameTransformers(Map<OptQuestVariable,String> optQuestParameterNames)
Converts mapping {Parameter -> NewName} to pairs {Pattern_For_Parameter_Name -> NewName}
Parameters:
optQuestParameterNames -
Returns:

transformExpression

public static String transformExpression(String expression,
 List<Pair<Pattern,String>> transformations)
Applies all patterns to given expression
Parameters:
expression -
transformations -
Returns:

prepareNonLinearConstraint

public static com.opttek.optquest.COptQuestStringConstraint prepareNonLinearConstraint(Map<OptQuestVariable,String> variables,
 String expression,
 ConstraintTypeEnum type,
 double bound)

prepareLinearConstraint

public static com.opttek.optquest.COptQuestConstraint prepareLinearConstraint(LinearConstraint linearConstraint)
                                                                       throws com.opttek.optquest.COptQuestException
Throws:
com.opttek.optquest.COptQuestException