Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/31/11 11:52:11 (13 years ago)
Author:
abeham
Message:

#1628

  • Updated branch from trunk
  • Changed ReferenceEqualityComparer<T> to become a non-generic class (generic implementation probably was only made because of lacking support for co- and contravariance in C# 3.5)
  • Added finished experiment from sample algorithms to the tests
  • Wrote a unit test to instantiate every IDeepCloneable type, clone it and compare the objects in the object graph for equal references
  • Wrote a unit test to load the experiment, clone it and compare again the objects in the object graph
  • Preliminary fix for a potential bug in ThreadSafeLog
  • Preliminary fix for a potential bug in OperatorGraphVisualizationInfo
  • Preliminary fix for a potential bug in Calculator (and added license headers)
  • Preliminary fix for a potential bug in ScrambleMove
Location:
branches/GeneralizedQAP
Files:
7 edited
8 copied

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP

  • branches/GeneralizedQAP/HeuristicLab.Optimization/3.3/Calculator.cs

    r6684 r6685  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    3 using System.Drawing;
     24using System.Globalization;
    425using System.Linq;
    526using System.Text.RegularExpressions;
     
    728using HeuristicLab.Core;
    829using HeuristicLab.Data;
    9 using HeuristicLab.Parameters;
    1030using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    11 using System.Globalization;
    1231
    13 namespace HeuristicLab.Optimization { 
    14    
     32namespace HeuristicLab.Optimization {
     33
    1534  [StorableClass]
    1635  public class Calculator : IDeepCloneable {
    1736
    1837    #region Fields & Properties
    19    
     38
    2039    private List<string> tokens;
    2140
     
    2645    }
    2746
    28     private static readonly Regex TokenRegex = new Regex(@"[a-zA-Z0-9._]+|""([^""]|\"")+""|[-+*/^]|log");   
     47    private static readonly Regex TokenRegex = new Regex(@"[a-zA-Z0-9._]+|""([^""]|\"")+""|[-+*/^]|log");
    2948
    3049    #endregion
     
    3655    public Calculator() { }
    3756    public Calculator(Calculator original, Cloner cloner) {
    38       this.tokens = original.tokens.ToList();
     57      if (original.tokens != null)
     58        this.tokens = original.tokens.ToList();
    3959    }
    4060    public IDeepCloneable Clone(Cloner cloner) {
     
    101121      if (stack.Count != 1)
    102122        return new StringValue("Invalid final evaluation stack size != 1");
    103       return new DoubleValue(stack.Pop());     
    104     }   
     123      return new DoubleValue(stack.Pop());
     124    }
    105125  }
    106126}
  • branches/GeneralizedQAP/HeuristicLab.Optimization/3.3/HeuristicLab.Optimization-3.3.csproj

    r6042 r6685  
    111111  </ItemGroup>
    112112  <ItemGroup>
     113    <Compile Include="RunCollectionSorter.cs" />
     114    <Compile Include="RunCollectionValueRemover.cs" />
     115    <Compile Include="IRunCollectionModifier.cs" />
    113116    <None Include="HeuristicLabOptimizationPlugin.cs.frame" />
    114117    <Compile Include="Algorithms\Algorithm.cs" />
    115118    <Compile Include="BatchRun.cs" />
     119    <Compile Include="Calculator.cs" />
    116120    <Compile Include="Interfaces\IDiscreteDoubleMatrixModifier.cs" />
    117121    <Compile Include="Algorithms\HeuristicOptimizationEngineAlgorithm.cs" />
     
    136140    <Compile Include="Interfaces\ISingleObjectiveHeuristicOptimizationProblem.cs" />
    137141    <Compile Include="Problems\Problem.cs" />
     142    <Compile Include="RunCollectionFormulaModifer.cs" />
     143    <Compile Include="RunCollectionFuzzifier.cs" />
     144    <Compile Include="RunCollectionModificationEvaluator.cs" />
    138145    <Compile Include="RunCollectionConstraints\RunCollectionComparisonConstraint.cs" />
    139146    <Compile Include="RunCollectionConstraints\RunCollectionConstraintCollection.cs" />
     147    <Compile Include="RunCollectionConstraints\RunCollectionContentConstraint.cs" />
    140148    <Compile Include="RunCollectionConstraints\RunCollectionTypeCompatiblityConstraint.cs" />
    141149    <Compile Include="RunCollectionConstraints\RunCollectionEqualityConstraint.cs" />
     
    244252    </BootstrapperPackage>
    245253  </ItemGroup>
     254  <ItemGroup />
    246255  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    247256  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/GeneralizedQAP/HeuristicLab.Optimization/3.3/Problems/SingleObjectiveHeuristicOptimizationProblem.cs

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/GeneralizedQAP/HeuristicLab.Optimization/3.3/RunCollectionConstraints/IRunCollectionConstraint.cs

    r5445 r6685  
    2626  public interface IRunCollectionConstraint : IConstraint {
    2727    new RunCollection ConstrainedValue { get; set; }
     28  }
     29
     30  public interface IRunCollectionColumnConstraint : IRunCollectionConstraint {
    2831    string ConstraintColumn { get; set; }
    2932    event EventHandler ConstraintColumnChanged;
  • branches/GeneralizedQAP/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionComparisonConstraint.cs

    r5445 r6685  
    3030  [StorableClass]
    3131  [Item("RunCollectionComparisonConstraint", "A constraint which compares the members of the contained runs with the constraint data.")]
    32   public class RunCollectionComparisonConstraint : ComparisonConstraint, IRunCollectionConstraint {
     32  public class RunCollectionComparisonConstraint : ComparisonConstraint, IRunCollectionColumnConstraint {
    3333    [StorableConstructor]
    3434    protected RunCollectionComparisonConstraint(bool deserializing) : base(deserializing) { }
  • branches/GeneralizedQAP/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionEqualityConstraint.cs

    r5445 r6685  
    3030  [StorableClass]
    3131  [Item("RunCollectionEqualityConstraint", "A constraint which checks the members of the contained runs for equality to the constraint data.")]
    32   public class RunCollectionEqualityConstraint : EqualityConstraint, IRunCollectionConstraint {
     32  public class RunCollectionEqualityConstraint : EqualityConstraint, IRunCollectionColumnConstraint {
    3333    [StorableConstructor]
    3434    protected RunCollectionEqualityConstraint(bool deserializing) : base(deserializing) { }
     
    100100      foreach (IRun run in ConstrainedValue.Where(r => r.Visible)) {
    101101        IItem item = ConstrainedValue.GetValue(run, constraintColumn);
    102         if (!base.Check(item.ToString()))
     102        if (item != null && !base.Check(item.ToString()))
    103103          run.Visible = false;
    104104      }
  • branches/GeneralizedQAP/HeuristicLab.Optimization/3.3/RunCollectionConstraints/RunCollectionTypeCompatiblityConstraint.cs

    r5445 r6685  
    3030  [StorableClass]
    3131  [Item("RunCollectionTypeCompatibilityConstraint", "A constraint which checks the members of the contained runs for type compabitiliby to the constraint data.")]
    32   public class RunCollectionTypeCompatibilityConstraint : TypeCompatibilityConstraint, IRunCollectionConstraint {
     32  public class RunCollectionTypeCompatibilityConstraint : TypeCompatibilityConstraint, IRunCollectionColumnConstraint {
    3333    [StorableConstructor]
    3434    protected RunCollectionTypeCompatibilityConstraint(bool deserializing) {
Note: See TracChangeset for help on using the changeset viewer.