delta_updater.h
Go to the documentation of this file.
1 
40 #ifndef HIGH_PRECISION_PSO_POSITION_AND_VELOCITY_UPDATER_DELTA_UPDATER_H_
41 #define HIGH_PRECISION_PSO_POSITION_AND_VELOCITY_UPDATER_DELTA_UPDATER_H_
42 
43 #include <fstream>
44 #include <gmp.h>
45 #include <vector>
46 
48 
49 namespace highprecisionpso {
50 
60 public:
66  DeltaUpdater(double delta);
76  DeltaUpdater(double initial_delta, double gamma);
85  void Update(Particle* p);
86  std::string GetName();
87  void LoadData(std::ifstream* input_stream, ProgramVersion* version_of_stored_data);
88  void StoreData(std::ofstream* output_stream);
89 
102  virtual std::vector<bool> DimensionsOfDeltaUpdate(Particle* p);
110  std::vector<std::vector<unsigned long long> > NumberOfDeltaUpdates();
111 protected:
112  mpf_t* delta_;
113  const double initial_delta_;
114  const double gamma_;
115 private:
116  void CheckInitDeltaUpdateCounters_();
117  std::vector<std::vector<unsigned long long> > delta_update_counters_;
118 };
119 
129 public:
135  DeltaUpdaterTCS(double delta);
145  DeltaUpdaterTCS(double initial_delta, double gamma);
146 
159  virtual std::vector<bool> DimensionsOfDeltaUpdate(Particle* p);
160 
161  std::string GetName();
162 };
163 } // namespace highprecisionpso
164 
165 #endif /* HIGH_PRECISION_PSO_POSITION_AND_VELOCITY_UPDATER_DELTA_UPDATER_H_ */
166 
virtual std::vector< bool > DimensionsOfDeltaUpdate(Particle *p)
Determines in which dimensions the delta update should be applied.
The particles for the particle swarm optimization algorithm.
Definition: particle.h:54
std::vector< std::vector< unsigned long long > > NumberOfDeltaUpdates()
Returns the number of delta updates per particle and dimension.
This file contains an abstract class for processing the velocity and position update of each particle...
void Update(Particle *p)
Processes a single movement of the specified particle.
This class is an abstract class for processing the velocity and position update of each particle...
Definition: position_and_velocity_updater.h:55
This class stores a program version.
Definition: general_objects.h:54
std::string GetName()
Returns a string representation of this object.
void StoreData(std::ofstream *output_stream)
Stores the current state of this position and velocity updater such that it can completely restore th...
The delta updater implements a specific position and velocity update procedure.
Definition: delta_updater.h:128
void LoadData(std::ifstream *input_stream, ProgramVersion *version_of_stored_data)
Loads data to reset the state of the position and velocity updater to the state which was stored...
DeltaUpdater(double delta)
The constructor, where the fixed bound for sum of absolute velocities and distance to the global opti...
The delta updater implements a specific position and velocity update procedure.
Definition: delta_updater.h:59
base namespace for this project.
Definition: absorption.h:45