- Timestamp:
- 10/08/19 18:32:26 (5 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/HeuristicLab.JsonInterface.csproj
r17322 r17324 11 11 <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> 12 12 <FileAlignment>512</FileAlignment> 13 <AutoGenerateBindingRedirects> true</AutoGenerateBindingRedirects>13 <AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects> 14 14 <Deterministic>true</Deterministic> 15 15 <TargetFrameworkProfile /> … … 81 81 <Compile Include="Converters\ValueTypeMatrixConverter.cs" /> 82 82 <Compile Include="Converters\ValueTypeValueConverter.cs" /> 83 <Compile Include="Plugin.cs" /> 83 84 <Compile Include="Properties\AssemblyInfo.cs" /> 84 85 <Compile Include="JsonItem.cs" /> … … 89 90 <None Include="HeuristicLab.snk" /> 90 91 <None Include="packages.config" /> 92 <None Include="Plugin.cs.frame" /> 91 93 </ItemGroup> 92 94 <ItemGroup> 93 <ProjectReference Include="..\HeuristicLab.Algorithms.ALPS\3.3\HeuristicLab.Algorithms.ALPS-3.3.csproj">94 <Project>{59f354cb-fe13-4253-aed2-ad86372bec27}</Project>95 <Name>HeuristicLab.Algorithms.ALPS-3.3</Name>96 </ProjectReference>97 <ProjectReference Include="..\HeuristicLab.Algorithms.Benchmarks\3.3\HeuristicLab.Algorithms.Benchmarks-3.3.csproj">98 <Project>{068c70a7-8caf-4ab6-8721-4564d62292bc}</Project>99 <Name>HeuristicLab.Algorithms.Benchmarks-3.3</Name>100 </ProjectReference>101 <ProjectReference Include="..\HeuristicLab.Algorithms.CMAEvolutionStrategy\3.4\HeuristicLab.Algorithms.CMAEvolutionStrategy-3.4.csproj">102 <Project>{291010e4-2f4e-4d29-a795-753cff293fdb}</Project>103 <Name>HeuristicLab.Algorithms.CMAEvolutionStrategy-3.4</Name>104 </ProjectReference>105 <ProjectReference Include="..\HeuristicLab.Algorithms.DataAnalysis.DecisionTrees\3.4\HeuristicLab.Algorithms.DataAnalysis.DecisionTrees-3.4.csproj">106 <Project>{541a53f3-e6a7-402f-91bb-d76041cdd9fd}</Project>107 <Name>HeuristicLab.Algorithms.DataAnalysis.DecisionTrees-3.4</Name>108 </ProjectReference>109 <ProjectReference Include="..\HeuristicLab.Algorithms.DataAnalysis.Glmnet\3.4\HeuristicLab.Algorithms.DataAnalysis.Glmnet-3.4.csproj">110 <Project>{4c7f6d8a-b279-4898-acd6-7be39111def9}</Project>111 <Name>HeuristicLab.Algorithms.DataAnalysis.Glmnet-3.4</Name>112 </ProjectReference>113 <ProjectReference Include="..\HeuristicLab.Algorithms.EvolutionStrategy\3.3\HeuristicLab.Algorithms.EvolutionStrategy-3.3.csproj">114 <Project>{e0b45023-cb84-48a1-a1b7-8295b64b7bad}</Project>115 <Name>HeuristicLab.Algorithms.EvolutionStrategy-3.3</Name>116 </ProjectReference>117 <ProjectReference Include="..\HeuristicLab.Algorithms.GeneticAlgorithm\3.3\HeuristicLab.Algorithms.GeneticAlgorithm-3.3.csproj">118 <Project>{a51da44f-cb35-4f6f-99f5-2a2e904ab93b}</Project>119 <Name>HeuristicLab.Algorithms.GeneticAlgorithm-3.3</Name>120 </ProjectReference>121 <ProjectReference Include="..\HeuristicLab.Algorithms.GradientDescent\3.3\HeuristicLab.Algorithms.GradientDescent-3.3.csproj">122 <Project>{1256b945-eea9-4be4-9880-76b5b113f089}</Project>123 <Name>HeuristicLab.Algorithms.GradientDescent-3.3</Name>124 </ProjectReference>125 <ProjectReference Include="..\HeuristicLab.Algorithms.LocalSearch\3.3\HeuristicLab.Algorithms.LocalSearch-3.3.csproj">126 <Project>{4ae3fc69-c575-42d2-bc46-0fad5850efc5}</Project>127 <Name>HeuristicLab.Algorithms.LocalSearch-3.3</Name>128 </ProjectReference>129 <ProjectReference Include="..\HeuristicLab.Algorithms.MOCMAEvolutionStrategy\3.3\HeuristicLab.Algorithms.MOCMAEvolutionStrategy-3.3.csproj">130 <Project>{0e2e224f-e9b2-41f3-b510-09183eeba2af}</Project>131 <Name>HeuristicLab.Algorithms.MOCMAEvolutionStrategy-3.3</Name>132 </ProjectReference>133 <ProjectReference Include="..\HeuristicLab.Algorithms.NSGA2\3.3\HeuristicLab.Algorithms.NSGA2-3.3.csproj">134 <Project>{15452b9f-a436-4139-8ee7-da72fb8d3664}</Project>135 <Name>HeuristicLab.Algorithms.NSGA2-3.3</Name>136 </ProjectReference>137 <ProjectReference Include="..\HeuristicLab.Algorithms.OffspringSelectionEvolutionStrategy\3.3\HeuristicLab.Algorithms.OffspringSelectionEvolutionStrategy-3.3.csproj">138 <Project>{1d41eae6-cc79-41d4-858c-589c4db5e50d}</Project>139 <Name>HeuristicLab.Algorithms.OffspringSelectionEvolutionStrategy-3.3</Name>140 </ProjectReference>141 <ProjectReference Include="..\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm\3.3\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj">142 <Project>{f409dd9e-1e9c-4eb1-aa3a-9f6e987c6e58}</Project>143 <Name>HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3</Name>144 </ProjectReference>145 <ProjectReference Include="..\HeuristicLab.Algorithms.ParameterlessPopulationPyramid\3.3\HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3.csproj">146 <Project>{9319c447-8183-4dbc-8145-0e3cf98084cc}</Project>147 <Name>HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3</Name>148 </ProjectReference>149 <ProjectReference Include="..\HeuristicLab.Algorithms.ParticleSwarmOptimization\3.3\HeuristicLab.Algorithms.ParticleSwarmOptimization-3.3.csproj">150 <Project>{2c429157-9c34-4dd3-9d5f-b444b751e39a}</Project>151 <Name>HeuristicLab.Algorithms.ParticleSwarmOptimization-3.3</Name>152 </ProjectReference>153 <ProjectReference Include="..\HeuristicLab.Algorithms.RandomSearch\3.3\HeuristicLab.Algorithms.RandomSearch-3.3.csproj">154 <Project>{4a15dc1a-51ee-4cb7-ac05-f5afddece1b1}</Project>155 <Name>HeuristicLab.Algorithms.RandomSearch-3.3</Name>156 </ProjectReference>157 <ProjectReference Include="..\HeuristicLab.Algorithms.RAPGA\3.3\HeuristicLab.Algorithms.RAPGA-3.3.csproj">158 <Project>{b03c4e41-1d01-4c60-b0f4-dbb257d98ca8}</Project>159 <Name>HeuristicLab.Algorithms.RAPGA-3.3</Name>160 </ProjectReference>161 <ProjectReference Include="..\HeuristicLab.Algorithms.ScatterSearch\3.3\HeuristicLab.Algorithms.ScatterSearch-3.3.csproj">162 <Project>{5fee5db4-7fd9-4cbd-bec2-3fee17b31a94}</Project>163 <Name>HeuristicLab.Algorithms.ScatterSearch-3.3</Name>164 </ProjectReference>165 <ProjectReference Include="..\HeuristicLab.Algorithms.SimulatedAnnealing\3.3\HeuristicLab.Algorithms.SimulatedAnnealing-3.3.csproj">166 <Project>{96e5ed5b-187d-4012-9cda-d85cdad38342}</Project>167 <Name>HeuristicLab.Algorithms.SimulatedAnnealing-3.3</Name>168 </ProjectReference>169 <ProjectReference Include="..\HeuristicLab.Algorithms.TabuSearch\3.3\HeuristicLab.Algorithms.TabuSearch-3.3.csproj">170 <Project>{d58a232d-04ba-4186-b73e-0ec86fd31abe}</Project>171 <Name>HeuristicLab.Algorithms.TabuSearch-3.3</Name>172 </ProjectReference>173 <ProjectReference Include="..\HeuristicLab.Algorithms.VariableNeighborhoodSearch\3.3\HeuristicLab.Algorithms.VariableNeighborhoodSearch-3.3.csproj">174 <Project>{e4cfb0c3-0589-4893-b38e-8bedf885c765}</Project>175 <Name>HeuristicLab.Algorithms.VariableNeighborhoodSearch-3.3</Name>176 </ProjectReference>177 <ProjectReference Include="..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">178 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>179 <Name>HeuristicLab.Analysis-3.3</Name>180 </ProjectReference>181 95 <ProjectReference Include="..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 182 <Project>{958 B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>96 <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project> 183 97 <Name>HeuristicLab.Collections-3.3</Name> 184 98 </ProjectReference> 185 99 <ProjectReference Include="..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj"> 186 <Project>{ A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>100 <Project>{a9ad58b9-3ef9-4cc1-97e5-8d909039ff5c}</Project> 187 101 <Name>HeuristicLab.Common-3.3</Name> 188 102 </ProjectReference> 189 103 <ProjectReference Include="..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj"> 190 <Project>{ C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>104 <Project>{c36bd924-a541-4a00-afa8-41701378ddc5}</Project> 191 105 <Name>HeuristicLab.Core-3.3</Name> 192 106 </ProjectReference> … … 195 109 <Name>HeuristicLab.Data-3.3</Name> 196 110 </ProjectReference> 197 <ProjectReference Include="..\HeuristicLab.Encodings.PermutationEncoding\3.3\HeuristicLab.Encodings.PermutationEncoding-3.3.csproj">198 <Project>{DBECB8B0-B166-4133-BAF1-ED67C3FD7FCA}</Project>199 <Name>HeuristicLab.Encodings.PermutationEncoding-3.3</Name>200 </ProjectReference>201 <ProjectReference Include="..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">202 <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>203 <Name>HeuristicLab.Operators-3.3</Name>204 </ProjectReference>205 111 <ProjectReference Include="..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj"> 206 <Project>{14 AB8D24-25BC-400C-A846-4627AA945192}</Project>112 <Project>{14ab8d24-25bc-400c-a846-4627aa945192}</Project> 207 113 <Name>HeuristicLab.Optimization-3.3</Name> 208 114 </ProjectReference> … … 215 121 <Name>HeuristicLab.PluginInfrastructure-3.3</Name> 216 122 </ProjectReference> 217 <ProjectReference Include="..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">218 <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>219 <Name>HeuristicLab.Problems.Instances-3.3</Name>220 </ProjectReference>221 <ProjectReference Include="..\HeuristicLab.Problems.Knapsack\3.3\HeuristicLab.Problems.Knapsack-3.3.csproj">222 <Project>{E10F395F-C8A6-48AD-B470-9AA7A1F43809}</Project>223 <Name>HeuristicLab.Problems.Knapsack-3.3</Name>224 </ProjectReference>225 <ProjectReference Include="..\HeuristicLab.Problems.TravelingSalesman\3.3\HeuristicLab.Problems.TravelingSalesman-3.3.csproj">226 <Project>{d767c38d-8014-46b0-9a32-03a3aecce34a}</Project>227 <Name>HeuristicLab.Problems.TravelingSalesman-3.3</Name>228 </ProjectReference>229 <ProjectReference Include="..\HeuristicLab.Problems.VehicleRouting\3.4\HeuristicLab.Problems.VehicleRouting-3.4.csproj">230 <Project>{B94FFB82-43D4-40AB-9980-B03470ADF221}</Project>231 <Name>HeuristicLab.Problems.VehicleRouting-3.4</Name>232 </ProjectReference>233 123 <ProjectReference Include="..\HeuristicLab.SequentialEngine\3.3\HeuristicLab.SequentialEngine-3.3.csproj"> 234 <Project>{ dc3d7072-7999-4719-b65d-3997744d5dc1}</Project>124 <Project>{DC3D7072-7999-4719-B65D-3997744D5DC1}</Project> 235 125 <Name>HeuristicLab.SequentialEngine-3.3</Name> 236 126 </ProjectReference> … … 238 128 <ItemGroup /> 239 129 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 130 <PropertyGroup> 131 <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir) 132 set ProjectDir=$(ProjectDir) 133 set SolutionDir=$(SolutionDir) 134 set Outdir=$(Outdir) 135 136 call PreBuildEvent.cmd 137 138 </PreBuildEvent> 139 </PropertyGroup> 240 140 </Project> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JCGenerator.cs
r17322 r17324 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Algorithms.GeneticAlgorithm;5 4 using HeuristicLab.Core; 6 5 using HeuristicLab.Data; 7 using HeuristicLab.Encodings.PermutationEncoding;8 6 using HeuristicLab.Optimization; 9 using HeuristicLab.Problems.TravelingSalesman;10 7 using Newtonsoft.Json; 11 8 using Newtonsoft.Json.Linq; 12 using Newtonsoft.Json.Serialization;13 9 14 10 namespace HeuristicLab.JsonInterface { … … 16 12 17 13 private JObject template = JObject.Parse(Constants.Template); 14 private Dictionary<string, string> TypeList = new Dictionary<string, string>(); 15 private JArray JsonItems { get; set; } = new JArray(); 18 16 19 private Dictionary<string, string> TypeList = new Dictionary<string, string>();20 21 JArray jsonItems = new JArray();22 17 private void PopulateJsonItems(JsonItem item) { 23 18 if (item.Parameters != null) { 24 19 if(item.Range == null) 25 jsonItems.Add(Serialize(item));20 JsonItems.Add(Serialize(item)); 26 21 foreach (var p in item.Parameters) 27 22 if(p.Parameters != null) … … 47 42 48 43 public string GenerateTemplate(IAlgorithm algorithm, IProblem problem, params string[] freeParameters) { 44 JsonItems.Clear(); 45 TypeList.Clear(); 46 49 47 algorithm.Problem = problem; 50 48 JsonItem algorithmData = JsonItemConverter.Extract(algorithm); … … 55 53 template[Constants.Metadata][Constants.Algorithm] = algorithm.Name; 56 54 template[Constants.Metadata][Constants.Problem] = problem.Name; 57 template[Constants.Objects] = jsonItems;55 template[Constants.Objects] = JsonItems; 58 56 template[Constants.Types] = JObject.FromObject(TypeList); 59 57 … … 63 61 #region Helper 64 62 private void RefactorFreeParameters(JToken token, string[] freeParameters) { 65 66 67 63 IList<JObject> objToRemove = new List<JObject>(); 68 64 TransformNodes(x => { … … 77 73 objToRemove.Add(x); 78 74 } else { 79 //x.Property(nameof(JsonItem.Path))?.Remove();80 75 x.Property(nameof(JsonItem.Type))?.Remove(); 81 76 x.Property(nameof(JsonItem.Parameters))?.Remove(); -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JCInstantiator.cs
r17322 r17324 10 10 using HeuristicLab.Data; 11 11 using HeuristicLab.Optimization; 12 using HeuristicLab.SequentialEngine; 12 13 using Newtonsoft.Json.Linq; 13 14 … … 49 50 //7. get problem data and object 50 51 JsonItem problemData = GetData(problemName); 52 51 53 IProblem problem = CreateObject<IProblem>(problemData); 52 54 algorithm.Problem = problem; … … 54 56 //8. inject configuration 55 57 JsonItemConverter.Inject(algorithm, algorithmData); 56 JsonItemConverter.Inject(problem, problemData); 58 //JsonItemConverter.Inject(problem, problemData); 59 60 if (algorithm is EngineAlgorithm) { 61 algorithm.Cast<EngineAlgorithm>().Engine = new SequentialEngine.SequentialEngine(); 62 File.WriteAllText(@"C:\Workspace\test2.txt", "test"); 63 } 57 64 58 65 return algorithm; … … 86 93 foreach (var p in x.Parameters) 87 94 if (p.Default is string) { 88 string key = $"{p.Path}.{p.Default.Cast<string>()}"; 95 string key = p.Path; 96 if (p.Range != null) 97 key = $"{p.Path}.{p.Default.Cast<string>()}"; 98 89 99 if (ParameterizedItems.TryGetValue(key, out JsonItem value)) 90 100 p.Reference = value; … … 171 181 private IList<JsonItem> PopulateOperators(JObject obj) { 172 182 IList<JsonItem> list = new List<JsonItem>(); 173 JToken operators = obj[nameof( Operators)];183 JToken operators = obj[nameof(JsonItem.Operators)]; 174 184 if (operators != null) 175 185 foreach (JObject sp in operators) -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItem.cs
r17322 r17324 15 15 public string Name { get; set; } 16 16 public string Type { get; set; } 17 public string Path { get; set; } = "";17 public string Path { get; set; } 18 18 public IList<JsonItem> Parameters { get; set; } 19 19 public IList<JsonItem> Operators { get; set; }
Note: See TracChangeset
for help on using the changeset viewer.