// Sc = type of scores (e.g. Double) sclass TunableParameters> { settable IF1 scoreFunction; abstract class Parameter { settable S name; abstract A randomValue(); } class IntRangeParameter extends Parameter { settable IntRange range; Int randomValue() { ret random(range); } } class DoubleRangeParameter extends Parameter { settable DoubleRange range; Double randomValue() { ret random(range); } } new LinkedHashMap parameters; selfType add(Parameter p) { parameters.put(p.name(), p); this; } MapSO randomInstance() { MapSO map = new LinkedHashMap; for (param : values(parameters)) map.put(param.name(), param.randomValue()); ret map; } }