pop.getContext().clearDefinedVariables();
for(AnalystField field : getScript().getNormalize().getNormalizedFields() ) {
DataField df = getScript().findDataField(field.getName());
String varName = field.getName();
VariableMapping mapping;
switch( field.getAction() ) {
case Ignore:
mapping = null;
break;
case PassThrough:
if( df.isInteger() ) {
mapping = new VariableMapping(varName, ValueType.intType);
} else if( df.isReal() ) {
mapping = new VariableMapping(varName, ValueType.floatingType);
} else {
mapping = new VariableMapping(varName, ValueType.stringType);
}
break;
case Equilateral:
case OneOf:
case Normalize:
mapping = new VariableMapping(varName, ValueType.floatingType);
break;
case SingleField:
if( df.isClass() ) {
mapping = new VariableMapping(varName, ValueType.enumType, classType++, df.getClassMembers().size() );
} else if( df.isInteger() ) {
mapping = new VariableMapping(varName, ValueType.intType );
} else {
mapping = new VariableMapping(varName, ValueType.floatingType);
}
break;
default:
throw new AnalystError("Unknown normalization action: " + field.getAction().toString());
}