Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::NeighborhoodGeneratorHelper Class Reference

Detailed Description

Definition at line 107 of file cp_model_lns.h.

#include <cp_model_lns.h>

Inheritance diagram for operations_research::sat::NeighborhoodGeneratorHelper:
operations_research::sat::SubSolver

Classes

struct  ActiveRectangle

Public Member Functions

 NeighborhoodGeneratorHelper (CpModelProto const *model_proto, SatParameters const *parameters, SharedResponseManager *shared_response, ModelSharedTimeLimit *global_time_limit, SharedBoundsManager *shared_bounds=nullptr)
bool TaskIsAvailable () override
std::function< void()> GenerateTask (int64_t) override
void Synchronize () override
int NumVariables () const
Neighborhood FixGivenVariables (const CpSolverResponse &base_solution, const Bitset64< int > &variables_to_fix) const
Neighborhood RelaxGivenVariables (const CpSolverResponse &initial_solution, absl::Span< const int > relaxed_variables) const
Neighborhood FixAllVariables (const CpSolverResponse &initial_solution) const
Neighborhood FullNeighborhood () const
Neighborhood NoNeighborhood () const
void AddSolutionHinting (const CpSolverResponse &initial_solution, CpModelProto *model_proto) const
bool IsActive (int var) const ABSL_SHARED_LOCKS_REQUIRED(graph_mutex_)
std::vector< int > ActiveVariables () const
int NumActiveVariables () const
std::vector< int > ActiveObjectiveVariables () const
bool DifficultyMeansFullNeighborhood (double difficulty) const
const std::vector< int > & ActiveVariablesWhileHoldingLock () const ABSL_SHARED_LOCKS_REQUIRED(graph_mutex_)
std::vector< int > ActiveObjectiveVariablesWhileHoldingLock () const ABSL_SHARED_LOCKS_REQUIRED(graph_mutex_)
std::vector< int > ImprovableObjectiveVariablesWhileHoldingLock (const CpSolverResponse &initial_solution) const ABSL_LOCKS_EXCLUDED(domain_mutex_)
const CompactVectorVector< int, int > & ConstraintToVar () const ABSL_SHARED_LOCKS_REQUIRED(graph_mutex_)
const CompactVectorVector< int, int > & VarToConstraint () const ABSL_SHARED_LOCKS_REQUIRED(graph_mutex_)
absl::Span< const int > TypeToConstraints (ConstraintProto::ConstraintCase type) const
std::vector< int > KeepActiveIntervals (absl::Span< const int > unfiltered_intervals, const CpSolverResponse &initial_solution) const
std::vector< int > GetActiveIntervals (const CpSolverResponse &initial_solution) const
std::vector< ActiveRectangleGetActiveRectangles (const CpSolverResponse &initial_solution) const
std::vector< std::vector< int > > GetUniqueIntervalSets () const
std::vector< std::vector< int > > GetRoutingPathBooleanVariables (const CpSolverResponse &initial_solution) const
std::vector< std::pair< int, int > > GetSchedulingPrecedences (const absl::flat_hash_set< int > &ignored_intervals, const CpSolverResponse &initial_solution, absl::BitGenRef random) const
CpModelProto UpdatedModelProtoCopy () const
const CpModelProtoModelProto () const
const SatParametersParameters () const
const SharedResponseManagershared_response () const
Public Member Functions inherited from operations_research::sat::SubSolver
 SubSolver (absl::string_view name, SubsolverType type)
virtual ~SubSolver ()=default
virtual bool IsDone ()
double deterministic_time () const
std::string name () const
SubsolverType type () const
void AddTaskDuration (double duration_in_seconds)
void NotifySelection ()
void AddTaskDeterministicDuration (double deterministic_duration)
std::string TimingInfo () const
std::string DeterministicTimingInfo () const
double GetSelectionScore (bool deterministic) const

Public Attributes

absl::Mutex graph_mutex_

Additional Inherited Members

Public Types inherited from operations_research::sat::SubSolver
enum  SubsolverType { FULL_PROBLEM , FIRST_SOLUTION , INCOMPLETE , HELPER }

Constructor & Destructor Documentation

◆ NeighborhoodGeneratorHelper()

operations_research::sat::NeighborhoodGeneratorHelper::NeighborhoodGeneratorHelper ( CpModelProto const * model_proto,
SatParameters const * parameters,
SharedResponseManager * shared_response,
ModelSharedTimeLimit * global_time_limit,
SharedBoundsManager * shared_bounds = nullptr )

Definition at line 73 of file cp_model_lns.cc.

Member Function Documentation

◆ ActiveObjectiveVariables()

std::vector< int > operations_research::sat::NeighborhoodGeneratorHelper::ActiveObjectiveVariables ( ) const
inline

Definition at line 169 of file cp_model_lns.h.

◆ ActiveObjectiveVariablesWhileHoldingLock()

std::vector< int > operations_research::sat::NeighborhoodGeneratorHelper::ActiveObjectiveVariablesWhileHoldingLock ( ) const
inline

Definition at line 192 of file cp_model_lns.h.

◆ ActiveVariables()

std::vector< int > operations_research::sat::NeighborhoodGeneratorHelper::ActiveVariables ( ) const
inline

Definition at line 157 of file cp_model_lns.h.

◆ ActiveVariablesWhileHoldingLock()

const std::vector< int > & operations_research::sat::NeighborhoodGeneratorHelper::ActiveVariablesWhileHoldingLock ( ) const
inline

Definition at line 185 of file cp_model_lns.h.

◆ AddSolutionHinting()

void operations_research::sat::NeighborhoodGeneratorHelper::AddSolutionHinting ( const CpSolverResponse & initial_solution,
CpModelProto * model_proto ) const

Definition at line 1187 of file cp_model_lns.cc.

◆ ConstraintToVar()

const CompactVectorVector< int, int > & operations_research::sat::NeighborhoodGeneratorHelper::ConstraintToVar ( ) const
inline

Definition at line 211 of file cp_model_lns.h.

◆ DifficultyMeansFullNeighborhood()

bool operations_research::sat::NeighborhoodGeneratorHelper::DifficultyMeansFullNeighborhood ( double difficulty) const
inline

Definition at line 176 of file cp_model_lns.h.

◆ FixAllVariables()

Neighborhood operations_research::sat::NeighborhoodGeneratorHelper::FixAllVariables ( const CpSolverResponse & initial_solution) const

Definition at line 1219 of file cp_model_lns.cc.

◆ FixGivenVariables()

Neighborhood operations_research::sat::NeighborhoodGeneratorHelper::FixGivenVariables ( const CpSolverResponse & base_solution,
const Bitset64< int > & variables_to_fix ) const

Definition at line 1070 of file cp_model_lns.cc.

◆ FullNeighborhood()

Neighborhood operations_research::sat::NeighborhoodGeneratorHelper::FullNeighborhood ( ) const

Definition at line 419 of file cp_model_lns.cc.

◆ GenerateTask()

std::function< void()> operations_research::sat::NeighborhoodGeneratorHelper::GenerateTask ( int64_t )
inlineoverridevirtual

Implements operations_research::sat::SubSolver.

Definition at line 117 of file cp_model_lns.h.

◆ GetActiveIntervals()

std::vector< int > operations_research::sat::NeighborhoodGeneratorHelper::GetActiveIntervals ( const CpSolverResponse & initial_solution) const

Definition at line 474 of file cp_model_lns.cc.

◆ GetActiveRectangles()

std::vector< NeighborhoodGeneratorHelper::ActiveRectangle > operations_research::sat::NeighborhoodGeneratorHelper::GetActiveRectangles ( const CpSolverResponse & initial_solution) const

Definition at line 481 of file cp_model_lns.cc.

◆ GetRoutingPathBooleanVariables()

std::vector< std::vector< int > > operations_research::sat::NeighborhoodGeneratorHelper::GetRoutingPathBooleanVariables ( const CpSolverResponse & initial_solution) const

Definition at line 984 of file cp_model_lns.cc.

◆ GetSchedulingPrecedences()

std::vector< std::pair< int, int > > operations_research::sat::NeighborhoodGeneratorHelper::GetSchedulingPrecedences ( const absl::flat_hash_set< int > & ignored_intervals,
const CpSolverResponse & initial_solution,
absl::BitGenRef random ) const

Definition at line 959 of file cp_model_lns.cc.

◆ GetUniqueIntervalSets()

std::vector< std::vector< int > > operations_research::sat::NeighborhoodGeneratorHelper::GetUniqueIntervalSets ( ) const

Definition at line 515 of file cp_model_lns.cc.

◆ ImprovableObjectiveVariablesWhileHoldingLock()

std::vector< int > operations_research::sat::NeighborhoodGeneratorHelper::ImprovableObjectiveVariablesWhileHoldingLock ( const CpSolverResponse & initial_solution) const

Definition at line 1336 of file cp_model_lns.cc.

◆ IsActive()

bool operations_research::sat::NeighborhoodGeneratorHelper::IsActive ( int var) const

Definition at line 409 of file cp_model_lns.cc.

◆ KeepActiveIntervals()

std::vector< int > operations_research::sat::NeighborhoodGeneratorHelper::KeepActiveIntervals ( absl::Span< const int > unfiltered_intervals,
const CpSolverResponse & initial_solution ) const

Definition at line 462 of file cp_model_lns.cc.

◆ ModelProto()

const CpModelProto & operations_research::sat::NeighborhoodGeneratorHelper::ModelProto ( ) const
inline

Definition at line 280 of file cp_model_lns.h.

◆ NoNeighborhood()

Neighborhood operations_research::sat::NeighborhoodGeneratorHelper::NoNeighborhood ( ) const

Definition at line 431 of file cp_model_lns.cc.

◆ NumActiveVariables()

int operations_research::sat::NeighborhoodGeneratorHelper::NumActiveVariables ( ) const
inline

Definition at line 164 of file cp_model_lns.h.

◆ NumVariables()

int operations_research::sat::NeighborhoodGeneratorHelper::NumVariables ( ) const
inline

Definition at line 122 of file cp_model_lns.h.

◆ Parameters()

const SatParameters & operations_research::sat::NeighborhoodGeneratorHelper::Parameters ( ) const
inline

Definition at line 281 of file cp_model_lns.h.

◆ RelaxGivenVariables()

Neighborhood operations_research::sat::NeighborhoodGeneratorHelper::RelaxGivenVariables ( const CpSolverResponse & initial_solution,
absl::Span< const int > relaxed_variables ) const

Definition at line 1205 of file cp_model_lns.cc.

◆ shared_response()

const SharedResponseManager & operations_research::sat::NeighborhoodGeneratorHelper::shared_response ( ) const
inline

Definition at line 283 of file cp_model_lns.h.

◆ Synchronize()

void operations_research::sat::NeighborhoodGeneratorHelper::Synchronize ( )
overridevirtual

Implements operations_research::sat::SubSolver.

Definition at line 103 of file cp_model_lns.cc.

◆ TaskIsAvailable()

bool operations_research::sat::NeighborhoodGeneratorHelper::TaskIsAvailable ( )
inlineoverridevirtual

Implements operations_research::sat::SubSolver.

Definition at line 116 of file cp_model_lns.h.

◆ TypeToConstraints()

absl::Span< const int > operations_research::sat::NeighborhoodGeneratorHelper::TypeToConstraints ( ConstraintProto::ConstraintCase type) const
inline

Definition at line 221 of file cp_model_lns.h.

◆ UpdatedModelProtoCopy()

CpModelProto operations_research::sat::NeighborhoodGeneratorHelper::UpdatedModelProtoCopy ( ) const

Definition at line 1231 of file cp_model_lns.cc.

◆ VarToConstraint()

const CompactVectorVector< int, int > & operations_research::sat::NeighborhoodGeneratorHelper::VarToConstraint ( ) const
inline

Definition at line 215 of file cp_model_lns.h.

Member Data Documentation

◆ graph_mutex_

absl::Mutex operations_research::sat::NeighborhoodGeneratorHelper::graph_mutex_
mutable

Definition at line 292 of file cp_model_lns.h.


The documentation for this class was generated from the following files: