Changeset 11393 for branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveEvaluator.cs
- Timestamp:
- 09/26/14 22:57:18 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/SingleObjectiveEvaluator.cs
r10850 r11393 43 43 } 44 44 45 public ILookupParameter< SingleObjectiveScript> ScriptParameter {46 get { return (ILookupParameter< SingleObjectiveScript>)Parameters["Script"]; }45 public ILookupParameter<ISingleObjectiveProblemDefinitionHost> ProblemDefinitionParameter { 46 get { return (ILookupParameter<ISingleObjectiveProblemDefinitionHost>)Parameters["ProblemDefinition"]; } 47 47 } 48 48 … … 60 60 public SingleObjectiveEvaluator() { 61 61 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use.")); 62 Parameters.Add(new LookupParameter< SingleObjectiveScript>("Script", "The script that will execute the evaluation function and define the parameter vector."));62 Parameters.Add(new LookupParameter<ISingleObjectiveProblemDefinitionHost>("ProblemDefinition", "The host that holds the problem definition.")); 63 63 Parameters.Add(new LookupParameter<Configuration>("Configuration", "An item that holds the problem's configuration.")); 64 64 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the parameter vector.")); … … 71 71 public override IOperation Apply() { 72 72 var random = RandomParameter.ActualValue; 73 var runner = ScriptParameter.ActualValue;74 if ( runner.Instance == null) throw new InvalidOperationException("Script instance is null, maybe the code doesn't compile.");73 var host = ProblemDefinitionParameter.ActualValue; 74 if (host.Instance == null) throw new InvalidOperationException("Script instance is null, maybe the code doesn't compile."); 75 75 var config = ConfigurationParameter.ActualValue; 76 76 var binDict = new Dictionary<string, BinaryVector>(); … … 106 106 realVectors: realDict.Count > 0 ? realDict : null, 107 107 permutations: permDict.Count > 0 ? permDict : null); 108 QualityParameter.ActualValue = new DoubleValue( runner.Instance.Evaluate(random, vector));108 QualityParameter.ActualValue = new DoubleValue(host.Instance.Evaluate(random, vector)); 109 109 return base.Apply(); 110 110 }
Note: See TracChangeset
for help on using the changeset viewer.