Code cleanup of cpp examples.
This commit is contained in:
@@ -100,7 +100,7 @@ class OrderedLNS : public BaseLNS {
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool NextFragment(std::vector<int>* const fragment) {
|
||||
bool NextFragment(std::vector<int>* const fragment) override {
|
||||
int dim = Size();
|
||||
std::set<int> fragment_set;
|
||||
|
||||
@@ -146,7 +146,7 @@ class RandomLNS : public BaseLNS {
|
||||
free_elements_(free_elements),
|
||||
rand_(ACMRandom::HostnamePidTimeSeed()) {}
|
||||
|
||||
virtual bool NextFragment(std::vector<int>* const fragment) {
|
||||
bool NextFragment(std::vector<int>* const fragment) override {
|
||||
std::vector<int> weighted_elements;
|
||||
std::vector<int64> values;
|
||||
|
||||
|
||||
@@ -272,8 +272,7 @@ int main(int argc, char** argv) {
|
||||
const int64 kStopTime = 300;
|
||||
const int64 kHorizon = 24 * 3600;
|
||||
StopServiceTimePlusTransition time(
|
||||
kStopTime,
|
||||
locations,
|
||||
kStopTime, locations,
|
||||
NewPermanentCallback(&locations, &LocationContainer::ManhattanTime));
|
||||
routing.AddDimension(
|
||||
NewPermanentCallback(&time, &StopServiceTimePlusTransition::Compute),
|
||||
@@ -284,8 +283,7 @@ int main(int argc, char** argv) {
|
||||
const int64 kTWDuration = 5 * 3600;
|
||||
for (int stop = 0; stop < FLAGS_vrp_stops; ++stop) {
|
||||
const int64 start = randomizer.Uniform(kHorizon - kTWDuration);
|
||||
for (int stop_order = 0;
|
||||
stop_order < FLAGS_vrp_orders_per_stop;
|
||||
for (int stop_order = 0; stop_order < FLAGS_vrp_orders_per_stop;
|
||||
++stop_order) {
|
||||
const int order = stop * FLAGS_vrp_orders_per_stop + stop_order + 1;
|
||||
routing.CumulVar(order, kTime)->SetRange(start, start + kTWDuration);
|
||||
@@ -297,21 +295,18 @@ int main(int argc, char** argv) {
|
||||
std::vector<IntervalVar*> intervals;
|
||||
for (int stop = 0; stop < FLAGS_vrp_stops; ++stop) {
|
||||
std::vector<IntervalVar*> stop_intervals;
|
||||
for (int stop_order = 0;
|
||||
stop_order < FLAGS_vrp_orders_per_stop;
|
||||
for (int stop_order = 0; stop_order < FLAGS_vrp_orders_per_stop;
|
||||
++stop_order) {
|
||||
const int order = stop * FLAGS_vrp_orders_per_stop + stop_order + 1;
|
||||
IntervalVar* const interval =
|
||||
solver->MakeFixedDurationIntervalVar(
|
||||
0, kHorizon, kStopTime, true, StrCat("Order", order));
|
||||
IntervalVar* const interval = solver->MakeFixedDurationIntervalVar(
|
||||
0, kHorizon, kStopTime, true, StrCat("Order", order));
|
||||
intervals.push_back(interval);
|
||||
stop_intervals.push_back(interval);
|
||||
// Link order and interval.
|
||||
IntVar* const order_start = routing.CumulVar(order, kTime);
|
||||
solver->AddConstraint(solver->MakeIsEqualCt(
|
||||
interval->SafeStartExpr(0),
|
||||
order_start,
|
||||
interval->PerformedExpr()->Var()));
|
||||
solver->AddConstraint(
|
||||
solver->MakeIsEqualCt(interval->SafeStartExpr(0), order_start,
|
||||
interval->PerformedExpr()->Var()));
|
||||
// Make interval performed iff corresponding order has service time.
|
||||
// An order has no service time iff it is at the same location as the
|
||||
// next order on the route.
|
||||
@@ -330,12 +325,11 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
// Only one order can happen at the same time at a given location.
|
||||
std::vector<int64> location_usage(stop_intervals.size(), 1);
|
||||
solver->AddConstraint(
|
||||
solver->MakeCumulative(
|
||||
stop_intervals, location_usage, 1, StrCat("Client", stop)));
|
||||
solver->AddConstraint(solver->MakeCumulative(stop_intervals, location_usage,
|
||||
1, StrCat("Client", stop)));
|
||||
}
|
||||
// Minimizing route duration.
|
||||
for (int vehicle = 0 ; vehicle < routing.vehicles(); ++vehicle) {
|
||||
for (int vehicle = 0; vehicle < routing.vehicles(); ++vehicle) {
|
||||
routing.AddVariableMinimizedByFinalizer(
|
||||
routing.CumulVar(routing.End(vehicle), kTime));
|
||||
}
|
||||
|
||||
@@ -85,12 +85,12 @@ class SymbolsSharedByTwoCardsConstraint : public Constraint {
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~SymbolsSharedByTwoCardsConstraint() {}
|
||||
~SymbolsSharedByTwoCardsConstraint() override {}
|
||||
|
||||
// Adds observers (named Demon) to variable events. These demons are
|
||||
// responsible for implementing the propagation algorithm of the
|
||||
// constraint.
|
||||
virtual void Post() {
|
||||
void Post() override {
|
||||
// Create a demon 'global_demon' that will bind events on
|
||||
// variables to the calling of the 'InitialPropagate()' method. As
|
||||
// this method is expensive, 'global_demon' has a low priority. As
|
||||
@@ -126,7 +126,7 @@ class SymbolsSharedByTwoCardsConstraint : public Constraint {
|
||||
// Conversely, if num_symbols_in_common_var->Min() ==
|
||||
// max_symbols_in_common, then all products that contribute to
|
||||
// max_symbols_in_common should be set to 1.
|
||||
virtual void InitialPropagate() {
|
||||
void InitialPropagate() override {
|
||||
int max_symbols_in_common = 0;
|
||||
int min_symbols_in_common = 0;
|
||||
for (int i = 0; i < num_symbols_; ++i) {
|
||||
@@ -250,13 +250,13 @@ class DobbleOperator : public IntVarLocalSearchOperator {
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~DobbleOperator() {}
|
||||
~DobbleOperator() override {}
|
||||
|
||||
protected:
|
||||
// OnStart() simply stores the current symbols per card in
|
||||
// symbols_per_card_, and defers further initialization to the
|
||||
// subclass's InitNeighborhoodSearch() method.
|
||||
virtual void OnStart() {
|
||||
void OnStart() override {
|
||||
for (int card = 0; card < num_cards_; ++card) {
|
||||
int found = 0;
|
||||
for (int symbol = 0; symbol < num_symbols_; ++symbol) {
|
||||
@@ -309,10 +309,10 @@ class SwapSymbols : public DobbleOperator {
|
||||
current_symbol1_(-1),
|
||||
current_symbol2_(-1) {}
|
||||
|
||||
virtual ~SwapSymbols() {}
|
||||
~SwapSymbols() override {}
|
||||
|
||||
// Finds the next swap, returns false when it has finished.
|
||||
virtual bool MakeOneNeighbor() {
|
||||
bool MakeOneNeighbor() override {
|
||||
if (!PickNextSwap()) {
|
||||
VLOG(1) << "finished neighborhood";
|
||||
return false;
|
||||
@@ -326,7 +326,7 @@ class SwapSymbols : public DobbleOperator {
|
||||
|
||||
private:
|
||||
// Reinit the exploration loop.
|
||||
virtual void InitNeighborhoodSearch() {
|
||||
void InitNeighborhoodSearch() override {
|
||||
current_card1_ = 0;
|
||||
current_card2_ = 1;
|
||||
current_symbol1_ = 0;
|
||||
@@ -380,10 +380,10 @@ class SwapSymbolsOnCardPairs : public DobbleOperator {
|
||||
CHECK_GE(max_num_swaps, 2);
|
||||
}
|
||||
|
||||
virtual ~SwapSymbolsOnCardPairs() {}
|
||||
~SwapSymbolsOnCardPairs() override {}
|
||||
|
||||
protected:
|
||||
virtual bool MakeOneNeighbor() {
|
||||
bool MakeOneNeighbor() override {
|
||||
const int num_swaps = rand_.Uniform(max_num_swaps_ - 1) + 2;
|
||||
for (int i = 0; i < num_swaps; ++i) {
|
||||
const int card_1 = rand_.Uniform(num_cards_);
|
||||
@@ -397,7 +397,7 @@ class SwapSymbolsOnCardPairs : public DobbleOperator {
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void InitNeighborhoodSearch() {}
|
||||
void InitNeighborhoodSearch() override {}
|
||||
|
||||
private:
|
||||
ACMRandom rand_;
|
||||
@@ -445,7 +445,7 @@ class DobbleFilter : public IntVarLocalSearchFilter {
|
||||
|
||||
// We build the current bitmap and the matrix of violation cost
|
||||
// between any two cards.
|
||||
virtual void OnSynchronize(const Assignment* delta) {
|
||||
void OnSynchronize(const Assignment* delta) override {
|
||||
symbol_bitmask_per_card_.assign(num_cards_, 0);
|
||||
for (int card = 0; card < num_cards_; ++card) {
|
||||
for (int symbol = 0; symbol < num_symbols_; ++symbol) {
|
||||
@@ -466,8 +466,8 @@ class DobbleFilter : public IntVarLocalSearchFilter {
|
||||
// The LocalSearchFilter::Accept() API also takes a deltadelta,
|
||||
// which is the difference between the current delta and the last
|
||||
// delta that was given to Accept() -- but we don't use it here.
|
||||
virtual bool Accept(const Assignment* delta,
|
||||
const Assignment* unused_deltadelta) {
|
||||
bool Accept(const Assignment* delta,
|
||||
const Assignment* unused_deltadelta) override {
|
||||
const Assignment::IntContainer& solution_delta = delta->IntVarContainer();
|
||||
const int solution_delta_size = solution_delta.Size();
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
//
|
||||
// Search will then be applied on the sequence constraints.
|
||||
|
||||
#include "cpp/jobshop.h"
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
@@ -43,7 +44,6 @@
|
||||
#include "base/stringprintf.h"
|
||||
#include "base/join.h"
|
||||
#include "constraint_solver/constraint_solver.h"
|
||||
#include "cpp/jobshop.h"
|
||||
|
||||
DEFINE_string(
|
||||
data_file, "",
|
||||
|
||||
@@ -59,9 +59,9 @@ class SwapIntervals : public SequenceVarLocalSearchOperator {
|
||||
current_first_(-1),
|
||||
current_second_(-1) {}
|
||||
|
||||
virtual ~SwapIntervals() {}
|
||||
~SwapIntervals() override {}
|
||||
|
||||
virtual bool MakeNextNeighbor(Assignment* delta, Assignment* deltadelta) {
|
||||
bool MakeNextNeighbor(Assignment* delta, Assignment* deltadelta) override {
|
||||
CHECK_NOTNULL(delta);
|
||||
while (true) {
|
||||
RevertChanges(true);
|
||||
@@ -84,7 +84,7 @@ class SwapIntervals : public SequenceVarLocalSearchOperator {
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void OnStart() {
|
||||
void OnStart() override {
|
||||
VLOG(1) << "start neighborhood";
|
||||
current_var_ = 0;
|
||||
current_first_ = 0;
|
||||
@@ -121,9 +121,9 @@ class ShuffleIntervals : public SequenceVarLocalSearchOperator {
|
||||
current_index_(-1),
|
||||
current_length_(-1) {}
|
||||
|
||||
virtual ~ShuffleIntervals() {}
|
||||
~ShuffleIntervals() override {}
|
||||
|
||||
virtual bool MakeNextNeighbor(Assignment* delta, Assignment* deltadelta) {
|
||||
bool MakeNextNeighbor(Assignment* delta, Assignment* deltadelta) override {
|
||||
CHECK_NOTNULL(delta);
|
||||
while (true) {
|
||||
RevertChanges(true);
|
||||
@@ -150,7 +150,7 @@ class ShuffleIntervals : public SequenceVarLocalSearchOperator {
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void OnStart() {
|
||||
void OnStart() override {
|
||||
VLOG(1) << "start neighborhood";
|
||||
current_var_ = 0;
|
||||
current_first_ = 0;
|
||||
@@ -196,9 +196,9 @@ class SequenceLns : public SequenceVarLocalSearchOperator {
|
||||
random_(seed),
|
||||
max_length_(max_length) {}
|
||||
|
||||
virtual ~SequenceLns() {}
|
||||
~SequenceLns() override {}
|
||||
|
||||
virtual bool MakeNextNeighbor(Assignment* delta, Assignment* deltadelta) {
|
||||
bool MakeNextNeighbor(Assignment* delta, Assignment* deltadelta) override {
|
||||
CHECK_NOTNULL(delta);
|
||||
while (true) {
|
||||
RevertChanges(true);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
|
||||
#include "base/commandlineflags.h"
|
||||
#include "base/logging.h"
|
||||
#include "graph/ebert_graph.h"
|
||||
@@ -22,7 +23,7 @@ namespace operations_research {
|
||||
// http://www.ee.oulu.fi/~mpa/matreng/eem1_2-1.htm with kCost[0][1]
|
||||
// modified so the optimum solution is unique.
|
||||
void AssignmentOn4x4Matrix() {
|
||||
LOG(INFO) << "Assignment on 4x4 matrix";
|
||||
LOG(INFO) << "Assignment on 4x4 Matrix";
|
||||
const int kNumSources = 4;
|
||||
const int kNumTargets = 4;
|
||||
const CostValue kCost[kNumSources][kNumTargets] = {{90, 76, 75, 80},
|
||||
|
||||
@@ -29,11 +29,11 @@ class OneVarLns : public BaseLNS {
|
||||
public:
|
||||
explicit OneVarLns(const std::vector<IntVar*>& vars) : BaseLNS(vars), index_(0) {}
|
||||
|
||||
~OneVarLns() {}
|
||||
~OneVarLns() override {}
|
||||
|
||||
virtual void InitFragments() { index_ = 0; }
|
||||
void InitFragments() override { index_ = 0; }
|
||||
|
||||
virtual bool NextFragment(std::vector<int>* fragment) {
|
||||
bool NextFragment(std::vector<int>* fragment) override {
|
||||
const int size = Size();
|
||||
if (index_ < size) {
|
||||
fragment->push_back(index_);
|
||||
@@ -55,11 +55,11 @@ class MoveOneVar : public IntVarLocalSearchOperator {
|
||||
variable_index_(0),
|
||||
move_up_(false) {}
|
||||
|
||||
virtual ~MoveOneVar() {}
|
||||
~MoveOneVar() override {}
|
||||
|
||||
protected:
|
||||
// Make a neighbor assigning one variable to its target value.
|
||||
virtual bool MakeOneNeighbor() {
|
||||
bool MakeOneNeighbor() override {
|
||||
const int64 current_value = OldValue(variable_index_);
|
||||
if (move_up_) {
|
||||
SetValue(variable_index_, current_value + 1);
|
||||
@@ -72,7 +72,7 @@ class MoveOneVar : public IntVarLocalSearchOperator {
|
||||
}
|
||||
|
||||
private:
|
||||
virtual void OnStart() {
|
||||
void OnStart() override {
|
||||
CHECK_GE(variable_index_, 0);
|
||||
CHECK_LT(variable_index_, Size());
|
||||
}
|
||||
@@ -88,17 +88,17 @@ class SumFilter : public IntVarLocalSearchFilter {
|
||||
explicit SumFilter(const std::vector<IntVar*>& vars)
|
||||
: IntVarLocalSearchFilter(vars), sum_(0) {}
|
||||
|
||||
~SumFilter() {}
|
||||
~SumFilter() override {}
|
||||
|
||||
virtual void OnSynchronize(const Assignment* delta) {
|
||||
void OnSynchronize(const Assignment* delta) override {
|
||||
sum_ = 0;
|
||||
for (int index = 0; index < Size(); ++index) {
|
||||
sum_ += Value(index);
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool Accept(const Assignment* delta,
|
||||
const Assignment* unused_deltadelta) {
|
||||
bool Accept(const Assignment* delta,
|
||||
const Assignment* unused_deltadelta) override {
|
||||
const Assignment::IntContainer& solution_delta = delta->IntVarContainer();
|
||||
const int solution_delta_size = solution_delta.Size();
|
||||
|
||||
|
||||
@@ -117,14 +117,15 @@ class NetworkRoutingData {
|
||||
|
||||
// Returns the capacity of an arc, and 0 if the arc is not defined.
|
||||
int Capacity(int node1, int node2) const {
|
||||
return FindWithDefault(all_arcs_,
|
||||
std::make_pair(std::min(node1, node2), std::max(node1, node2)), 0);
|
||||
return FindWithDefault(
|
||||
all_arcs_, std::make_pair(std::min(node1, node2), std::max(node1, node2)), 0);
|
||||
}
|
||||
|
||||
// Returns the demand between the source and the destination, and 0 if
|
||||
// there are no demands between the source and the destination.
|
||||
int Demand(int source, int destination) const {
|
||||
return FindWithDefault(all_demands_, std::make_pair(source, destination), 0);
|
||||
return FindWithDefault(all_demands_, std::make_pair(source, destination),
|
||||
0);
|
||||
}
|
||||
|
||||
// External building API.
|
||||
@@ -571,8 +572,9 @@ class NetworkRoutingSolver {
|
||||
IntVar** const traffic) {
|
||||
std::vector<IntVar*> terms;
|
||||
for (int i = 0; i < path_vars.size(); ++i) {
|
||||
terms.push_back(solver->MakeProd(path_vars[i][arc_index],
|
||||
demands_array_[i].traffic)->Var());
|
||||
terms.push_back(
|
||||
solver->MakeProd(path_vars[i][arc_index], demands_array_[i].traffic)
|
||||
->Var());
|
||||
}
|
||||
*traffic = solver->MakeSum(terms)->Var();
|
||||
}
|
||||
@@ -777,7 +779,8 @@ class NetworkRoutingSolver {
|
||||
2 * arc_index, 0)][arcs_data_.Value(2 * arc_index, 1)];
|
||||
IntVar* const usage_cost =
|
||||
solver.MakeDiv(solver.MakeProd(vtraffic[arc_index], kOneThousand),
|
||||
capacity)->Var();
|
||||
capacity)
|
||||
->Var();
|
||||
usage_costs.push_back(usage_cost);
|
||||
IntVar* const comfort_cost = solver.MakeIsGreaterCstVar(
|
||||
vtraffic[arc_index], capacity * FLAGS_comfort_zone / kOneThousand);
|
||||
@@ -927,7 +930,7 @@ int main(int argc, char** argv) {
|
||||
FLAGS_fixed_charge_cost, FLAGS_seed, &data);
|
||||
operations_research::NetworkRoutingSolver solver;
|
||||
solver.Init(data, FLAGS_extra_hops, FLAGS_max_paths);
|
||||
LOG(INFO) << "Final cost = " << solver.LnsSolve(FLAGS_time_limit,
|
||||
FLAGS_fail_limit);
|
||||
LOG(INFO) << "Final cost = "
|
||||
<< solver.LnsSolve(FLAGS_time_limit, FLAGS_fail_limit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class NQueenSymmetry : public SymmetryBreaker {
|
||||
indices_[vars[i]] = i;
|
||||
}
|
||||
}
|
||||
virtual ~NQueenSymmetry() {}
|
||||
~NQueenSymmetry() override {}
|
||||
|
||||
protected:
|
||||
int Index(IntVar* const var) const {
|
||||
@@ -83,9 +83,9 @@ class NQueenSymmetry : public SymmetryBreaker {
|
||||
class SX : public NQueenSymmetry {
|
||||
public:
|
||||
SX(Solver* const s, const std::vector<IntVar*>& vars) : NQueenSymmetry(s, vars) {}
|
||||
virtual ~SX() {}
|
||||
~SX() override {}
|
||||
|
||||
virtual void VisitSetVariableValue(IntVar* const var, int64 value) {
|
||||
void VisitSetVariableValue(IntVar* const var, int64 value) override {
|
||||
const int index = Index(var);
|
||||
IntVar* const other_var = Var(symmetric(index));
|
||||
AddIntegerVariableEqualValueClause(other_var, value);
|
||||
@@ -96,9 +96,9 @@ class SX : public NQueenSymmetry {
|
||||
class SY : public NQueenSymmetry {
|
||||
public:
|
||||
SY(Solver* const s, const std::vector<IntVar*>& vars) : NQueenSymmetry(s, vars) {}
|
||||
virtual ~SY() {}
|
||||
~SY() override {}
|
||||
|
||||
virtual void VisitSetVariableValue(IntVar* const var, int64 value) {
|
||||
void VisitSetVariableValue(IntVar* const var, int64 value) override {
|
||||
AddIntegerVariableEqualValueClause(var, symmetric(value));
|
||||
}
|
||||
};
|
||||
@@ -107,9 +107,9 @@ class SY : public NQueenSymmetry {
|
||||
class SD1 : public NQueenSymmetry {
|
||||
public:
|
||||
SD1(Solver* const s, const std::vector<IntVar*>& vars) : NQueenSymmetry(s, vars) {}
|
||||
virtual ~SD1() {}
|
||||
~SD1() override {}
|
||||
|
||||
virtual void VisitSetVariableValue(IntVar* const var, int64 value) {
|
||||
void VisitSetVariableValue(IntVar* const var, int64 value) override {
|
||||
const int index = Index(var);
|
||||
IntVar* const other_var = Var(value);
|
||||
AddIntegerVariableEqualValueClause(other_var, index);
|
||||
@@ -120,9 +120,9 @@ class SD1 : public NQueenSymmetry {
|
||||
class SD2 : public NQueenSymmetry {
|
||||
public:
|
||||
SD2(Solver* const s, const std::vector<IntVar*>& vars) : NQueenSymmetry(s, vars) {}
|
||||
virtual ~SD2() {}
|
||||
~SD2() override {}
|
||||
|
||||
virtual void VisitSetVariableValue(IntVar* const var, int64 value) {
|
||||
void VisitSetVariableValue(IntVar* const var, int64 value) override {
|
||||
const int index = Index(var);
|
||||
IntVar* const other_var = Var(symmetric(value));
|
||||
AddIntegerVariableEqualValueClause(other_var, symmetric(index));
|
||||
@@ -133,9 +133,9 @@ class SD2 : public NQueenSymmetry {
|
||||
class R90 : public NQueenSymmetry {
|
||||
public:
|
||||
R90(Solver* const s, const std::vector<IntVar*>& vars) : NQueenSymmetry(s, vars) {}
|
||||
virtual ~R90() {}
|
||||
~R90() override {}
|
||||
|
||||
virtual void VisitSetVariableValue(IntVar* const var, int64 value) {
|
||||
void VisitSetVariableValue(IntVar* const var, int64 value) override {
|
||||
const int index = Index(var);
|
||||
IntVar* const other_var = Var(value);
|
||||
AddIntegerVariableEqualValueClause(other_var, symmetric(index));
|
||||
@@ -147,9 +147,9 @@ class R180 : public NQueenSymmetry {
|
||||
public:
|
||||
R180(Solver* const s, const std::vector<IntVar*>& vars)
|
||||
: NQueenSymmetry(s, vars) {}
|
||||
virtual ~R180() {}
|
||||
~R180() override {}
|
||||
|
||||
virtual void VisitSetVariableValue(IntVar* const var, int64 value) {
|
||||
void VisitSetVariableValue(IntVar* const var, int64 value) override {
|
||||
const int index = Index(var);
|
||||
IntVar* const other_var = Var(symmetric(index));
|
||||
AddIntegerVariableEqualValueClause(other_var, symmetric(value));
|
||||
@@ -161,9 +161,9 @@ class R270 : public NQueenSymmetry {
|
||||
public:
|
||||
R270(Solver* const s, const std::vector<IntVar*>& vars)
|
||||
: NQueenSymmetry(s, vars) {}
|
||||
virtual ~R270() {}
|
||||
~R270() override {}
|
||||
|
||||
virtual void VisitSetVariableValue(IntVar* const var, int64 value) {
|
||||
void VisitSetVariableValue(IntVar* const var, int64 value) override {
|
||||
const int index = Index(var);
|
||||
IntVar* const other_var = Var(symmetric(value));
|
||||
AddIntegerVariableEqualValueClause(other_var, index);
|
||||
|
||||
@@ -42,7 +42,7 @@ class LinearSumAssignment;
|
||||
template <typename GraphType>
|
||||
class DimacsAssignmentParser {
|
||||
public:
|
||||
explicit DimacsAssignmentParser(const std::string filename)
|
||||
explicit DimacsAssignmentParser(const std::string& filename)
|
||||
: filename_(filename), graph_builder_(NULL), assignment_(NULL) {}
|
||||
|
||||
// Reads an assignment problem description from the given file in
|
||||
|
||||
Reference in New Issue
Block a user