/// <summary> /// Initializes a new instance of the <see cref="GurobiRuntimeFeatures" /> class. /// </summary> /// <param name="timeStamp">The time stamp.</param> public GurobiRuntimeFeatures(DateTime timeStamp) { this._immutableTimeSinceLastCallback = null; this.TimeStampOfLastEditing = timeStamp; this.BestObjective = double.NaN; this.BestObjectiveBound = double.NaN; this.FeasibleSolutionsCount = 0; this.ExploredNodeCount = 0; this.UnexploredNodeCount = 0; this.BarrierIterationsCount = 0; this.SimplexIterationsCount = 0; this.CuttingPlanesCount = 0; this.MipGap = GurobiUtils.GetMipGap(double.NaN, double.NaN); this.PreSolveRemovedRows = 0; this.PreSolveRemovedColumns = 0; this.PreSolveConstraintChanges = 0; this.PreSolveBoundChanges = 0; this.PreSolveCoefficientChanges = 0; }
public void GetMipGapReturnsCorrectResult(double bestObjective, double bestObjectiveBound, double expectedResult) { var actualResult = GurobiUtils.GetMipGap(bestObjective, bestObjectiveBound); actualResult.ShouldBe(expectedResult); }