Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1646


Ignore:
Timestamp:
04/24/09 10:16:58 (16 years ago)
Author:
dtraxing
Message:

Renamed HeuristicLab.SGAHardWired Plugin to HeuristicLab.FixedOperators. (ticket #580)

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  
    3131using HeuristicLab.Routing.TSP;
    3232
    33 namespace HeuristicLab.SGA.Hardwired {
     33namespace HeuristicLab.FixedOperators {
    3434  class CreateChildren : OperatorBase {
    3535    ChildrenInitializer ci;
     
    9595    } // Apply
    9696  } // class CreateChildren
    97 } // namespace HeuristicLab.SGA.Hardwired
     97} // namespace HeuristicLab.FixedOperators
  • trunk/sources/HeuristicLab.FixedOperators/3.2/CreateChildrenHardWired.cs

    r1557 r1646  
    3131using HeuristicLab.Routing.TSP;
    3232
    33 namespace HeuristicLab.SGA.Hardwired {
     33namespace HeuristicLab.FixedOperators {
    3434  class CreateChildrenHardWired : OperatorBase {
    3535    ChildrenInitializer ci;
     
    120120    } // Apply
    121121  } // class CreateChildrenHardWired
    122 } // namespace HeuristicLab.SGA.Hardwired
     122} // namespace HeuristicLab.FixedOperators
  • trunk/sources/HeuristicLab.FixedOperators/3.2/CreateReplacement.cs

    r1560 r1646  
    3333using System.Collections;
    3434
    35 namespace HeuristicLab.SGA.Hardwired {
     35namespace HeuristicLab.FixedOperators {
    3636  class CreateReplacement : OperatorBase {
    3737    LeftSelector ls;
     
    8383    } // Apply
    8484  } // class CreateReplacement
    85 } // namespace HeuristicLab.SGA.Hardwired
     85} // namespace HeuristicLab.FixedOperators
  • trunk/sources/HeuristicLab.FixedOperators/3.2/FixedSGAMain.cs

    r1645 r1646  
    3333using System.Diagnostics;
    3434
    35 namespace HeuristicLab.SGA.Hardwired {
    36   class SGAMainWithHWControllStructures : CombinedOperator {
     35namespace HeuristicLab.FixedOperators {
     36  class FixedSGAMain : CombinedOperator {
    3737    public override string Description {
    3838      get { return @"Implements the SGAMain with hardwired control structures. Operators are delegated."; }
     
    4949    DoubleData probability;
    5050
    51     public SGAMainWithHWControllStructures()
     51    long[] timesExecuteCreateChildren;
     52
     53    public FixedSGAMain()
    5254      : base() {
    5355      AddVariableInfo(new VariableInfo("Selector", "Selection strategy for SGA", typeof(OperatorBase), VariableKind.In));
    5456      AddVariableInfo(new VariableInfo("MaximumGenerations", "Maximum number of generations to create", typeof(IntData), VariableKind.In));
    5557      AddVariableInfo(new VariableInfo("Generations", "Number of processed generations", typeof(IntData), VariableKind.In | VariableKind.Out));
    56       Name = "SGAMainWithHWControllStructures";
    57 
     58      Name = "FixedSGAMain";
    5859      //InitCreateChildrenHWCS();
    5960      InitCreateChildrenHW();
     
    9697
    9798    public override IOperation Apply(IScope scope) {
    98 
     99      Stopwatch swApply = new Stopwatch();
     100      swApply.Start();
    99101      //base.Apply(scope); // noch nachfragen ob das auch in ordnung wäre
    100102      for (int i = 0; i < SubOperators.Count; i++) {
     
    134136      IntData evaluatedSolutions = GetVariableValue<IntData>("EvaluatedSolutions", scope, true);
    135137      Stopwatch watch = new Stopwatch();
     138      long[] times = new long[10];
     139      timesExecuteCreateChildren = new long[10];
    136140      for (int i = 0; i < maxGenerations.Data; i++) {
     141          watch.Start();
    137142        selector.Execute(scope);
     143        watch.Stop();
     144        times[0] += watch.ElapsedTicks;
     145        watch.Reset();
     146        watch.Start();
     147        // if uncomment, adapt constructor
    138148        //createChildren.Execute(scope.SubScopes[1]);
    139149        //ExecuteCreateChildrenHWCS(scope.SubScopes[1]);
    140150        ExecuteCreateChildrenHW(scope.SubScopes[1], evaluatedSolutions);
     151        watch.Stop();
     152        times[1] += watch.ElapsedTicks;
     153        watch.Reset();
     154        watch.Start();
    141155        createReplacement.Execute(scope);
     156        watch.Stop();
     157        times[2] += watch.ElapsedTicks;
     158        watch.Reset();
     159        watch.Start();
    142160        ql.Execute(scope);
     161        watch.Stop();
     162        times[3] += watch.ElapsedTicks;
     163        watch.Reset();
     164        watch.Start();
    143165        bawqc.Execute(scope);
     166        watch.Stop();
     167        times[4] += watch.ElapsedTicks;
     168        watch.Reset();
     169        watch.Start();
    144170        dc.Execute(scope);
     171        watch.Stop();
     172        times[5] += watch.ElapsedTicks;
     173        watch.Reset();
     174        watch.Start();
    145175        lci.Execute(scope);
     176        watch.Stop();
     177        times[6] += watch.ElapsedTicks;
     178        watch.Reset();
     179        watch.Start();
    146180        nrOfGenerations.Data++;
    147181      }
    148182
    149      
     183      swApply.Stop();
     184      Console.WriteLine("SGAMain.Apply(): {0}", swApply.Elapsed);
    150185      return null;
    151186    } // Apply
    152187
     188    /// <summary>
     189    /// Initializes some variables needed before the execution of create children
     190    /// </summary>
     191    /// <param name="scope"></param>
    153192    private void InitializeExecuteCreateChildren(IScope scope) {
    154193      crossover = (OperatorBase)GetVariableValue("Crossover", scope, true);
     
    180219
    181220    private void ExecuteCreateChildrenHW(IScope scope, IntData evaluatedSolutions){
     221      //Stopwatch watch = new Stopwatch();
     222      //long[] times = new long[10];
    182223      // ChildrenInitializer
     224      //watch.Start();
    183225      ci.Apply(scope);
     226      //watch.Stop();
     227      //timesExecuteCreateChildren[0] += watch.ElapsedTicks;
     228      //watch.Reset();
    184229      // UniformSequentialSubScopesProcessor
    185230      foreach (IScope s in scope.SubScopes) {
     231        //watch.Start();
    186232        if (crossover.Execute(s) != null)
    187233          throw new InvalidOperationException("ERROR: no support for combined operators!");
     234        //watch.Stop();
     235        //timesExecuteCreateChildren[1] += watch.ElapsedTicks;
     236        //watch.Reset();
     237
    188238
    189239        // Stochastic Branch
    190240        if (random.NextDouble() < probability.Data) {
     241          //watch.Start();
    191242          if (mutator.Execute(s) != null)
    192243            throw new InvalidOperationException("ERROR: no support for combined operators!");
     244          //watch.Stop();
     245          //timesExecuteCreateChildren[2] += watch.ElapsedTicks;
     246          //watch.Reset();
     247
    193248        }
    194249
     250        //watch.Start();
    195251        if (evaluator.Execute(s) != null)
    196252          throw new InvalidOperationException("ERROR: no support for combined operators!");
     253        //watch.Stop();
     254        //timesExecuteCreateChildren[3] += watch.ElapsedTicks;
     255        //watch.Reset();
    197256
    198257        // subscopes remover
     258        //watch.Start();
    199259        while (s.SubScopes.Count > 0)
    200260          s.RemoveSubScope(s.SubScopes[0]);
     261        //watch.Stop();
     262        //timesExecuteCreateChildren[4] += watch.ElapsedTicks;
     263        //watch.Reset();
    201264
    202265        evaluatedSolutions.Data++;
     
    204267
    205268      // 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();
    226293
    227294      return;
    228     }
    229 
    230   } // class SGAMainWithHWControllStructures
    231 } // namespace HeuristicLab.SGA.Hardwired
     295    } // ExecuteCreateChildrenHW
     296
     297  } // class FixedSGAMain
     298} // namespace HeuristicLab.FixedOperators
  • trunk/sources/HeuristicLab.FixedOperators/3.2/HeuristicLab.FixedOperators-3.2.csproj

    r1645 r1646  
    99    <OutputType>Library</OutputType>
    1010    <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>
    1313    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    1414    <FileAlignment>512</FileAlignment>
     
    7070    <Compile Include="CreateReplacement.cs" />
    7171    <Compile Include="CreateChildrenHardWired.cs" />
    72     <Compile Include="HeuristicLabSGAHardwiredPlugin.cs" />
     72    <Compile Include="FixedSGAMain.cs" />
     73    <Compile Include="HeuristicLabFixedOperatorsPlugin.cs" />
    7374    <Compile Include="Properties\AssemblyInfo.cs" />
    7475    <Compile Include="CreateChildren.cs" />
    75     <Compile Include="SGAMainWithHWControllStructures.cs" />
    7676  </ItemGroup>
    7777  <ItemGroup>
  • trunk/sources/HeuristicLab.FixedOperators/3.2/HeuristicLabFixedOperatorsPlugin.cs

    r1645 r1646  
    2525using HeuristicLab.PluginInfrastructure;
    2626
    27 namespace HeuristicLab.SGA.Hardwired {
     27namespace HeuristicLab.FixedOperators {
    2828  /// <summary>
    29   /// Plugin class for HeuristicLab.SGA.Hardwired plugin.
     29  /// Plugin class for HeuristicLab.FixedOperators plugin.
    3030  /// </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)]
    3333  [Dependency(Dependency = "HeuristicLab.Core-3.2")]
    3434  [Dependency(Dependency = "HeuristicLab.Data-3.2")]
     
    3939  [Dependency(Dependency = "HeuristicLab.Logging-3.2")]
    4040  [Dependency(Dependency = "HeuristicLab.SequentialEngine-3.2")]
    41   public class HeuristicLabSGAHardwiredPlugin : PluginBase {
     41  public class HeuristicLabFixedOperatorsPlugin : PluginBase {
    4242  }
    4343}
  • trunk/sources/HeuristicLab.FixedOperators/3.2/Properties/AssemblyInfo.frame

    r1576 r1646  
    2828// set of attributes. Change these attribute values to modify the information
    2929// associated with an assembly.
    30 [assembly: AssemblyTitle("HeuristicLab.SGA.Hardwired")]
     30[assembly: AssemblyTitle("HeuristicLab.FixedOperators")]
    3131[assembly: AssemblyDescription("")]
    3232[assembly: AssemblyConfiguration("")]
    3333[assembly: AssemblyCompany("FH-Hagenberg")]
    34 [assembly: AssemblyProduct("HeuristicLab.SGA.Hardwired")]
     34[assembly: AssemblyProduct("HeuristicLab.FixedOperators")]
    3535[assembly: AssemblyCopyright("Copyright © FH-Hagenberg 2009")]
    3636[assembly: AssemblyTrademark("")]
  • trunk/sources/HeuristicLab.sln

    r1629 r1646  
    161161Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Tracing-3.2", "HeuristicLab.Tracing\3.2\HeuristicLab.Tracing-3.2.csproj", "{EE2034D9-6E27-48A1-B855-42D45F69A4FC}"
    162162EndProject
    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 EndProject
    165163Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Persistence.UnitTest", "HeuristicLab.Persistence\UnitTests\HeuristicLab.Persistence.UnitTest.csproj", "{BF7D9494-A586-457B-8DF9-ED599F9E6A71}"
    166164EndProject
    167165Project("{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}"
     166EndProject
     167Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.FixedOperators-3.2", "HeuristicLab.FixedOperators\3.2\HeuristicLab.FixedOperators-3.2.csproj", "{583705E2-B1F7-42B8-8149-96E7AECA171A}"
    168168EndProject
    169169Global
     
    24212421    {EE2034D9-6E27-48A1-B855-42D45F69A4FC}.Visualization Debug|x86.ActiveCfg = Debug|x86
    24222422    {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 CPU
    2424     {583705E2-B1F7-42B8-8149-96E7AECA171A}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU
    2425     {583705E2-B1F7-42B8-8149-96E7AECA171A}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU
    2426     {583705E2-B1F7-42B8-8149-96E7AECA171A}.CEDMA Debug|x86.ActiveCfg = Debug|Any CPU
    2427     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    2428     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|Any CPU.Build.0 = Debug|Any CPU
    2429     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|x64.ActiveCfg = Debug|Any CPU
    2430     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Debug|x86.ActiveCfg = Debug|Any CPU
    2431     {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|Any CPU.ActiveCfg = Debug|Any CPU
    2432     {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|Any CPU.Build.0 = Debug|Any CPU
    2433     {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|x64.ActiveCfg = Debug|Any CPU
    2434     {583705E2-B1F7-42B8-8149-96E7AECA171A}.GP Debug|x86.ActiveCfg = Debug|Any CPU
    2435     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|Any CPU.ActiveCfg = Release|Any CPU
    2436     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|Any CPU.Build.0 = Release|Any CPU
    2437     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|x64.ActiveCfg = Release|Any CPU
    2438     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Release|x86.ActiveCfg = Release|Any CPU
    2439     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|Any CPU.ActiveCfg = Debug|Any CPU
    2440     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|Any CPU.Build.0 = Debug|Any CPU
    2441     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|x64.ActiveCfg = Debug|Any CPU
    2442     {583705E2-B1F7-42B8-8149-96E7AECA171A}.Visualization Debug|x86.ActiveCfg = Debug|Any CPU
    24432423    {BF7D9494-A586-457B-8DF9-ED599F9E6A71}.CEDMA Debug|Any CPU.ActiveCfg = Debug|Any CPU
    24442424    {BF7D9494-A586-457B-8DF9-ED599F9E6A71}.CEDMA Debug|x64.ActiveCfg = Debug|x64
     
    24762456    {FD1AFEC2-7A79-45CF-9365-5195B04A2C9F}.Visualization Debug|x64.ActiveCfg = Debug|Any CPU
    24772457    {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
    24782478  EndGlobalSection
    24792479  GlobalSection(SolutionProperties) = preSolution
  • trunk/sources/HeuristicLab/CopyAssemblies.cmd

    r1629 r1646  
    7474copy "%SolutionDir%\HeuristicLab.SequentialEngine\3.2\%Outdir%\HeuristicLab.SequentialEngine-3.2.dll" .\plugins
    7575copy "%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" .\plugins
     76copy "%SolutionDir%\HeuristicLab.FixedOperators\3.2\%Outdir%\HeuristicLab.FixedOperators-3.2.dll" .\plugins
    7777copy "%SolutionDir%\HeuristicLab.SimOpt\3.2\%Outdir%\HeuristicLab.SimOpt-3.2.dll" .\plugins
    7878copy "%SolutionDir%\HeuristicLab.SQLite\3.2\%Outdir%\HeuristicLab.SQLite-3.2.dll" .\plugins
Note: See TracChangeset for help on using the changeset viewer.