Changeset 9748 for branches/HeuristicLab.ExternalEvaluation Scientific/HeuristicLab.Problems.ExternalEvaluation.Matlab
- Timestamp:
- 07/24/13 14:53:19 (11 years ago)
- Location:
- branches/HeuristicLab.ExternalEvaluation Scientific/HeuristicLab.Problems.ExternalEvaluation.Matlab/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.ExternalEvaluation Scientific/HeuristicLab.Problems.ExternalEvaluation.Matlab/3.3/MatlabParameterOptimizationProblem.cs
r9715 r9748 28 28 29 29 namespace HeuristicLab.Problems.ExternalEvaluation.Matlab { 30 [Item("M atlab Parameter Optimization Problem", "Optimization of a parameter vector which is evaluated in Matlab.")]30 [Item("MATLAB Parameter Optimization Problem", "Optimization of a parameter vector which is evaluated in MATLAB.")] 31 31 [StorableClass] 32 32 [Creatable("Problems")] 33 33 public class MatlabParameterOptimizationProblem : ParameterOptimizationProblem { 34 34 private const string QualityVariableParameterName = "QualityVariableName"; 35 private const string MatlabEvaluationScriptParameterName = "M atlabEvaluationScript";35 private const string MatlabEvaluationScriptParameterName = "MATLABEvaluationScript"; 36 36 37 37 #region parameters … … 65 65 public MatlabParameterOptimizationProblem() 66 66 : base(new MatlabParameterVectorEvaluator()) { 67 Parameters.Add(new FixedValueParameter<StringValue>(QualityVariableParameterName, "The name of the quality variable of the SciLabscript.", new StringValue("quality")));68 Parameters.Add(new FixedValueParameter<TextFileValue>(MatlabEvaluationScriptParameterName, "The path to the M atlabevaluation script.", new TextFileValue()));67 Parameters.Add(new FixedValueParameter<StringValue>(QualityVariableParameterName, "The name of the quality variable of the MATLAB script.", new StringValue("quality"))); 68 Parameters.Add(new FixedValueParameter<TextFileValue>(MatlabEvaluationScriptParameterName, "The path to the MATLAB evaluation script.", new TextFileValue())); 69 69 70 MatlabEvaluationScript.FileDialogFilter = @"M atlabScripts|*.m|All files|*.*";70 MatlabEvaluationScript.FileDialogFilter = @"MATLAB Scripts|*.m|All files|*.*"; 71 71 } 72 72 } -
branches/HeuristicLab.ExternalEvaluation Scientific/HeuristicLab.Problems.ExternalEvaluation.Matlab/3.3/MatlabParameterVectorEvaluator.cs
r9715 r9748 30 30 31 31 namespace HeuristicLab.Problems.ExternalEvaluation.Matlab { 32 [Item("M atLabParameterVectorEvaluator", "An evaluator which takes a parameter vector and returns a quality value, calculated by a Scilab script.")]32 [Item("MATLABParameterVectorEvaluator", "An evaluator which takes a parameter vector and returns a quality value, calculated by a Scilab script.")] 33 33 [StorableClass] 34 34 public sealed class MatlabParameterVectorEvaluator : ParameterVectorEvaluator { 35 35 private const string QualityVariableParameterName = "QualityVariableName"; 36 private const string MatlabEvaluationScriptParameterName = "M atlabEvaluationScript";36 private const string MatlabEvaluationScriptParameterName = "MATLABEvaluationScript"; 37 37 private const string InitializationScriptParameterName = "InitializationScript"; 38 38 … … 64 64 public MatlabParameterVectorEvaluator() 65 65 : base() { 66 Parameters.Add(new LookupParameter<StringValue>(QualityVariableParameterName, "The name of the quality variable of the Matlab script.")); 67 Parameters.Add(new LookupParameter<TextFileValue>(MatlabEvaluationScriptParameterName, "The path to the Matlab evaluation script.")); 68 Parameters.Add(new FixedValueParameter<TextFileValue>(InitializationScriptParameterName, "The path to a Matlab script the should be execute before the evaluation starts.", new TextFileValue())); 69 } 70 71 [StorableHook(HookType.AfterDeserialization)] 72 private void AfterDeserialization() { 73 InitializeState(); 66 Parameters.Add(new LookupParameter<StringValue>(QualityVariableParameterName, "The name of the quality variable calculated in the MATLAB script.")); 67 Parameters.Add(new LookupParameter<TextFileValue>(MatlabEvaluationScriptParameterName, "The path to the MATLAB evaluation script.")); 68 Parameters.Add(new FixedValueParameter<TextFileValue>(InitializationScriptParameterName, "The path to a MATLAB script the should be execute before the evaluation starts.", new TextFileValue())); 74 69 } 75 70 … … 89 84 90 85 string initScript = InitializationScript.Value; 91 string result = matLabConnector.Execute("cd " + Path.GetDirectoryName(initScript)); 86 var directoryName = Path.GetDirectoryName(initScript); 87 string result = matLabConnector.Execute(string.Format("cd '{0}'", directoryName)); 92 88 if (!string.IsNullOrEmpty(result)) throw new InvalidOperationException(result); 93 89 … … 110 106 111 107 lock (locker) { 108 if (matLabConnector == null) InitializeState(); 109 112 110 string result; 113 111 string script = evaluationScript.Value; 114 112 115 113 if (!changedDirectory) { 116 result = matLabConnector.Execute("cd " + Path.GetDirectoryName(script)); 114 var directoryName = Path.GetDirectoryName(script); 115 result = matLabConnector.Execute(string.Format("cd '{0}'", directoryName)); 117 116 if (!string.IsNullOrEmpty(result)) throw new InvalidOperationException(result); 118 117 changedDirectory = true; -
branches/HeuristicLab.ExternalEvaluation Scientific/HeuristicLab.Problems.ExternalEvaluation.Matlab/3.3/Plugin.cs.frame
r9690 r9748 28 28 /// Plugin class for HeuristicLab.Problems.ExternalEvaluation.Matlab plugin. 29 29 /// </summary> 30 [Plugin("HeuristicLab.Problems.ExternalEvaluation.M atlab", "3.3.8.$WCREV$")]30 [Plugin("HeuristicLab.Problems.ExternalEvaluation.MATLAB", "3.3.8.$WCREV$")] 31 31 [PluginFile("HeuristicLab.Problems.ExternalEvaluation.Matlab-3.3.dll", PluginFileType.Assembly)] 32 32 [PluginFile("Interop.MLApp.dll",PluginFileType.Assembly)] -
branches/HeuristicLab.ExternalEvaluation Scientific/HeuristicLab.Problems.ExternalEvaluation.Matlab/3.3/Properties/AssemblyInfo.cs.frame
r9690 r9748 27 27 // associated with an assembly. 28 28 [assembly: AssemblyTitle("HeuristicLab.Problems.ExternalEvaluation.Matlab")] 29 [assembly: AssemblyDescription("HeuristicLab problems for real valued parameter optimization performed in M atlab.")]29 [assembly: AssemblyDescription("HeuristicLab problems for real valued parameter optimization performed in MATLAB.")] 30 30 [assembly: AssemblyConfiguration("")] 31 31 [assembly: AssemblyCompany("")]
Note: See TracChangeset
for help on using the changeset viewer.