highprecisionpso::configuration Namespace Reference

Contains the variables which store information about the configuration for the particle swarm optimization algorithm (PSO). More...

Classes

class  InitializationInformation
 Stores the information how positions or velocities should be initialized. More...
 

Enumerations

enum  FunctionBehaviorOutsideOfBoundsMode { FUNCTION_BEHAVIOR_OUTSIDE_OF_BOUNDS_INFINITY, FUNCTION_BEHAVIOR_OUTSIDE_OF_BOUNDS_NORMAL_EVALUATION, FUNCTION_BEHAVIOR_OUTSIDE_OF_BOUNDS_PERIODIC }
 Specification possibilities how the objective function is evaluated outside of the search space bounds. More...
 
enum  InitializationInformationType {
  INITIALIZATION_INFORMATION_TYPE_BOUNDS, INITIALIZATION_INFORMATION_TYPE_CENTER_RANGE, INITIALIZATION_INFORMATION_TYPE_RANDOM_CENTER_RANGE, INITIALIZATION_INFORMATION_TYPE_NORMAL_SCALE,
  INITIALIZATION_INFORMATION_TYPE_POWER_SCALE
}
 Specification possibilities for position or velocity initialization. More...
 
enum  InitializeVelocityMode { INITIALIZE_VELOCITY_MODE_ZERO, INITIALIZE_VELOCITY_MODE_HALFDIFF, INITIALIZE_VELOCITY_MODE_RANDOM }
 Specification possibilities how the velocity is initialized. More...
 
enum  UpdateGlobalAttractorMode { UPDATE_GLOBAL_ATTRACTOR_MODE_EACH_ITERATION, UPDATE_GLOBAL_ATTRACTOR_MODE_EACH_PARTICLE }
 Specification possibilities how often the global attractor is updated. More...
 

Functions

std::string GetConfigurationString ()
 Generates a short string, which includes the main information about the current configuration. More...
 
std::string GetFilePrefix ()
 If a file prefix is already specified then this file prefix is returned. Otherwise the file prefix is generated. More...
 
void Init ()
 Resets all variables in the configuration section to the default values. More...
 
bool ReadConfigurationFile (std::string fileName)
 Reads data from the given configuration file and stores them in the configuration section. More...
 

Variables

BoundHandlingg_bound_handling
 Specifies the bound handling method. More...
 
double g_chi
 Inertia weight of PSO for movement equation. More...
 
double g_coefficient_global_attractor
 Coefficient for the weight of the direction to the global attractor for the movement equation. More...
 
double g_coefficient_local_attractor
 Coefficient for the weight of the direction to the local attractor for the movement equation. More...
 
bool g_debug_swarm_activated
 Specifies whether the debug swarm mode is activated. More...
 
unsigned int g_debug_swarm_global_attractor_trajectory
 Specifies how many of the previous global attractor positions are visualized. More...
 
std::string g_debug_swarm_gnuplot_terminal
 Specifies the gnuplot terminal for image generation. More...
 
std::string g_debug_swarm_image_file_extension
 Specifies the file extension for image generation with gnuplot. More...
 
unsigned int g_debug_swarm_image_generation_frequency
 Specifies how often images are created. More...
 
bool g_debug_swarm_show_global_attractor_on_terminal
 Specifies whether the position value and the function value of the particle swarm should be displayed at each iteration. More...
 
unsigned int g_debug_swarm_x_resolution
 Specifies width in pixels of generated images. More...
 
unsigned int g_debug_swarm_y_resolution
 Specifies height in pixels of generated images. More...
 
int g_dimensions
 The number of dimensions of the search space for the particle swarm optimization algorithm. More...
 
std::string g_file_prefix
 File prefix for all generated files. (Will be initialized in the first call of getFilePrefix) More...
 
Functiong_function
 Specifies the objective function. More...
 
FunctionBehaviorOutsideOfBoundsMode g_function_behavior_outside_of_bounds_mode
 Stores the information how the objective function is evaluated outside of the search space bounds. More...
 
std::vector< SearchSpaceBoundg_function_bounds
 A list of search space bounds for the current objective function. More...
 
InitializeVelocityMode g_initialize_velocity_mode
 Stores the information how the velocity should be initialized. More...
 
std::vector< std::vector< long long > > g_iterations_with_statistic_evaluations
 Specifies at which steps / iterations statistical evaluations are done. Each vector entry contains 3 long long values which specify start iteration, end iteration and periodicity. More...
 
long long g_max_iterations
 The number of iterations / steps for the particle swarm optimization algorithm. Specifies how many iterations of the particle swarm are done. More...
 
Neighborhoodg_neighborhood
 Specifies the neighborhood topology. More...
 
int g_particles
 The number of particles for the particle swarm optimization algorithm. More...
 
PositionAndVelocityUpdaterg_position_and_velocity_updater
 Specifies the way how the positions and the velocities are updated at each iteration. More...
 
std::vector< InitializationInformationg_position_initialization_informations
 Initialization informations for position initialization. More...
 
std::vector< long long > g_preserve_backup_times
 Contains a list of time steps at which backups of the current situation (positions, velocities, ... ) are stored. More...
 
std::string g_run_check_configuration_file
 File name of the run check configuration file. If this value is the empty string then no run check is done. More...
 
bool g_show_system_time_in_file_prefix
 Specifies whether the time and the date should be included in the generated files. More...
 
Statisticsg_statistics
 Stores information about the current swarm situation. More...
 
std::vector< Statistic * > g_statistics_list
 Contains a list of statistics which should be evaluated. More...
 
double g_time_between_backups
 Specifies periodicity in seconds of the creation of backups and the continuation of statistics. More...
 
double g_time_between_run_checks
 Specifies periodicity in seconds of checking whether the program is allowed to run or not. (see run check configuration in configuration files) More...
 
UpdateGlobalAttractorMode g_update_global_attractor_mode
 Stores the information how often the global attractor is updated. More...
 
std::string g_user_defined_file_prefix
 User defined part of the file prefix. It is empty if the user has not specified it. More...
 
VelocityAdjustmentg_velocity_adjustment
 Specifies the method for velocity adjustment in case that the bound handling method was active. More...
 
std::vector< InitializationInformationg_velocity_initialization_informations
 Initialization informations for velocity initialization. More...
 

Detailed Description

Contains the variables which store information about the configuration for the particle swarm optimization algorithm (PSO).

Enumeration Type Documentation

Specification possibilities how the objective function is evaluated outside of the search space bounds.

Enumerator
FUNCTION_BEHAVIOR_OUTSIDE_OF_BOUNDS_INFINITY 

If the function is evaluated outside of the search space bounds always +infinity is returned.

FUNCTION_BEHAVIOR_OUTSIDE_OF_BOUNDS_NORMAL_EVALUATION 

If the function is evaluated outside of the search space bounds also the specified function is evaluated.

FUNCTION_BEHAVIOR_OUTSIDE_OF_BOUNDS_PERIODIC 

If the function is evaluated outside of the search space bounds, the function is repeated periodically and then evaluated.

If the search space bounds are [1,10]x[2,20] and it should be evaluated at (40,-10) then it will be evaluated at (4,8).

Specification possibilities for position or velocity initialization.

Enumerator
INITIALIZATION_INFORMATION_TYPE_BOUNDS 

InitializationInformation with this type contains an upper bound and a lower bound as well as the related dimension and particle range.

INITIALIZATION_INFORMATION_TYPE_CENTER_RANGE 

InitializationInformation with this type contains a center and a range as well as the related dimension and particle range.

INITIALIZATION_INFORMATION_TYPE_RANDOM_CENTER_RANGE 

InitializationInformation with this type contains an upper bound and a lower bound for the random center and a range as well as the related dimension and particle range.

INITIALIZATION_INFORMATION_TYPE_NORMAL_SCALE 

InitializationInformation with this type contains factor which scales the range of previously specified intervals as well as the related dimension and particle range.

INITIALIZATION_INFORMATION_TYPE_POWER_SCALE 

InitializationInformation with this type contains an exponential factor which scales the range of previously specified intervals as well as the related dimension and particle range.

Specification possibilities how the velocity is initialized.

Enumerator
INITIALIZE_VELOCITY_MODE_ZERO 

The velocity is initialized with a zero vector.

INITIALIZE_VELOCITY_MODE_HALFDIFF 

The velocity is initialized by sampling a second position and taking the half difference vector from the position to this second position.

INITIALIZE_VELOCITY_MODE_RANDOM 

The velocity is initialized randomly according to the diameter of the search space.

Specification possibilities how often the global attractor is updated.

Enumerator
UPDATE_GLOBAL_ATTRACTOR_MODE_EACH_ITERATION 

The global attractor is updated after each iteration is completed.

UPDATE_GLOBAL_ATTRACTOR_MODE_EACH_PARTICLE 

The global attractor is updated as soon as a better position appears.

I.e. if a particle finds a better position than the global attractor then the next particle directly works with this new position as global attractor.

Function Documentation

std::string highprecisionpso::configuration::GetConfigurationString ( )

Generates a short string, which includes the main information about the current configuration.

Returns
The generated configuration string.
std::string highprecisionpso::configuration::GetFilePrefix ( )

If a file prefix is already specified then this file prefix is returned. Otherwise the file prefix is generated.

Returns
The respective file prefix.
void highprecisionpso::configuration::Init ( )

Resets all variables in the configuration section to the default values.

bool highprecisionpso::configuration::ReadConfigurationFile ( std::string  fileName)

Reads data from the given configuration file and stores them in the configuration section.

Parameters
fileNameThe file name of the configuration file.
Returns
true if reading the file was successful and false otherwise.

Variable Documentation

BoundHandling* highprecisionpso::configuration::g_bound_handling

Specifies the bound handling method.

double highprecisionpso::configuration::g_chi

Inertia weight of PSO for movement equation.

double highprecisionpso::configuration::g_coefficient_global_attractor

Coefficient for the weight of the direction to the global attractor for the movement equation.

double highprecisionpso::configuration::g_coefficient_local_attractor

Coefficient for the weight of the direction to the local attractor for the movement equation.

bool highprecisionpso::configuration::g_debug_swarm_activated

Specifies whether the debug swarm mode is activated.

unsigned int highprecisionpso::configuration::g_debug_swarm_global_attractor_trajectory

Specifies how many of the previous global attractor positions are visualized.

std::string highprecisionpso::configuration::g_debug_swarm_gnuplot_terminal

Specifies the gnuplot terminal for image generation.

std::string highprecisionpso::configuration::g_debug_swarm_image_file_extension

Specifies the file extension for image generation with gnuplot.

unsigned int highprecisionpso::configuration::g_debug_swarm_image_generation_frequency

Specifies how often images are created.

bool highprecisionpso::configuration::g_debug_swarm_show_global_attractor_on_terminal

Specifies whether the position value and the function value of the particle swarm should be displayed at each iteration.

unsigned int highprecisionpso::configuration::g_debug_swarm_x_resolution

Specifies width in pixels of generated images.

unsigned int highprecisionpso::configuration::g_debug_swarm_y_resolution

Specifies height in pixels of generated images.

int highprecisionpso::configuration::g_dimensions

The number of dimensions of the search space for the particle swarm optimization algorithm.

std::string highprecisionpso::configuration::g_file_prefix

File prefix for all generated files. (Will be initialized in the first call of getFilePrefix)

Function* highprecisionpso::configuration::g_function

Specifies the objective function.

FunctionBehaviorOutsideOfBoundsMode highprecisionpso::configuration::g_function_behavior_outside_of_bounds_mode

Stores the information how the objective function is evaluated outside of the search space bounds.

std::vector<SearchSpaceBound> highprecisionpso::configuration::g_function_bounds

A list of search space bounds for the current objective function.

InitializeVelocityMode highprecisionpso::configuration::g_initialize_velocity_mode

Stores the information how the velocity should be initialized.

std::vector<std::vector<long long> > highprecisionpso::configuration::g_iterations_with_statistic_evaluations

Specifies at which steps / iterations statistical evaluations are done. Each vector entry contains 3 long long values which specify start iteration, end iteration and periodicity.

long long highprecisionpso::configuration::g_max_iterations

The number of iterations / steps for the particle swarm optimization algorithm. Specifies how many iterations of the particle swarm are done.

Neighborhood* highprecisionpso::configuration::g_neighborhood

Specifies the neighborhood topology.

int highprecisionpso::configuration::g_particles

The number of particles for the particle swarm optimization algorithm.

PositionAndVelocityUpdater* highprecisionpso::configuration::g_position_and_velocity_updater

Specifies the way how the positions and the velocities are updated at each iteration.

std::vector<InitializationInformation> highprecisionpso::configuration::g_position_initialization_informations

Initialization informations for position initialization.

std::vector<long long> highprecisionpso::configuration::g_preserve_backup_times

Contains a list of time steps at which backups of the current situation (positions, velocities, ... ) are stored.

std::string highprecisionpso::configuration::g_run_check_configuration_file

File name of the run check configuration file. If this value is the empty string then no run check is done.

bool highprecisionpso::configuration::g_show_system_time_in_file_prefix

Specifies whether the time and the date should be included in the generated files.

Statistics* highprecisionpso::configuration::g_statistics

Stores information about the current swarm situation.

std::vector<Statistic*> highprecisionpso::configuration::g_statistics_list

Contains a list of statistics which should be evaluated.

double highprecisionpso::configuration::g_time_between_backups

Specifies periodicity in seconds of the creation of backups and the continuation of statistics.

double highprecisionpso::configuration::g_time_between_run_checks

Specifies periodicity in seconds of checking whether the program is allowed to run or not. (see run check configuration in configuration files)

UpdateGlobalAttractorMode highprecisionpso::configuration::g_update_global_attractor_mode

Stores the information how often the global attractor is updated.

std::string highprecisionpso::configuration::g_user_defined_file_prefix

User defined part of the file prefix. It is empty if the user has not specified it.

VelocityAdjustment* highprecisionpso::configuration::g_velocity_adjustment

Specifies the method for velocity adjustment in case that the bound handling method was active.

std::vector<InitializationInformation> highprecisionpso::configuration::g_velocity_initialization_informations

Initialization informations for velocity initialization.