📄 combinatorial_kit.h
字号:
/*
Combinatorial kit
Maurice.Clerc@WriteMe.com
2001-03-01
You can use this kit when a position is just a list of numbers which _code_ some features, but
whose numerical values have no special meaning.
Example:
position_1=(0,1,3,0,4)
position_2=(1,1,2,3,2)
Then, a "velocity" is just a set of pairs indicating how to go from position_1 to position_2
vel= { (0,1), (3,2),(0,3) (4,2)}. Velocity size=4
With the following subroutines, you can generate random velocities,
and combine positions, velocities and coefficients, to apply PSO equations.
In addition, there is also a special local search (auto_move) you may want to use when there is no hope ...
Note that for some problems (Fifty-fifty, Magic square etc.) it is not clear you have to solve them
using the Combinatorial kit or not.
Theoretically, they are _not_ combinatorial, for the values mean something, but, on the other hand,
the way they should be manipulated _is_ combinatorial.
*/
struct velocity alea_velocity(int size,struct param param);
struct particle auto_move(struct particle p,struct param param, struct model model);
struct velocity pos_minus_pos(struct position p1,struct position p2, int trace);
struct velocity coeff_times_vel(struct velocity v,float coeff, struct param param);
struct velocity coeff_times_vel2(struct velocity v1,struct velocity v2,float c1,float c2,int rank);
struct position pos_plus_vel(struct position p,struct velocity v,struct param param);
struct velocity vel_plus_vel(struct velocity v1,struct velocity v2,struct param param);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -