$darkmode
DENOPTIM
denoptim.fitness.FitnessExpressionParser.VariableDefiningContext Class Reference

This is the context on which we read a fitness expression, and parse it to identify all variables in the expression. More...

Inheritance diagram for denoptim.fitness.FitnessExpressionParser.VariableDefiningContext:
[legend]
Collaboration diagram for denoptim.fitness.FitnessExpressionParser.VariableDefiningContext:
[legend]

Public Member Functions

 VariableDefiningContext (List< Variable > variables)
 Constructor specifying the destination of the variables created when parsing the expression. More...
 
ELResolver getELResolver ()
 
FunctionMapper getFunctionMapper ()
 
VariableMapper getVariableMapper ()
 

Private Attributes

List< Variablevariables
 Reference to where we collect all the created variables. More...
 
FunctionMapper fm = null
 
VariableMapper vm
 This mapper does not map variables, but it creates an instance of Variable named with the given string, and it adds the instance to the list of known variables, if no variable with the same name is already there. More...
 
ELResolver resolver = new BeanELResolver()
 Resolver exploiting JavaBean contract. More...
 

Detailed Description

This is the context on which we read a fitness expression, and parse it to identify all variables in the expression.

The variables are collected in a list

Definition at line 423 of file FitnessExpressionParser.java.

Constructor & Destructor Documentation

◆ VariableDefiningContext()

denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.VariableDefiningContext ( List< Variable variables)

Constructor specifying the destination of the variables created when parsing the expression.

Parameters
variablesdestination of the created variable instances.

Definition at line 475 of file FitnessExpressionParser.java.

References denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.variables.

Member Function Documentation

◆ getELResolver()

ELResolver denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.getELResolver ( )

◆ getFunctionMapper()

FunctionMapper denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.getFunctionMapper ( )

◆ getVariableMapper()

VariableMapper denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.getVariableMapper ( )

Member Data Documentation

◆ fm

FunctionMapper denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.fm = null
private

◆ resolver

ELResolver denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.resolver = new BeanELResolver()
private

Resolver exploiting JavaBean contract.

Definition at line 468 of file FitnessExpressionParser.java.

Referenced by denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.getELResolver().

◆ variables

List<Variable> denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.variables
private

Reference to where we collect all the created variables.

Definition at line 428 of file FitnessExpressionParser.java.

Referenced by denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.VariableDefiningContext().

◆ vm

VariableMapper denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.vm
private
Initial value:
= new VariableMapper() {
@Override
public ValueExpression resolveVariable(String variableName) {
for (Variable existing : variables)
{
if (variableName.equals(existing.getName()))
return null;
}
Variable v = new Variable(variableName);
v.setDescriptorName(variableName);
variables.add(v);
return null;
}
@Override
public ValueExpression setVariable(String variable,
ValueExpression expression) {
return null;
}
}
List< Variable > variables
Reference to where we collect all the created variables.
A variable in the expression defining the fitness.
Definition: Variable.java:42
void setDescriptorName(String descName)
Set the short name of the descriptor implementation.
Definition: Variable.java:154

This mapper does not map variables, but it creates an instance of Variable named with the given string, and it adds the instance to the list of known variables, if no variable with the same name is already there.

Variable names are expected to correspond to the name of descriptors

Definition at line 440 of file FitnessExpressionParser.java.

Referenced by denoptim.fitness.FitnessExpressionParser.VariableDefiningContext.getVariableMapper().


The documentation for this class was generated from the following file: