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

Method toJSONObject

MiniZincIDE/solver.cpp:546–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546QJsonObject SolverConfiguration::toJSONObject(void) const
547{
548 QJsonObject config;
549 config["solver"] = solver;
550 if (timeLimit > 0) {
551 config["time-limit"] = timeLimit;
552 }
553 if ((supports("-a") || supports("-i"))) {
554 config["intermediate-solutions"] = printIntermediate;
555 }
556 if (numSolutions > 1 && supports("-n")) {
557 config["num-solutions"] = numSolutions;
558 }
559 if (numSolutions == 0 && supports("-a")) {
560 config["all-satisfaction"] = true;
561 }
562 if (numOptimal > 1 && supports("-n-o")) {
563 config["num-optimal"] = numOptimal;
564 }
565 if (numOptimal == 0 && supports("-a-o")) {
566 config["all-optimal"] = true;
567 }
568 if (verboseCompilation) {
569 config["verbose-compilation"] = verboseCompilation;
570 }
571 if (verboseSolving && supports("-v")) {
572 config["verbose-solving"] = verboseSolving;
573 }
574 if (compilationStats) {
575 config["compiler-statistics"] = compilationStats;
576 }
577 if (solvingStats && supports("-s")) {
578 config["solver-statistics"] = solvingStats;
579 }
580 if (outputTiming) {
581 config["output-time"] = outputTiming;
582 }
583 if (outputObjective && (solverDefinition.inputType != Solver::I_MZN || supports("--output-objective"))) {
584 config["output-objective"] = true;
585 }
586 if (optimizationLevel != 1) {
587 config["-O"] = optimizationLevel;
588 }
589 QJsonArray arr;
590 for (auto& d : additionalData) {
591 arr.push_back(d);
592 }
593 if (arr.size() > 0) {
594 config["cmdline-data"] = arr;
595 }
596 if (numThreads > 1 && supports("-p")) {
597 config["parallel"] = numThreads;
598 }
599 if (!randomSeed.isNull() && supports("-r")) {
600 config["random-seed"] = QJsonValue::fromVariant(randomSeed);
601 }
602 if (freeSearch && supports("-f")) {
603 config["free-search"] = freeSearch;

Callers 1

StashItemMethod · 0.80

Calls 5

containsMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected