Skip to content

Commit 05c7ffd

Browse files
committed
Basic file structure for the different selection methods
1 parent 8130e6e commit 05c7ffd

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

dfmcontrol_C/Utility/selection.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
11
#include "stdio.h"
22
#include "stdlib.h"
33
#include "math.h"
4+
5+
#include "selection.h"
6+
7+
// gen purpose
8+
void calc_fx(float** pop, int individuals, int genes, float(*fx)(float), float** result){
9+
10+
}
11+
12+
// Flattening functions
13+
void lin_flattening(float** pop, int individuals, int genes, float a, float b,float** result){
14+
15+
}
16+
void exp_flattening(float** pop, int individuals, int genes, float a, float b,float** result){
17+
18+
}
19+
void log_flattening(float** pop, int individuals, int genes, float a, float b,float** result){
20+
21+
}
22+
void norm_flattening(float** pop, int individuals, int genes, float a, float b,float** result){
23+
24+
}
25+
void sig_flattening(float** pop, int individuals, int genes, float a, float b,float** result){
26+
27+
}
28+
void no_flattening(float** pop, int individuals, int genes, float a, float b,float** result){
29+
30+
}
31+
32+
33+
// Selection functions
34+
void roulette(float** pop, int individuals, int genes, float(*fx)(float),int mode, int** result){
35+
36+
}
37+
void rank_tournament_selection(float** pop, int individuals, int genes, float(*fx)(float), int tournament_size, float prob_param, int mode, int** result){
38+
39+
}
40+
void rank_selection(float** pop, int individuals, int genes, float(*fx)(float), float prob_param, int mode, int** result){
41+
42+
}
43+
void rank_space_selection(float** pop, int individuals, int genes, float(*fx)(float), float prob_param, float div_param, int mode, int** result){
44+
45+
}
46+
void boltzmann_selection(float** pop, int individuals, int genes, float(*fx)(float), float temp_param, int mode, int** result){
47+
48+
}

dfmcontrol_C/Utility/selection.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
#ifndef _Selection_
3+
#define _Selection_
4+
5+
// gen purpose
6+
void calc_fx(float** pop, int individuals, int genes, float(*fx)(float), float** result);
7+
8+
// Flattening functions
9+
void lin_flattening(float** pop, int individuals, int genes, float a, float b,float** result);
10+
void exp_flattening(float** pop, int individuals, int genes, float a, float b,float** result);
11+
void log_flattening(float** pop, int individuals, int genes, float a, float b,float** result);
12+
void norm_flattening(float** pop, int individuals, int genes, float a, float b,float** result);
13+
void sig_flattening(float** pop, int individuals, int genes, float a, float b,float** result);
14+
void no_flattening(float** pop, int individuals, int genes, float a, float b,float** result);
15+
16+
17+
// Selection functions
18+
void roulette(float** pop, int individuals, int genes, float(*fx)(float),int mode, int** result);
19+
void rank_tournament_selection(float** pop, int individuals, int genes, float(*fx)(float), int tournament_size, float prob_param, int mode, int** result);
20+
void rank_selection(float** pop, int individuals, int genes, float(*fx)(float), float prob_param, int mode, int** result);
21+
void rank_space_selection(float** pop, int individuals, int genes, float(*fx)(float), float prob_param, float div_param, int mode, int** result);
22+
void boltzmann_selection(float** pop, int individuals, int genes, float(*fx)(float), float temp_param, int mode, int** result);
23+
24+
#endif

0 commit comments

Comments
 (0)