Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/19/18 09:05:35 (7 years ago)
Author:
abeham
Message:

#1614: changed localsolver algorithms to run analyzer at the end

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Algorithms/3.3/LocalSolverNet/GQAPBinarySolver.cs

    r15575 r15633  
    196196      model.Minimize(obj);
    197197
    198       model.Close();
    199 
    200       // Parameterizes the solver.
    201       LSPhase phase = localSolver.CreatePhase();
    202       phase.SetTimeLimit((int)Math.Ceiling(MaximumRuntime.TotalSeconds));
    203 
    204       localSolver.AddCallback(LSCallbackType.IterationTicked, LocalSolverOnIterationTicked);
    205      
    206       localSolver.Solve();
    207 
    208       localSolver.RemoveCallback(LSCallbackType.IterationTicked, LocalSolverOnIterationTicked);
    209       localSolver.Dispose();
     198      try {
     199        model.Close();
     200
     201        // Parameterizes the solver.
     202        LSPhase phase = localSolver.CreatePhase();
     203        phase.SetTimeLimit((int)Math.Ceiling(MaximumRuntime.TotalSeconds));
     204
     205        localSolver.AddCallback(LSCallbackType.IterationTicked, LocalSolverOnIterationTicked);
     206
     207        localSolver.Solve();
     208
     209        localSolver.RemoveCallback(LSCallbackType.IterationTicked, LocalSolverOnIterationTicked);
     210      } finally {
     211        localSolver.Dispose();
     212      }
     213
     214      Context.RunOperator(Analyzer, CancellationToken.None);
    210215    }
    211216  }
Note: See TracChangeset for help on using the changeset viewer.