Files
ortools-clone/examples/cpp/fap_model_printer.h

57 lines
1.8 KiB
C
Raw Normal View History

// Copyright 2010-2025 Google LLC
2012-09-13 16:25:28 +00:00
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
2016-10-05 14:08:27 +02:00
2012-09-13 16:25:28 +00:00
//
// Prints a model of Frequency Assignment Problem.
// Format: http://www.inra.fr/mia/T/schiex/Doc/CELAR.shtml#synt
//
#ifndef OR_TOOLS_EXAMPLES_FAP_MODEL_PRINTER_H_
#define OR_TOOLS_EXAMPLES_FAP_MODEL_PRINTER_H_
2018-11-23 08:52:59 +01:00
#include <string>
2012-09-13 16:25:28 +00:00
#include <vector>
#include "absl/container/btree_map.h"
#include "examples/cpp/fap_parser.h"
2012-09-13 16:25:28 +00:00
namespace operations_research {
2016-10-05 14:08:27 +02:00
// Prints the instance of the Frequency Assignment Problem.
2012-09-13 16:25:28 +00:00
class FapModelPrinter {
2020-10-22 23:36:58 +02:00
public:
FapModelPrinter(const absl::btree_map<int, FapVariable>& variables,
2020-10-29 14:25:39 +01:00
const std::vector<FapConstraint>& constraints,
absl::string_view objective, const std::vector<int>& values);
2025-01-06 13:20:57 +01:00
// This type is neither copyable nor movable.
FapModelPrinter(const FapModelPrinter&) = delete;
FapModelPrinter& operator=(const FapModelPrinter&) = delete;
2012-09-13 16:25:28 +00:00
~FapModelPrinter();
void PrintFapObjective();
void PrintFapVariables();
void PrintFapConstraints();
void PrintFapValues();
2020-10-22 23:36:58 +02:00
private:
const absl::btree_map<int, FapVariable> variables_;
2012-09-13 16:25:28 +00:00
const std::vector<FapConstraint> constraints_;
2016-10-05 14:08:27 +02:00
const std::string objective_;
2012-09-13 16:25:28 +00:00
const std::vector<int> values_;
};
2020-10-22 23:36:58 +02:00
} // namespace operations_research
#endif // OR_TOOLS_EXAMPLES_FAP_MODEL_PRINTER_H_