📄 global_var.c
字号:
// Global variablesint adaptive; // 0 = constant criterium for Rehope, 1 = depending on current best resultfloat almostzero=0.0000000001;char answer[1];int auto_move_type;int batch;struct particle best_best;struct graph best_matrice; /* Just for visualization */int best_hood_type;// 0 = use best neighbour; 1 = use best neighbour's previous best//struct particle best_solution;double time; // Current time stepstruct graph BB[2]={0}; // Blackboard for long term swarm memoryint BB_option;int conv_case; // Cf. convergence_case()int effective_move;int equiv_v; // >0 = try to find as smaller equivalent velocity. 0 = do nothing. Cf equiv_vel()int explicit_vel; // 0 = no explicit velocity in move_towardsdouble eval_f; // Total number of individual evaluations//struct particle extra_best;struct graph G;int hood; // Neighbourhood sizeint hood_type; // 0 = social (ranks) 1= physical (distances)struct particle init;int init_option; // 0 => random; 1 => at least partly deterministicfloat integer_coeff;int iter,iter_min,iter_max;//int levelling; // 0 = no Local Iterative Levelling; >0 = LIL//int LIL;// initial value for "levelling", each time Rehope is performedfloat kappa;int monotony; // Cf : 0=none. 1= on f value. 2= on distanceint move[10];float phi;int reduce; // 0 = no reduced swarm ; 1 = try to reduce the swarmint same_best; // How many times the extra_best is still the sameint same_best_thresh; // Threshold for NoHope for this criterionfloat same_best_val; // Last extra_best valueint save;int seed=1; /* For reinitialize rand() function */int size_max;int splice_around_option; // 0 = whole swarm, 1 = just neighbourhoodint splice_time;int step; // if =1, check previous_best at each substepint subst_option; // 0 = try to improve the current position, 1=try to improve the best previous positionstruct swarm sw1,sw2;float target;int trace; // Just to display more or less information during the process int type_dist; // 0 = "distance" depending on common arcs; 1 = true distancestruct val val; // Cf graph_min_tourFILE *f_trace;FILE *f_batch_param;FILE *f_batch_run;FILE *f_graph; // File containing the graph FILE *f_run; // To save swarm positions, for each iterationFILE *f_trace;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -