Changeset 2916 for trunk/sources/HeuristicLab.Optimization
- Timestamp:
- 03/03/10 03:14:37 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization/3.3/EngineAlgorithm.cs
r2882 r2916 21 21 22 22 using System; 23 using System.Linq; 23 24 using HeuristicLab.Collections; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 26 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.PluginInfrastructure; 27 29 28 30 namespace HeuristicLab.Optimization { … … 97 99 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 98 100 OperatorGraph = new OperatorGraph(); 101 InitializeEngine(); 99 102 } 100 103 protected EngineAlgorithm(string name) … … 103 106 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 104 107 OperatorGraph = new OperatorGraph(); 108 InitializeEngine(); 105 109 } 106 110 protected EngineAlgorithm(string name, ParameterCollection parameters) … … 109 113 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 110 114 OperatorGraph = new OperatorGraph(); 115 InitializeEngine(); 111 116 } 112 117 protected EngineAlgorithm(string name, string description) … … 115 120 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 116 121 OperatorGraph = new OperatorGraph(); 122 InitializeEngine(); 117 123 } 118 124 protected EngineAlgorithm(string name, string description, ParameterCollection parameters) … … 121 127 globalScope.Variables.Add(new Variable("Results", new VariableCollection())); 122 128 OperatorGraph = new OperatorGraph(); 129 InitializeEngine(); 130 } 131 132 private void InitializeEngine() { 133 var types = ApplicationManager.Manager.GetTypes(typeof(IEngine)); 134 Type t = types.FirstOrDefault(x => x.Name.Equals("SequentialEngine")); 135 if (t == null) t = types.FirstOrDefault(); 136 if (t != null) Engine = (IEngine)Activator.CreateInstance(t); 123 137 } 124 138
Note: See TracChangeset
for help on using the changeset viewer.