14#ifndef OR_TOOLS_FLATZINC_MODEL_H_
15#define OR_TOOLS_FLATZINC_MODEL_H_
20#include "absl/container/flat_hash_map.h"
118 bool Merge(
const std::string& other_name,
const Domain& other_domain,
119 bool other_temporary);
254 std::vector<Annotation> args);
299 const std::string&
name, std::vector<Bounds>
bounds,
318 : name_(
name), objective_(nullptr), maximize_(true) {}
329 void AddConstraint(
const std::string&
id, std::vector<Argument> arguments,
331 void AddConstraint(
const std::string&
id, std::vector<Argument> arguments);
347 const std::vector<IntegerVariable*>&
variables()
const {
return variables_; }
348 const std::vector<Constraint*>&
constraints()
const {
return constraints_; }
350 return search_annotations_;
357 const std::vector<SolutionOutputSpecs>&
output()
const {
return output_; }
370 const std::string&
name()
const {
return name_; }
373 const std::string name_;
376 std::vector<IntegerVariable*> variables_;
379 std::vector<Constraint*> constraints_;
384 std::vector<Annotation> search_annotations_;
385 std::vector<SolutionOutputSpecs> output_;
394 return constraints_per_variables_[
var].size();
401 std::map<std::string, std::vector<Constraint*>> constraints_per_type_;
402 absl::flat_hash_map<const IntegerVariable*, std::vector<Constraint*>>
403 constraints_per_variables_;
util::MutableVectorIteration< SolutionOutputSpecs > mutable_output()
IntegerVariable * AddVariable(const std::string &name, const Domain &domain, bool defined)
const std::string & name() const
const std::vector< Annotation > & search_annotations() const
const std::vector< SolutionOutputSpecs > & output() const
Model(const std::string &name)
void Satisfy(std::vector< Annotation > search_annotations)
void Maximize(IntegerVariable *obj, std::vector< Annotation > search_annotations)
std::string DebugString() const
const std::vector< IntegerVariable * > & variables() const
IntegerVariable * objective() const
void AddOutput(SolutionOutputSpecs output)
void SetObjective(IntegerVariable *obj)
util::MutableVectorIteration< Annotation > mutable_search_annotations()
IntegerVariable * AddConstant(int64 value)
void AddConstraint(const std::string &id, std::vector< Argument > arguments, bool is_domain)
void Minimize(IntegerVariable *obj, std::vector< Annotation > search_annotations)
bool IsInconsistent() const
const std::vector< Constraint * > & constraints() const
void PrintStatistics() const
int NumVariableOccurrences(IntegerVariable *var)
ModelStatistics(const Model &model)
void FlattenAnnotations(const Annotation &ann, std::vector< Annotation > *out)
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
static Annotation IntegerValue(int64 value)
std::vector< IntegerVariable * > variables
static Annotation Variable(IntegerVariable *const var)
std::string DebugString() const
static Annotation FunctionCall(const std::string &id)
static Annotation AnnotationList(std::vector< Annotation > list)
static Annotation String(const std::string &str)
static Annotation Identifier(const std::string &id)
bool IsFunctionCallWithIdentifier(const std::string &identifier) const
std::vector< Annotation > annotations
static Annotation Empty()
static Annotation Interval(int64 interval_min, int64 interval_max)
void AppendAllIntegerVariables(std::vector< IntegerVariable * > *vars) const
static Annotation FunctionCallWithArguments(const std::string &id, std::vector< Annotation > args)
static Annotation VariableList(std::vector< IntegerVariable * > variables)
int64 ValueAt(int pos) const
IntegerVariable * Var() const
static Argument DomainList(std::vector< Domain > domains)
std::vector< IntegerVariable * > variables
IntegerVariable * VarAt(int pos) const
static Argument VoidArgument()
static Argument Interval(int64 imin, int64 imax)
static Argument IntVarRefArray(std::vector< IntegerVariable * > vars)
std::string DebugString() const
static Argument IntegerList(std::vector< int64 > values)
bool Contains(int64 value) const
std::vector< Domain > domains
std::vector< int64 > values
static Argument IntVarRef(IntegerVariable *const var)
bool IsArrayOfValues() const
static Argument FromDomain(const Domain &domain)
static Argument IntegerValue(int64 value)
Constraint(const std::string &t, std::vector< Argument > args, bool strong_propag)
bool presolve_propagation_done
void RemoveArg(int arg_pos)
std::string DebugString() const
std::vector< Argument > arguments
bool OverlapsIntList(const std::vector< int64 > &vec) const
static Domain IntegerList(std::vector< int64 > values)
static Domain EmptyDomain()
bool IntersectWithSingleton(int64 value)
static Domain SetOfIntegerValue(int64 value)
bool OverlapsDomain(const Domain &other) const
static Domain SetOfAllInt64()
static Domain SetOfIntegerList(std::vector< int64 > values)
bool IntersectWithInterval(int64 interval_min, int64 interval_max)
bool RemoveValue(int64 value)
std::string DebugString() const
static Domain Interval(int64 included_min, int64 included_max)
bool IntersectWithListOfIntegers(const std::vector< int64 > &integers)
bool IntersectWithDomain(const Domain &domain)
bool Contains(int64 value) const
bool OverlapsIntInterval(int64 lb, int64 ub) const
static Domain SetOfBoolean()
static Domain SetOfInterval(int64 included_min, int64 included_max)
static Domain IntegerValue(int64 value)
std::vector< int64 > values
std::string DebugString() const
bool Merge(const std::string &other_name, const Domain &other_domain, bool other_temporary)
std::string DebugString() const
Bounds(int64 min_value_, int64 max_value_)
static SolutionOutputSpecs MultiDimensionalArray(const std::string &name, std::vector< Bounds > bounds, std::vector< IntegerVariable * > flat_variables, bool display_as_boolean)
std::vector< IntegerVariable * > flat_variables
static SolutionOutputSpecs VoidOutput()
std::string DebugString() const
IntegerVariable * variable
std::vector< Bounds > bounds
static SolutionOutputSpecs SingleVariable(const std::string &name, IntegerVariable *variable, bool display_as_boolean)