public class Problem
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Constraint> |
_constraints
Constraints which identify unacceptable solutions.
|
protected Evaluator |
_evaluator
The user provided object which evaluates the trial solutions.
|
protected java.util.Map<java.lang.String,Hint> |
_hints
A table of hints the algorithms may use to adjust their search.
|
protected java.util.List<Objective> |
_objectives
The objectives we are trying to optimize.
|
protected java.util.Map<Variable,ValueRef> |
_valueRefs
A table of reference values keyed by variable
|
protected java.util.List<Variable> |
_variables
The variables which identify the controls for optimizing the solution.
|
Constructor and Description |
---|
Problem()
Construct a problem where everything is null.
|
Problem(java.util.List<Objective> objectives,
java.util.List<Variable> variables,
Evaluator evaluator)
Construct a problem using an objective list, variable list, and an evaluator.
|
Problem(java.util.List<Objective> objectives,
java.util.List<Variable> variables,
Evaluator evaluator,
java.util.List<Constraint> constraints,
java.util.List<Hint> hints)
Construct a problem using an objective list, variable list, constraint list, hint list, and an evaluator.
|
Modifier and Type | Method and Description |
---|---|
void |
addConstraint(Constraint aConstraint)
Add a Constraint object to constraintList.
|
void |
addHint(Hint aHint)
Add a Hint object to the hintList.
|
void |
addHints(java.util.List<Hint> hints)
Add to this problem, the list of hints.
|
void |
addObjective(Objective anObjective)
Adds an Objective to objectiveList.
|
void |
addVariable(Variable variable)
Adds a Variable object to variableList.
|
boolean |
evaluate(Trial trial)
Evaluate the trial
|
Trial |
evaluateInitialPoint()
Evaluate the initial point as specified by the initial values of the variables
|
TrialPoint |
generateInitialTrialPoint()
Generate a new trial point based on the initial values of the variables.
|
java.util.List<Constraint> |
getConstraints()
Get the list of constraints.
|
Evaluator |
getEvaluator()
Get the evaluator.
|
Hint |
getHint(java.lang.String type)
Get the hint corresponding to the specified type.
|
java.util.List<Objective> |
getObjectives()
Get the list of objectives.
|
ValueRef |
getValueReference(Variable variable)
Get the value reference which is mapped to a variable.
|
java.util.List<Variable> |
getVariables()
Get the list of variables.
|
void |
setConstraints(java.util.List<Constraint> constraints)
Set the constraints.
|
void |
setEvaluator(Evaluator anEvaluator)
Set the evaluator to use in scoring the trial points.
|
void |
setHints(java.util.List<Hint> hints)
Set this problem's hints to the ones specified.
|
void |
setObjectives(java.util.List<? extends Objective> objectives)
Set the objectives.
|
void |
setVariables(java.util.List<Variable> variables)
Set the variables.
|
protected TrialVeto |
validate(Trial trial)
Validate the trial.
|
protected java.util.List<Objective> _objectives
protected final java.util.List<Variable> _variables
protected java.util.List<Constraint> _constraints
protected java.util.Map<java.lang.String,Hint> _hints
protected Evaluator _evaluator
public Problem(java.util.List<Objective> objectives, java.util.List<Variable> variables, Evaluator evaluator, java.util.List<Constraint> constraints, java.util.List<Hint> hints)
public Problem(java.util.List<Objective> objectives, java.util.List<Variable> variables, Evaluator evaluator)
public Problem()
public void addObjective(Objective anObjective)
anObjective
- The objective of the problem.public void setObjectives(java.util.List<? extends Objective> objectives)
objectives
- The new objectives valuepublic java.util.List<Objective> getObjectives()
public void addVariable(Variable variable)
variable
- The feature to be added to the Variable attributepublic void setVariables(java.util.List<Variable> variables)
variables
- The new variables valuepublic ValueRef getValueReference(Variable variable)
variable
- Description of the Parameterpublic final java.util.List<Variable> getVariables()
public void addConstraint(Constraint aConstraint)
aConstraint
- One constraint of the problem.public void setConstraints(java.util.List<Constraint> constraints)
constraints
- The new constraints valuepublic java.util.List<Constraint> getConstraints()
public void addHint(Hint aHint)
aHint
- One hint for the problem.public void addHints(java.util.List<Hint> hints)
hints
- the list of hints to add to this problem.public void setHints(java.util.List<Hint> hints)
hints
- The new hints to set for this problem.public Hint getHint(java.lang.String type)
type
- the type identifier for which to fetch a hint.public void setEvaluator(Evaluator anEvaluator)
anEvaluator
- The new evaluator valuepublic Evaluator getEvaluator()
public TrialPoint generateInitialTrialPoint()
protected TrialVeto validate(Trial trial)
trial
- The trial to be validated.public Trial evaluateInitialPoint()
public boolean evaluate(Trial trial)
trial
- the trial to evaluate