Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/31/18 14:01:55 (7 years ago)
Author:
abeham
Message:

#1614: Added random search and fixed execution time counting for commercial solvers

File:
1 edited

Legend:

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

    r15634 r15698  
    2828using HeuristicLab.Encodings.IntegerVectorEncoding;
    2929using HeuristicLab.Optimization;
     30using HeuristicLab.Parameters;
    3031using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3132using ILOG.CPLEX;
     
    4950    }
    5051
     52    [Storable]
     53    private ValueParameter<DateTimeValue> lastUpdateTimeParameter;
     54    public IValueParameter<DateTimeValue> LastUpdateTimeParameter {
     55      get { return lastUpdateTimeParameter; }
     56    }
     57
    5158    [StorableConstructor]
    5259    protected CplexSolver(bool deserializing) : base(deserializing) { }
    5360    protected CplexSolver(CplexSolver original, Cloner cloner)
    5461    : base(original, cloner) {
     62      lastUpdateTimeParameter = cloner.Clone(original.lastUpdateTimeParameter);
    5563    }
    5664    public CplexSolver() {
    5765      Problem = new GQAP();
    58       ((MultiAnalyzer)Analyzer).AddOperator(new QualityPerClockAnalyzer());
     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);
    5970    }
    6071
     
    6980        opl.AddDataSource(dataSource);
    7081        opl.Generate();
     82        LastUpdateTimeParameter.Value = new DateTimeValue(DateTime.UtcNow);
    7183        cplex.Solve();
    7284        cplex.End();
Note: See TracChangeset for help on using the changeset viewer.