BRKGA and Control Parameters

Overview

// classes

class BRKGA::BrkgaParams;
class BRKGA::ControlParams;

// global functions

INLINE std::pair<BrkgaParams, ControlParams> BRKGA::readConfiguration(
    std::istream& input,
    std::ostream& logger = std::cout
);

INLINE std::pair<BrkgaParams, ControlParams> BRKGA::readConfiguration(
    const std::string& filename,
    std::ostream& logger = std::cout
);

INLINE std::ostream& BRKGA::operator << (
    std::ostream& os,
    const BrkgaParams& brkga_params
);

INLINE std::ostream& BRKGA::operator << (
    std::ostream& os,
    const ControlParams& control_params
);

INLINE void BRKGA::writeConfiguration(
    std::ostream& output,
    const BrkgaParams& brkga_params,
    const ControlParams& control_params = ControlParams{}
);

INLINE void BRKGA::writeConfiguration(
    const std::string& filename,
    const BrkgaParams& brkga_params,
    const ControlParams& control_params = ControlParams{}
);

Detailed Documentation

Global Functions

INLINE std::pair<BrkgaParams, ControlParams> BRKGA::readConfiguration(
    std::istream& input,
    std::ostream& logger = std::cout
)

Reads the parameters from an input stream.

Todo This method can beneficiate from introspection tools. We would like achieve a code similar to the Julia counterpart.

Parameters:

input

the input stream. It can be a file or a string stream.

logger

a output stream to log some information such as missing no-required parameters. It does not log errors.

std::fstream::failure

in case of errors in the file.

Returns:

a tuple containing the BRKGA and external control parameters.

INLINE std::pair<BrkgaParams, ControlParams> BRKGA::readConfiguration(
    const std::string& filename,
    std::ostream& logger = std::cout
)

Reads the parameters from a configuration file.

Parameters:

filename

the configuration file.

logger

a output stream to log some information such as missing no-required parameters. It does not log errors.

std::fstream::failure

in case of errors in the file.

Returns:

a tuple containing the BRKGA and external control parameters.

INLINE std::ostream& BRKGA::operator << (
    std::ostream& os,
    const BrkgaParams& brkga_params
)

Output stream operator for BrkgaParams.

Parameters:

os

the output stream.

brkga_params

the parameters.

Returns:

the output stream.

INLINE std::ostream& BRKGA::operator << (
    std::ostream& os,
    const ControlParams& control_params
)

Output stream operator for ControlParams.

Parameters:

os

the output stream.

control_params

the parameters.

Returns:

the output stream.

INLINE void BRKGA::writeConfiguration(
    std::ostream& output,
    const BrkgaParams& brkga_params,
    const ControlParams& control_params = ControlParams{}
)

Writes the parameters into a output stream.

Note

All floating point parameters are written with two point precision.

Todo This method can beneficiate from introspection tools. We would like achieve a code similar to the Julia counterpart.

Parameters:

output

the output stream.

brkga_params

the BRKGA parameters.

control_params

the external control parameters. Default is an empty object.

std::fstream::failure

in case of errors in the file.

INLINE void BRKGA::writeConfiguration(
    const std::string& filename,
    const BrkgaParams& brkga_params,
    const ControlParams& control_params = ControlParams{}
)

Writes the parameters into a configuration file.

Note

All floating point parameters are written with two point precision.

Parameters:

filename

the configuration file.

brkga_params

the BRKGA parameters.

control_params

the external control parameters. Default is an empty object.

std::fstream::failure

in case of errors in the file.