MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / syncedOptionsMatch

Method syncedOptionsMatch

MiniZincIDE/solver.cpp:620–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620bool SolverConfiguration::syncedOptionsMatch(const SolverConfiguration& sc) const
621{
622 if (isBuiltin || sc.isBuiltin) {
623 // Built-in configs always can have their options overidden
624 return true;
625 }
626
627 if (timeLimit != sc.timeLimit) {
628 return false;
629 }
630
631 if ((supports("-a") || supports("-i")) &&
632 (sc.supports("-a") || sc.supports("-i")) &&
633 printIntermediate != sc.printIntermediate) {
634 return false;
635 }
636
637 if (supports("-n") && sc.supports("-n") &&
638 (numSolutions > 0 || sc.numSolutions > 0) &&
639 numSolutions != sc.numSolutions) {
640 return false;
641 }
642
643 if (supports("-a") && sc.supports("-a") &&
644 (numSolutions == 0 || sc.numSolutions == 0) &&
645 numSolutions != sc.numSolutions) {
646 return false;
647 }
648
649 if (supports("-n-o") && sc.supports("-n-o") &&
650 (numOptimal > 0 || sc.numOptimal > 0) &&
651 numOptimal != sc.numOptimal) {
652 return false;
653 }
654
655 if (supports("-a-o") && sc.supports("-a-o") &&
656 (numOptimal == 0 || sc.numOptimal == 0) &&
657 numOptimal != sc.numOptimal) {
658 return false;
659 }
660
661 if (verboseCompilation != sc.verboseCompilation) {
662 return false;
663 }
664
665 if (supports("-v") && sc.supports("-v") &&
666 verboseSolving != sc.verboseSolving) {
667 return false;
668 }
669
670 if (compilationStats != sc.compilationStats) {
671 return false;
672 }
673
674 if (supports("-s") && sc.supports("-s") &&
675 solvingStats != sc.solvingStats) {
676 return false;
677 }

Callers 1

addConfigMethod · 0.80

Calls 1

supportsMethod · 0.80

Tested by

no test coverage detected