- Timestamp:
- 04/16/13 13:13:41 (12 years ago)
- Location:
- branches/OaaS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll 23 24 packages
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/OaaS/HeuristicLab.Services.Optimization.Controller/PlaceholderControllerService.cs
r9362 r9363 1 using System; 2 using System.Collections.Generic; 1 using System.Collections.Generic; 3 2 using System.Linq; 4 using System.Text;5 3 using System.ServiceModel; 4 using HeuristicLab.Services.Optimization.ControllerService.General; 6 5 using HeuristicLab.Services.Optimization.ControllerService.Interfaces; 7 6 using HeuristicLab.Services.Optimization.ControllerService.Model; 8 using HeuristicLab.Services.Optimization.ControllerService.General;9 7 10 8 namespace HeuristicLab.Services.Optimization.ControllerService { 11 9 [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, IgnoreExtensionDataObject = true)] 12 10 public class PlaceholderControllerService : IControllerService { 13 11 14 12 private IList<Model.OptimizationScenario> scenarios; 15 13 … … 50 48 tsp.AlgorithmParameters.Items.Add(new Model.Parameter() { Type = Model.ParameterType.Type, Value = new Model.TypeValue() { Name = "Selector", Value = "ProportionalSelector", Options = new string[] { "ProportionalSelector", "BestSelector" } } }); 51 49 tsp.AlgorithmParameters.Items.Add(new Model.Parameter() { Type = Model.ParameterType.Boolean, Value = new Model.BoolValue() { Name = "SetSeedRandomly", Value = true } });//, Value = true }); 52 this.scenarios = new List<Model.OptimizationScenario>() { tsp };*/ 50 this.scenarios = new List<Model.OptimizationScenario>() { tsp };*/ 53 51 //hiveManager.DispatchScenario(tsp); 54 52 //hiveManager = new MockupScenarioManager(); … … 59 57 60 58 public IEnumerable<Model.OptimizationScenario> GetOptimizationScenarios() { 61 return scenarios; 59 return scenarios; 62 60 } 63 61 … … 66 64 var scen = (from e in scenarios 67 65 where e.Id == name 68 select e).FirstOrDefault(); 66 select e).FirstOrDefault(); 69 67 return scen; 70 68 } … … 99 97 if (scenario == null) { 100 98 return false; 101 } 99 } 102 100 var added = hiveManager.AddScenario(user, scenario.Id, scenarioXml, scenarioMapper); 103 if (added) 101 if (added) 104 102 scenarios.Add(scenario); 105 103 return added; … … 117 115 public IEnumerable<string> GetOptimizationScenarioNames() { 118 116 return (from e in scenarios 119 select e.Id).AsEnumerable(); 120 } 121 122 123 public string SaveExperiment(User user, Experiment experiment) { 117 select e.Id).AsEnumerable(); 118 } 119 120 121 public string SaveExperiment(User user, Experiment experiment) { 124 122 // make sure all algorithms store their choices aswell 125 123 var scenarioMap = new Dictionary<string, OptimizationScenario>(); 126 124 var algos = new Stack<Algorithm>(); 127 125 foreach (var algo in experiment.Algorithm) algos.Push(algo); 128 129 126 127 130 128 131 129 while (algos.Count > 0) { … … 140 138 scenarioMap[algo.Name] = scenario; 141 139 } 142 140 143 141 AlgorithmHelper.Update(algo, scenario); 144 142 } … … 185 183 186 184 187 public IEnumerable<Experiment> GetExperiments(User user, bool namesOnly =false) {185 public IEnumerable<Experiment> GetExperiments(User user, bool namesOnly = false) { 188 186 return hiveManager.GetExperiments(user, namesOnly); 189 187 } … … 195 193 196 194 public string GetVisualExtension(string algorithmId) { 197 return hiveManager.GetVisualExtension(algorithmId); 195 return hiveManager.GetVisualExtension(algorithmId); 198 196 } 199 197 200 198 201 199 public bool AddVisualExtension(string algorithmId, string script) { 202 return hiveManager.AddVisualExtension(algorithmId, script); 200 //return hiveManager.AddVisualExtension(algorithmId, script); 201 return true; 203 202 } 204 203 205 204 public bool DeleteVisualExtension(string algorithmId) { 206 return hiveManager.DeleteVisualExtension(algorithmId); 205 //return hiveManager.DeleteVisualExtension(algorithmId); 206 return true; 207 207 } 208 208 }
Note: See TracChangeset
for help on using the changeset viewer.