solutionea.h

来自「随机需求vrp」· C头文件 代码 · 共 45 行

H
45
字号
#ifndef SOLUTIONEA_H#define SOLUTIONEA_H#include <vector>#include "Solution.h"#include "Problem.h"#include "Control.h"#include "Random.h"/*SolutionEA.hThe class SolutionEA is a derived class of Solution implemeting a solution in the VRPSD with the preventive restocking policy.It contains permutation based crossover and mutation methods, some based on the PGA code by Peter Ross and Emma Hart, for a simple evolutionary algorithm.*/class SolutionEA : public Solution {  //A solution used for the evolutionary algorithm is actually a solution for   //the VRPSD with pre-emptive restocking.  //In addition it contains crossover and mutation methods used by the EA.public:  SolutionEA( Random* rnd, Control& control, Problem* );    void no_crossover(SolutionEA* parent1, SolutionEA* parent2);  void pmx_crossover(SolutionEA* parent1, SolutionEA* parent2);  void ox_crossover(SolutionEA* parent1, SolutionEA* parent2);  void edge_crossover(SolutionEA* parent1, SolutionEA* parent2);  void inverover(SolutionEA* pop, int popSize);  void swap_mute(double rate);  void obm_mute(double rate);  void inversion(double rate);protected:  int addToList(int* adj_list, int len, int val);  void removeFromList(int* adj_list, int len, int val);};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?