Ignore:
Timestamp:
01/31/18 18:14:33 (4 years ago)
Author:
abeham
Message:

#1614:

  • Changed performance measure to stopwatch instead of datetime for precision reasons
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1614_GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/CPLEX/CplexSolver.cs

    r15698 r15700  
    2222using System;
    2323using System.Threading;
    24 using HeuristicLab.Analysis;
    2524using HeuristicLab.Common;
    2625using HeuristicLab.Core;
     
    2827using HeuristicLab.Encodings.IntegerVectorEncoding;
    2928using HeuristicLab.Optimization;
    30 using HeuristicLab.Parameters;
    3129using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3230using ILOG.CPLEX;
     
    5048    }
    5149
    52     [Storable]
    53     private ValueParameter<DateTimeValue> lastUpdateTimeParameter;
    54     public IValueParameter<DateTimeValue> LastUpdateTimeParameter {
    55       get { return lastUpdateTimeParameter; }
    56     }
    57 
    5850    [StorableConstructor]
    5951    protected CplexSolver(bool deserializing) : base(deserializing) { }
    6052    protected CplexSolver(CplexSolver original, Cloner cloner)
    6153    : base(original, cloner) {
    62       lastUpdateTimeParameter = cloner.Clone(original.lastUpdateTimeParameter);
    6354    }
    6455    public CplexSolver() {
    6556      Problem = new GQAP();
    66       Parameters.Add(lastUpdateTimeParameter = new ValueParameter<DateTimeValue>("LastUpdateTime", "") { Hidden = true });
    67       var qpc = new QualityPerClockAnalyzer();
    68       qpc.LastUpdateTimeParameter.ActualName = LastUpdateTimeParameter.Name;
    69       ((MultiAnalyzer)Analyzer).AddOperator(qpc);
    7057    }
    7158
    7259    protected override void Run(CancellationToken cancellationToken) {
     60      base.Run(cancellationToken);
    7361      var factory = new OplFactory();
    7462      var cplex = factory.CreateCplex();
     
    8068        opl.AddDataSource(dataSource);
    8169        opl.Generate();
    82         LastUpdateTimeParameter.Value = new DateTimeValue(DateTime.UtcNow);
    8370        cplex.Solve();
    8471        cplex.End();
Note: See TracChangeset for help on using the changeset viewer.