using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ServiceModel; namespace HeuristicLab.Services.Optimization.ControllerService { [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, IgnoreExtensionDataObject = true)] public class PlaceholderControllerService : IControllerService { private IList scenarios; public PlaceholderControllerService() { var tsp = new Model.OptimizationScenario() { Name = "Travelling Salesman Problem" }; tsp.InputParameters.Add(new Model.Parameter() { Name = "BestKnownQuality", Type = Model.ParameterType.Decimal, Value = new Model.DecimalValue() { Value = 6110.0d } }); tsp.InputParameters.Add(new Model.Parameter() { Name = "BestKnownSolution", Type = Model.ParameterType.DecimalMatrix }); //, Value = //new double[]{0,40,38,116,111,114,27,61,104,127,15,44,4,10,75,108,60,128,123,63,68,85,87,25,6,96,69,106,126,103,42,33,16,30,26,18,99,14,28,23,115,94,78,86,11,80,102,76,93,88,109,97,67,62,47,24,112,31,35,83,118,110,122,100,81,56,8,55,64,51,74,73,98,72,91,37,105,52,119,57,48,71,90,5,101,9,13,66,12,95,121,54,59,50,41,43,92,36,21,46,39,22,32,20,125,120,77,65,84,124,89,58,29,82,2,113,107,7,17,45,79,117,19,3,34,53,1,49,129,70}}); tsp.InputParameters.Add(new Model.Parameter() { Name = "Coordinates", Type = Model.ParameterType.DecimalMatrix }); //, Value = //new double[,]{{334.5909245845, 161.7809319139},{334.5909245845, 161.7809319139},{503.8741827107,172.8741151168}}}); tsp.InputParameters.Add(new Model.Parameter() { Name = "Evaluator", Type = Model.ParameterType.Type });//, Value = "TSPRoundedEuclideanPathEvaluator", Choices = new string[]{ "TSPRoundedEuclideanPathEvaluator", "TSPGeoPathEvaluator", "TSPEuclideanPathEvaluator" } }); //tsp.InputParameters.Add(new Model.Parameter() { Name = "SolutionCreator" }); tsp.InputParameters.Add(new Model.Parameter() { Name = "UseDistanceMatrix", Type = Model.ParameterType.Boolean});//, Value = true }); tsp.AlgorithmParameters.Add(new Model.Parameter() { Name = "Crossover", Type = Model.ParameterType.Type});//, Value = "OrderCrossover2", Choices = new string[] { "OrderCrossover2", "CosaCrossover" } }); tsp.AlgorithmParameters.Add(new Model.Parameter() { Name = "Elites", Type = Model.ParameterType.Integer});//, Value = 1}); tsp.AlgorithmParameters.Add(new Model.Parameter() { Name = "MaximumGenerations", Type = Model.ParameterType.Integer });//, Value = 1000}); tsp.AlgorithmParameters.Add(new Model.Parameter() { Name = "MutationProbability", Type = Model.ParameterType.Percent });//, Value = 5}); tsp.AlgorithmParameters.Add(new Model.Parameter() { Name = "Mutator", Type = Model.ParameterType.Type});//, Value = "InversionManipulator", Choices = new string[]{"InversionManipulator", "ScrambleManipulator"} }); tsp.AlgorithmParameters.Add(new Model.Parameter() { Name = "PopulationSize", Type = Model.ParameterType.Integer});//, Value = 100 }); tsp.AlgorithmParameters.Add(new Model.Parameter() { Name = "Seed", Type = Model.ParameterType.Integer});//, Value = 100 }); tsp.AlgorithmParameters.Add(new Model.Parameter() { Name = "Selector", Type = Model.ParameterType.Type });//, Value = "ProportionalSelector", Choices = new string[]{"ProportionalSelector", "BestSelector"} }); tsp.AlgorithmParameters.Add(new Model.Parameter() { Name = "SetSeedRandomly", Type = Model.ParameterType.Boolean });//, Value = true }); this.scenarios = new List() { tsp }; } public IEnumerable GetOptimizationScenarios() { return scenarios; } public Model.OptimizationScenario GetOptimizationScenarioByName(string name) { if (scenarios[0].Name == name) return scenarios[0]; return null; } } }