Changeset 1646
- Timestamp:
- 04/24/09 10:16:58 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 deleted
- 6 edited
- 3 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.FixedOperators/3.2/CreateChildren.cs
r1552 r1646 31 31 using HeuristicLab.Routing.TSP; 32 32 33 namespace HeuristicLab. SGA.Hardwired{33 namespace HeuristicLab.FixedOperators { 34 34 class CreateChildren : OperatorBase { 35 35 ChildrenInitializer ci; … … 95 95 } // Apply 96 96 } // class CreateChildren 97 } // namespace HeuristicLab. SGA.Hardwired97 } // namespace HeuristicLab.FixedOperators -
trunk/sources/HeuristicLab.FixedOperators/3.2/CreateChildrenHardWired.cs
r1557 r1646 31 31 using HeuristicLab.Routing.TSP; 32 32 33 namespace HeuristicLab. SGA.Hardwired{33 namespace HeuristicLab.FixedOperators { 34 34 class CreateChildrenHardWired : OperatorBase { 35 35 ChildrenInitializer ci; … … 120 120 } // Apply 121 121 } // class CreateChildrenHardWired 122 } // namespace HeuristicLab. SGA.Hardwired122 } // namespace HeuristicLab.FixedOperators -
trunk/sources/HeuristicLab.FixedOperators/3.2/CreateReplacement.cs
r1560 r1646 33 33 using System.Collections; 34 34 35 namespace HeuristicLab. SGA.Hardwired{35 namespace HeuristicLab.FixedOperators { 36 36 class CreateReplacement : OperatorBase { 37 37 LeftSelector ls; … … 83 83 } // Apply 84 84 } // class CreateReplacement 85 } // namespace HeuristicLab. SGA.Hardwired85 } // namespace HeuristicLab.FixedOperators -
trunk/sources/HeuristicLab.FixedOperators/3.2/FixedSGAMain.cs
r1645 r1646 33 33 using System.Diagnostics; 34 34 35 namespace HeuristicLab. SGA.Hardwired{36 class SGAMainWithHWControllStructures: CombinedOperator {35 namespace HeuristicLab.FixedOperators { 36 class FixedSGAMain : CombinedOperator { 37 37 public override string Description { 38 38 get { return @"Implements the SGAMain with hardwired control structures. Operators are delegated."; } … … 49 49 DoubleData probability; 50 50 51 public SGAMainWithHWControllStructures() 51 long[] timesExecuteCreateChildren; 52 53 public FixedSGAMain() 52 54 : base() { 53 55 AddVariableInfo(new VariableInfo("Selector", "Selection strategy for SGA", typeof(OperatorBase), VariableKind.In)); 54 56 AddVariableInfo(new VariableInfo("MaximumGenerations", "Maximum number of generations to create", typeof(IntData), VariableKind.In)); 55 57 AddVariableInfo(new VariableInfo("Generations", "Number of processed generations", typeof(IntData), VariableKind.In | VariableKind.Out)); 56 Name = "SGAMainWithHWControllStructures"; 57 58 Name = "FixedSGAMain"; 58 59 //InitCreateChildrenHWCS(); 59 60 InitCreateChildrenHW(); … … 96 97 97 98 public override IOperation Apply(IScope scope) { 98 99 Stopwatch swApply = new Stopwatch(); 100 swApply.Start(); 99 101 //base.Apply(scope); // noch nachfragen ob das auch in ordnung wäre 100 102 for (int i = 0; i < SubOperators.Count; i++) { … … 134 136 IntData evaluatedSolutions = GetVariableValue<IntData>("EvaluatedSolutions", scope, true); 135 137 Stopwatch watch = new Stopwatch(); 138 long[] times = new long[10]; 139 timesExecuteCreateChildren = new long[10]; 136 140 for (int i = 0; i < maxGenerations.Data; i++) { 141 watch.Start(); 137 142 selector.Execute(scope); 143 watch.Stop(); 144 times[0] += watch.ElapsedTicks; 145 watch.Reset(); 146 watch.Start(); 147 // if uncomment, adapt constructor 138 148 //createChildren.Execute(scope.SubScopes[1]); 139 149 //ExecuteCreateChildrenHWCS(scope.SubScopes[1]); 140 150 ExecuteCreateChildrenHW(scope.SubScopes[1], evaluatedSolutions); 151 watch.Stop(); 152 times[1] += watch.ElapsedTicks; 153 watch.Reset(); 154 watch.Start(); 141 155 createReplacement.Execute(scope); 156 watch.Stop(); 157 times[2] += watch.ElapsedTicks; 158 watch.Reset(); 159 watch.Start(); 142 160 ql.Execute(scope); 161 watch.Stop(); 162 times[3] += watch.ElapsedTicks; 163 watch.Reset(); 164 watch.Start(); 143 165 bawqc.Execute(scope); 166 watch.Stop(); 167 times[4] += watch.ElapsedTicks; 168 watch.Reset(); 169 watch.Start(); 144 170 dc.Execute(scope); 171 watch.Stop(); 172 times[5] += watch.ElapsedTicks; 173 watch.Reset(); 174 watch.Start(); 145 175 lci.Execute(scope); 176 watch.Stop(); 177 times[6] += watch.ElapsedTicks; 178 watch.Reset(); 179 watch.Start(); 146 180 nrOfGenerations.Data++; 147 181 } 148 182 149 183 swApply.Stop(); 184 Console.WriteLine("SGAMain.Apply(): {0}", swApply.Elapsed); 150 185 return null; 151 186 } // Apply 152 187 188 /// <summary> 189 /// Initializes some variables needed before the execution of create children 190 /// </summary> 191 /// <param name="scope"></param> 153 192 private void InitializeExecuteCreateChildren(IScope scope) { 154 193 crossover = (OperatorBase)GetVariableValue("Crossover", scope, true); … … 180 219 181 220 private void ExecuteCreateChildrenHW(IScope scope, IntData evaluatedSolutions){ 221 //Stopwatch watch = new Stopwatch(); 222 //long[] times = new long[10]; 182 223 // ChildrenInitializer 224 //watch.Start(); 183 225 ci.Apply(scope); 226 //watch.Stop(); 227 //timesExecuteCreateChildren[0] += watch.ElapsedTicks; 228 //watch.Reset(); 184 229 // UniformSequentialSubScopesProcessor 185 230 foreach (IScope s in scope.SubScopes) { 231 //watch.Start(); 186 232 if (crossover.Execute(s) != null) 187 233 throw new InvalidOperationException("ERROR: no support for combined operators!"); 234 //watch.Stop(); 235 //timesExecuteCreateChildren[1] += watch.ElapsedTicks; 236 //watch.Reset(); 237 188 238 189 239 // Stochastic Branch 190 240 if (random.NextDouble() < probability.Data) { 241 //watch.Start(); 191 242 if (mutator.Execute(s) != null) 192 243 throw new InvalidOperationException("ERROR: no support for combined operators!"); 244 //watch.Stop(); 245 //timesExecuteCreateChildren[2] += watch.ElapsedTicks; 246 //watch.Reset(); 247 193 248 } 194 249 250 //watch.Start(); 195 251 if (evaluator.Execute(s) != null) 196 252 throw new InvalidOperationException("ERROR: no support for combined operators!"); 253 //watch.Stop(); 254 //timesExecuteCreateChildren[3] += watch.ElapsedTicks; 255 //watch.Reset(); 197 256 198 257 // subscopes remover 258 //watch.Start(); 199 259 while (s.SubScopes.Count > 0) 200 260 s.RemoveSubScope(s.SubScopes[0]); 261 //watch.Stop(); 262 //timesExecuteCreateChildren[4] += watch.ElapsedTicks; 263 //watch.Reset(); 201 264 202 265 evaluatedSolutions.Data++; … … 204 267 205 268 // sort scopes 206 //bool descending = GetVariableValue<BoolData>("Maximization", scope, true).Data; 207 //double[] keys = new double[scope.SubScopes.Count]; 208 //int[] sequence = new int[keys.Length]; 209 210 //for (int i = 0; i < keys.Length; i++) { 211 // keys[i] = scope.SubScopes[i].GetVariableValue<DoubleData>("Quality", false).Data; 212 // sequence[i] = i; 213 //} 214 215 //Array.Sort<double, int>(keys, sequence); 216 217 //if (descending) { 218 // int temp; 219 // for (int i = 0; i < sequence.Length / 2; i++) { 220 // temp = sequence[i]; 221 // sequence[i] = sequence[sequence.Length - 1 - i]; 222 // sequence[sequence.Length - 1 - i] = temp; 223 // } 224 //} 225 //scope.ReorderSubScopes(sequence); 269 bool descending = GetVariableValue<BoolData>("Maximization", scope, true).Data; 270 271 double[] keys = new double[scope.SubScopes.Count]; 272 int[] sequence = new int[keys.Length]; 273 274 for (int i = 0; i < keys.Length; i++) { 275 keys[i] = scope.SubScopes[i].GetVariableValue<DoubleData>("Quality", false).Data; 276 sequence[i] = i; 277 } 278 279 Array.Sort<double, int>(keys, sequence); 280 281 if (descending) { 282 int temp; 283 for (int i = 0; i < sequence.Length / 2; i++) { 284 temp = sequence[i]; 285 sequence[i] = sequence[sequence.Length - 1 - i]; 286 sequence[sequence.Length - 1 - i] = temp; 287 } 288 } 289 scope.ReorderSubScopes(sequence); 290 //watch.Stop(); 291 //timesExecuteCreateChildren[5] += watch.ElapsedTicks; 292 //watch.Reset(); 226 293 227 294 return; 228 } 229 230 } // class SGAMainWithHWControllStructures231 } // namespace HeuristicLab. SGA.Hardwired295 } // ExecuteCreateChildrenHW 296 297 } // class FixedSGAMain 298 } // namespace HeuristicLab.FixedOperators -
trunk/sources/HeuristicLab.FixedOperators/3.2/HeuristicLab.FixedOperators-3.2.csproj
r1645 r1646 9 9 <OutputType>Library</OutputType> 10 10 <AppDesignerFolder>Properties</AppDesignerFolder> 11 <RootNamespace>HeuristicLab. SGA.Hardwired</RootNamespace>12 <AssemblyName>HeuristicLab. SGA.Hardwired-3.2</AssemblyName>11 <RootNamespace>HeuristicLab.FixedOperators</RootNamespace> 12 <AssemblyName>HeuristicLab.FixedOperators-3.2</AssemblyName> 13 13 <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> 14 14 <FileAlignment>512</FileAlignment> … … 70 70 <Compile Include="CreateReplacement.cs" /> 71 71 <Compile Include="CreateChildrenHardWired.cs" /> 72 <Compile Include="HeuristicLabSGAHardwiredPlugin.cs" /> 72 <Compile Include="FixedSGAMain.cs" /> 73 <Compile Include="HeuristicLabFixedOperatorsPlugin.cs" /> 73 74 <Compile Include="Properties\AssemblyInfo.cs" /> 74 75 <Compile Include="CreateChildren.cs" /> 75 <Compile Include="SGAMainWithHWControllStructures.cs" />76 76 </ItemGroup> 77 77 <ItemGroup> -
trunk/sources/HeuristicLab.FixedOperators/3.2/HeuristicLabFixedOperatorsPlugin.cs
r1645 r1646 25 25 using HeuristicLab.PluginInfrastructure; 26 26 27 namespace HeuristicLab. SGA.Hardwired{27 namespace HeuristicLab.FixedOperators { 28 28 /// <summary> 29 /// Plugin class for HeuristicLab. SGA.Hardwiredplugin.29 /// Plugin class for HeuristicLab.FixedOperators plugin. 30 30 /// </summary> 31 [ClassInfo(Name = "HeuristicLab. SGA.Hardwired-3.2")]32 [PluginFile(Filename = "HeuristicLab. SGA.Hardwired-3.2.dll", Filetype = PluginFileType.Assembly)]31 [ClassInfo(Name = "HeuristicLab.FixedOperators-3.2")] 32 [PluginFile(Filename = "HeuristicLab.FixedOperators-3.2.dll", Filetype = PluginFileType.Assembly)] 33 33 [Dependency(Dependency = "HeuristicLab.Core-3.2")] 34 34 [Dependency(Dependency = "HeuristicLab.Data-3.2")] … … 39 39 [Dependency(Dependency = "HeuristicLab.Logging-3.2")] 40 40 [Dependency(Dependency = "HeuristicLab.SequentialEngine-3.2")] 41 public class HeuristicLab SGAHardwiredPlugin : PluginBase {41 public class HeuristicLabFixedOperatorsPlugin : PluginBase { 42 42 } 43 43 } -
trunk/sources/HeuristicLab.FixedOperators/3.2/Properties/AssemblyInfo.frame
r1576 r1646 28 28 // set of attributes. Change these attribute values to modify the information 29 29 // associated with an assembly. 30 [assembly: AssemblyTitle("HeuristicLab. SGA.Hardwired")]30 [assembly: AssemblyTitle("HeuristicLab.FixedOperators")] 31 31 [assembly: AssemblyDescription("")] 32 32 [assembly: AssemblyConfiguration("")] 33 33 [assembly: AssemblyCompany("FH-Hagenberg")] 34 [assembly: AssemblyProduct("HeuristicLab. SGA.Hardwired")]34 [assembly: AssemblyProduct("HeuristicLab.FixedOperators")] 35 35 [assembly: AssemblyCopyright("Copyright © FH-Hagenberg 2009")] 36 36 [assembly: AssemblyTrademark("")] -
trunk/sources/HeuristicLab.sln
r1629 r1646 161 161 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Tracing-3.2", "HeuristicLab.Tracing\3.2\HeuristicLab.Tracing-3.2.csproj", "{EE2034D9-6E27-48A1-B855-42D45F69A4FC}" 162 162 EndProject 163 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.SGA.Hardwired-3.2", "HeuristicLab.SGA.Hardwired\3.2\HeuristicLab.SGA.Hardwired-3.2.csproj", "{583705E2-B1F7-42B8-8149-96E7AECA171A}"164 EndProject165 163 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Persistence.UnitTest", "HeuristicLab.Persistence\UnitTests\HeuristicLab.Persistence.UnitTest.csproj", "{BF7D9494-A586-457B-8DF9-ED599F9E6A71}" 166 164 EndProject 167 165 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Security.ADODataAccess-3.2", "HeuristicLab.Security.ADODataAccess\3.2\HeuristicLab.Security.ADODataAccess-3.2.csproj", "{FD1AFEC2-7A79-45CF-9365-5195B04A2C9F}" 166 EndProject 167 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.FixedOperators-3.2", "HeuristicLab.FixedOperators\3.2\HeuristicLab.FixedOperators-3.2.csproj", "{583705E2-B1F7-42B8-8149-96E7AECA171A}" 168 168 EndProject 169 169 Global … … 2421 2421 {EE2034D9-6E27-48A1-B855-42D45F69A4FC}.Visualization Debug|x86.ActiveCfg = Debug|x86 2422 2422 {EE2034D9-6E27-48A1-B855-42D45F69A4FC}.Visualization Debug|x86.Build.0 = Debug|x86 2423 {583705E2-B1F7-42B8-8149-96E7AECA171A}.CEDMA Debug|Any CPU.ActiveCfg = Debug|Any CPU2424 {583705E2-B1F7-42B8-8149-96E7AECA171A}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU2425 {583705E2-B1F7-42B8-8149-96E7AECA171A}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU2426 {583705E2-B1F7-42B8-8149-96E7AECA171A}.CEDMA Debug|x86.ActiveCfg = Debug|Any CPU2427 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU2428 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|Any CPU.Build.0 = Debug|Any CPU2429 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|x64.ActiveCfg = Debug|Any CPU2430 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|x86.ActiveCfg = Debug|Any CPU2431 {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|Any CPU.ActiveCfg = Debug|Any CPU2432 {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|Any CPU.Build.0 = Debug|Any CPU2433 {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|x64.ActiveCfg = Debug|Any CPU2434 {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|x86.ActiveCfg = Debug|Any CPU2435 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|Any CPU.ActiveCfg = Release|Any CPU2436 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|Any CPU.Build.0 = Release|Any CPU2437 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|x64.ActiveCfg = Release|Any CPU2438 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|x86.ActiveCfg = Release|Any CPU2439 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|Any CPU.ActiveCfg = Debug|Any CPU2440 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|Any CPU.Build.0 = Debug|Any CPU2441 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|x64.ActiveCfg = Debug|Any CPU2442 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|x86.ActiveCfg = Debug|Any CPU2443 2423 {BF7D9494-A586-457B-8DF9-ED599F9E6A71}.CEDMA Debug|Any CPU.ActiveCfg = Debug|Any CPU 2444 2424 {BF7D9494-A586-457B-8DF9-ED599F9E6A71}.CEDMA Debug|x64.ActiveCfg = Debug|x64 … … 2476 2456 {FD1AFEC2-7A79-45CF-9365-5195B04A2C9F}.Visualization Debug|x64.ActiveCfg = Debug|Any CPU 2477 2457 {FD1AFEC2-7A79-45CF-9365-5195B04A2C9F}.Visualization Debug|x86.ActiveCfg = Debug|Any CPU 2458 {583705E2-B1F7-42B8-8149-96E7AECA171A}.CEDMA Debug|Any CPU.ActiveCfg = Debug|Any CPU 2459 {583705E2-B1F7-42B8-8149-96E7AECA171A}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU 2460 {583705E2-B1F7-42B8-8149-96E7AECA171A}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU 2461 {583705E2-B1F7-42B8-8149-96E7AECA171A}.CEDMA Debug|x86.ActiveCfg = Debug|Any CPU 2462 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 2463 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|Any CPU.Build.0 = Debug|Any CPU 2464 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|x64.ActiveCfg = Debug|Any CPU 2465 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|x86.ActiveCfg = Debug|Any CPU 2466 {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|Any CPU.ActiveCfg = Debug|Any CPU 2467 {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|Any CPU.Build.0 = Debug|Any CPU 2468 {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|x64.ActiveCfg = Debug|Any CPU 2469 {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|x86.ActiveCfg = Debug|Any CPU 2470 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|Any CPU.ActiveCfg = Release|Any CPU 2471 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|Any CPU.Build.0 = Release|Any CPU 2472 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|x64.ActiveCfg = Release|Any CPU 2473 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|x86.ActiveCfg = Release|Any CPU 2474 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|Any CPU.ActiveCfg = Debug|Any CPU 2475 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|Any CPU.Build.0 = Debug|Any CPU 2476 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|x64.ActiveCfg = Debug|Any CPU 2477 {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|x86.ActiveCfg = Debug|Any CPU 2478 2478 EndGlobalSection 2479 2479 GlobalSection(SolutionProperties) = preSolution -
trunk/sources/HeuristicLab/CopyAssemblies.cmd
r1629 r1646 74 74 copy "%SolutionDir%\HeuristicLab.SequentialEngine\3.2\%Outdir%\HeuristicLab.SequentialEngine-3.2.dll" .\plugins 75 75 copy "%SolutionDir%\HeuristicLab.SGA\3.2\%Outdir%\HeuristicLab.SGA-3.2.dll" .\plugins 76 copy "%SolutionDir%\HeuristicLab. SGA.Hardwired\3.3\%Outdir%\HeuristicLab.SGA.Hardwired-3.3.dll" .\plugins76 copy "%SolutionDir%\HeuristicLab.FixedOperators\3.2\%Outdir%\HeuristicLab.FixedOperators-3.2.dll" .\plugins 77 77 copy "%SolutionDir%\HeuristicLab.SimOpt\3.2\%Outdir%\HeuristicLab.SimOpt-3.2.dll" .\plugins 78 78 copy "%SolutionDir%\HeuristicLab.SQLite\3.2\%Outdir%\HeuristicLab.SQLite-3.2.dll" .\plugins
Note: See TracChangeset
for help on using the changeset viewer.