Esempio n. 1
0
        public void CalcLexMinCostMaxSoft(out double minCost, out int maxSoftConsViol, out int minCostBound)
        {
            StartLogging();
            Console.WriteLine("Finding Lexicogrpahic:  Min Cost -> Min Soft cost");

            _model.SetObjective(0, 1);
            _model.Optimize(Timelimit * ExtraTimeOnCornerPointsMultiplier, MIPGap);

            minCost      = _model.Objective;
            minCostBound = (int)Math.Ceiling(_model.ObjBound);

            if (UseSpecificObjConstraints)
            {
                _model.FixsolRooms(true);
            }

            _model.SetBudgetConstraint(minCost);

            _model.SetObjective(1, 0);
            _model.Optimize(Timelimit * ExtraTimeOnCornerPointsMultiplier, MIPGap);
            //            sol.SetAssignments(model.GetAssignments());
            //            Console.WriteLine(sol.AnalyzeSolution());

            maxSoftConsViol = _model.ObjSoftCons;
            _multiResults.Add(new MultiResult(_model.ObjCost, _model.ObjSoftCons, minCostBound, (int)Math.Ceiling(_model.ObjBound), _model.GetUsedRooms(), _model.GetAssignments(), minCost, null, (int)_stopwatch.Elapsed.TotalSeconds));

            AddAllSolutions(_model);
            _model.SetBudgetConstraint();

            //  model.FixsolRooms(false);
        }