GHOST
Public Member Functions | List of all members
ghost::Maximize Class Reference

#include <objective.hpp>

Inheritance diagram for ghost::Maximize:
Inheritance graph
Collaboration diagram for ghost::Maximize:
Collaboration graph

Public Member Functions

 Maximize (const std::vector< int > &variables_index)
 
 Maximize (const std::vector< Variable > &variables)
 
 Maximize (const std::vector< int > &variables_index, const std::string &name)
 
 Maximize (const std::vector< Variable > &variables, const std::string &name)
 
 Maximize (const std::vector< int > &variables_index, const char *name)
 
 Maximize (const std::vector< Variable > &variables, const char *name)
 
- Public Member Functions inherited from ghost::Objective
 Objective (const Objective &other)=default
 Default copy contructor. More...
 
 Objective (Objective &&other)=default
 Default move contructor. More...
 
Objectiveoperator= (const Objective &other)=delete
 Copy assignment operator disabled. More...
 
Objectiveoperator= (Objective &&other)=delete
 Move assignment operator disabled. More...
 
virtual ~Objective ()=default
 Default virtual destructor. More...
 
std::string get_name () const
 Inline accessor to get the name of the objective object. More...
 
bool is_optimization () const
 Inline method returning if a user-defined objective function has been declared. More...
 
bool is_maximization () const
 

Additional Inherited Members

- Protected Member Functions inherited from ghost::Objective
virtual double required_cost (const std::vector< Variable * > &variables) const =0
 
virtual void conditional_update_data_structures (const std::vector< Variable * > &variables, int index, int new_value)
 
virtual int expert_heuristic_value (const std::vector< Variable * > &variables, int variable_index, const std::vector< int > &possible_values, randutils::mt19937_rng &rng) const
 
virtual int expert_heuristic_value_permutation (const std::vector< Variable * > &variables, int variable_index, const std::vector< int > &bad_variables, randutils::mt19937_rng &rng) const
 
virtual double expert_postprocess (const std::vector< Variable * > &variables, double best_cost) const
 
void is_not_optimization ()
 

Detailed Description

Maximize

This is the base class to define maximization objective functions.

ghost::Maximize cannot be directly used to encode user-defined objective function, since this is an abstract class. To declare a problem with GHOST, users have to make their own derived objective class.

See also
Objective

Constructor & Destructor Documentation

◆ Maximize() [1/6]

ghost::Maximize::Maximize ( const std::vector< int > &  variables_index)
inline

Constructor with a vector of variable IDs. This vector is internally used by Objective to know what variables from the global variable vector it is handling. The name of the objective function will be set to the string 'Maximize'.

Parameters
variables_indexa const reference to a vector of IDs of variables composing the objective function.

◆ Maximize() [2/6]

ghost::Maximize::Maximize ( const std::vector< Variable > &  variables)
inline

Constructor building a vector of variable IDs by calling v->get_id() from all variables v. The name of the objective function will be set to the string 'Maximize'.

Parameters
variablesa const reference to a vector of variable composing the objective function.

◆ Maximize() [3/6]

ghost::Maximize::Maximize ( const std::vector< int > &  variables_index,
const std::string &  name 
)
inline

Constructor with a vector of variable IDs. This vector is internally used by Objective to know what variables from the global variable vector it is handling.

Parameters
variables_indexa const reference to a vector of IDs of variables composing the objective function.
namea const reference ot a string to give a name to the objective function.

◆ Maximize() [4/6]

ghost::Maximize::Maximize ( const std::vector< Variable > &  variables,
const std::string &  name 
)
inline

Constructor building a vector of variable IDs by calling v->get_id() from all variables v.

Parameters
variablesa const reference to a vector of variable composing the objective function.
namea const reference ot a string to give a name to the objective function.

◆ Maximize() [5/6]

ghost::Maximize::Maximize ( const std::vector< int > &  variables_index,
const char *  name 
)
inline

Constructor with a vector of variable IDs. This vector is internally used by Objective to know what variables from the global variable vector it is handling.

Parameters
variables_indexa const reference to a vector of IDs of variables composing the objective function.
namea const char* to give a name to the objective function.

◆ Maximize() [6/6]

ghost::Maximize::Maximize ( const std::vector< Variable > &  variables,
const char *  name 
)
inline

Constructor building a vector of variable IDs by calling v->get_id() from all variables v.

Parameters
variablesa const reference to a vector of variable composing the objective function.
namea const char* to give a name to the objective function.

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