git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@85 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
a15b1581ac
commit
8af73b559a
58 changed files with 0 additions and 25620 deletions
|
|
@ -1 +0,0 @@
|
|||
SUBDIRS=tsp
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
AM_CXXFLAGS =\
|
||||
-Wall
|
||||
|
||||
SUBDIRS=share
|
||||
|
||||
INCLUDES = -I${EO_DIR}/src/ -I../../src/
|
||||
|
||||
bin_PROGRAMS = hill_climb simul_anneal tabu_search gen_algo mimetic
|
||||
|
||||
# Simple Hill Climbing
|
||||
hill_climb_SOURCES = \
|
||||
hill_climb.cpp
|
||||
|
||||
hill_climb_LDFLAGS =
|
||||
|
||||
hill_climb_LDADD = share/libtsp_share.a ${EO_DIR}/src/libeo.a ${EO_DIR}/src/utils/libeoutils.a
|
||||
|
||||
# Simple Simulated Annealing
|
||||
simul_anneal_SOURCES = \
|
||||
simul_anneal.cpp
|
||||
|
||||
simul_anneal_LDFLAGS =
|
||||
|
||||
simul_anneal_LDADD = share/libtsp_share.a ${EO_DIR}/src/libeo.a ${EO_DIR}/src/utils/libeoutils.a
|
||||
|
||||
# Simple Tabu Search
|
||||
tabu_search_SOURCES = \
|
||||
tabu_search.cpp
|
||||
|
||||
tabu_search_LDFLAGS =
|
||||
|
||||
tabu_search_LDADD = share/libtsp_share.a ${EO_DIR}/src/libeo.a ${EO_DIR}/src/utils/libeoutils.a
|
||||
|
||||
# Simple Genetic Algorithm
|
||||
gen_algo_SOURCES = \
|
||||
gen_algo.cpp
|
||||
|
||||
gen_algo_LDFLAGS =
|
||||
|
||||
gen_algo_LDADD = share/libtsp_share.a ${EO_DIR}/src/libeo.a ${EO_DIR}/src/utils/libeoutils.a
|
||||
|
||||
# Simple Mimetic Algorithm
|
||||
mimetic_SOURCES = \
|
||||
mimetic.cpp
|
||||
|
||||
mimetic_LDFLAGS =
|
||||
|
||||
mimetic_LDADD = share/libtsp_share.a ${EO_DIR}/src/libeo.a ${EO_DIR}/src/utils/libeoutils.a
|
||||
|
||||
|
|
@ -1,536 +0,0 @@
|
|||
535
|
||||
36.49 7.49
|
||||
57.06 9.51
|
||||
30.22 48.14
|
||||
5.15 -3.56
|
||||
34.59 -106.37
|
||||
57.12 -2.12
|
||||
16.45 -99.45
|
||||
5.36 -0.1
|
||||
28.56 -13.36
|
||||
8.59 38.48
|
||||
12.5 45.02
|
||||
-34.48 138.38
|
||||
30.23 -9.33
|
||||
56.18 12.51
|
||||
36.4 -4.3
|
||||
40.38 8.17
|
||||
35.11 -3.5
|
||||
41.55 8.48
|
||||
-37.01 174.47
|
||||
38.17 -0.34
|
||||
36.42 3.13
|
||||
36.11 37.14
|
||||
35.14 -101.42
|
||||
31.58 35.59
|
||||
52.18 4.46
|
||||
61.1 -149.59
|
||||
39.57 32.41
|
||||
51.11 4.28
|
||||
17.08 -61.47
|
||||
43.37 13.22
|
||||
29.38 35.01
|
||||
59.39 17.55
|
||||
15.18 38.55
|
||||
-25.14 -57.31
|
||||
23.58 32.47
|
||||
37.54 23.44
|
||||
33.46 -84.31
|
||||
12.3 -70.01
|
||||
24.26 54.28
|
||||
36.55 30.48
|
||||
26.16 50.38
|
||||
40.29 50.01
|
||||
39.11 -76.4
|
||||
10.48 -74.52
|
||||
-16.11 -52.3
|
||||
10.25 45.01
|
||||
41.18 2.05
|
||||
32.22 -64.42
|
||||
41.56 -72.41
|
||||
40.39 17.57
|
||||
44.49 20.19
|
||||
9.21 34.31
|
||||
32.06 20.16
|
||||
52.29 13.24
|
||||
48.27 -4.25
|
||||
-19.48 3.45
|
||||
33.49 35.29
|
||||
54.39 -6.14
|
||||
35.48 -101.22
|
||||
4.24 18.31
|
||||
13.04 -59.3
|
||||
60.17 5.13
|
||||
44.48 -68.5
|
||||
33.14 44.14
|
||||
45.4 9.24
|
||||
33.34 -86.45
|
||||
52.27 -1.45
|
||||
42.33 9.29
|
||||
45.48 -108.37
|
||||
43.28 -1.32
|
||||
13.21 -16.4
|
||||
-3.19 29.19
|
||||
13.55 100.36
|
||||
12.38 -8.02
|
||||
55.44 9.09
|
||||
44.32 11.18
|
||||
12.57 77.4
|
||||
-15.41 34.58
|
||||
27.13 56.22
|
||||
-27.25 153.05
|
||||
44.5 -0.43
|
||||
4.42 -74.09
|
||||
50.47 -1.51
|
||||
19.05 72.52
|
||||
67.16 14.22
|
||||
42.22 -71
|
||||
53.03 8.48
|
||||
41.08 16.47
|
||||
46.55 7.3
|
||||
51.31 -2.35
|
||||
50.54 4.29
|
||||
-15.52 -47.55
|
||||
47.35 7.32
|
||||
48.1 16.13
|
||||
47.27 19.15
|
||||
-34.49 -58.32
|
||||
42.55 -78.38
|
||||
44.3 26.06
|
||||
49.27 2.07
|
||||
-4.15 15.15
|
||||
39.15 9.04
|
||||
30.08 31.24
|
||||
23.11 113.16
|
||||
33.33 -7.4
|
||||
-11.54 22.45
|
||||
4.49 -52.22
|
||||
52.13 0.11
|
||||
-35.19 149.12
|
||||
10.36 -66.59
|
||||
22.39 88.27
|
||||
52.5 -1.19
|
||||
49.01 2.33
|
||||
43.33 6.57
|
||||
45.4 -0.19
|
||||
39.37 19.55
|
||||
50.52 7.09
|
||||
41.59 -87.54
|
||||
41.48 12.36
|
||||
9.34 -13.37
|
||||
41.25 -81.51
|
||||
3.26 -76.25
|
||||
42.31 8.48
|
||||
-28.02 145.37
|
||||
7.11 79.53
|
||||
40.04 -83.04
|
||||
33.22 -7.35
|
||||
48.07 7.22
|
||||
44.22 28.29
|
||||
45.4 -0.19
|
||||
6.21 2.23
|
||||
55.37 12.39
|
||||
-33.58 18.36
|
||||
37.28 15.04
|
||||
10.27 -75.31
|
||||
-26.25 146.14
|
||||
39 17.05
|
||||
12.12 -68.57
|
||||
39.09 -84.2
|
||||
39.03 -84.2
|
||||
51.24 -3.12
|
||||
29.11 -81.03
|
||||
23.46 90.23
|
||||
14.45 42.59
|
||||
32.5 -96.51
|
||||
33.25 36.31
|
||||
-6.53 39.12
|
||||
42.34 18.16
|
||||
-29.58 30.57
|
||||
38.51 -77.02
|
||||
28.34 77.07
|
||||
39.46 -104.53
|
||||
32.46 -96.24
|
||||
26.16 50.1
|
||||
47.16 5.05
|
||||
33.52 10.47
|
||||
14.45 -17.3
|
||||
4.01 9.43
|
||||
19.08 30.26
|
||||
25.16 51.34
|
||||
49.22 0.1
|
||||
-8.45 115.1
|
||||
51.08 13.46
|
||||
-12.25 130.52
|
||||
42.14 -83.32
|
||||
42.13 -83.21
|
||||
53.26 -6.15
|
||||
51.17 6.45
|
||||
25.15 55.2
|
||||
0.03 32.26
|
||||
45.32 4.18
|
||||
55.57 -3.22
|
||||
51.27 5.23
|
||||
31.48 -106.16
|
||||
52.5 -1.19
|
||||
48.19 6.04
|
||||
40.07 33
|
||||
40.09 82.4
|
||||
40.42 -74.1
|
||||
50.44 -3.25
|
||||
-34.49 -58.32
|
||||
64.49 -147.51
|
||||
37.01 -7.58
|
||||
-11.35 27.31
|
||||
59.54 10.37
|
||||
41.49 12.15
|
||||
14.35 -61
|
||||
33.56 45.8
|
||||
-4.23 15.26
|
||||
43.49 11.12
|
||||
8.37 -13.12
|
||||
41.26 15.32
|
||||
50.02 8.34
|
||||
44.12 12.04
|
||||
-21.13 27.29
|
||||
28.27 -13.52
|
||||
53.29 -1
|
||||
-19.27 29.52
|
||||
54.23 18.28
|
||||
60.12 11.05
|
||||
24.57 10.1
|
||||
-22.5 -43.15
|
||||
55.52 -4.26
|
||||
45.22 5.2
|
||||
7.09 41.43
|
||||
44.25 8.5
|
||||
57.4 18.18
|
||||
41.54 2.46
|
||||
37.11 -3.47
|
||||
47 15.26
|
||||
51.09 -0.11
|
||||
14.34 -90.32
|
||||
46.14 6.07
|
||||
-2.09 -79.53
|
||||
52.28 9.42
|
||||
53.38 10
|
||||
60.19 24.58
|
||||
35.2 25.11
|
||||
30.2 120.51
|
||||
22.19 114.12
|
||||
31.4 6.09
|
||||
35.33 139.46
|
||||
21.2 -157.55
|
||||
29.59 -95.28
|
||||
38.57 -77.27
|
||||
43.06 -78.57
|
||||
38.52 1.22
|
||||
47.34 -97.27
|
||||
50.21 30.55
|
||||
-25.44 -54.28
|
||||
39.44 -86.17
|
||||
40.59 28.49
|
||||
38.17 27.1
|
||||
21.3 39.12
|
||||
49.13 -2.12
|
||||
40.38 -73.46
|
||||
11.33 43.1
|
||||
-6.09 106.51
|
||||
-26.08 28.15
|
||||
-3.22 36.38
|
||||
45.28 -73.44
|
||||
12.03 8.31
|
||||
34.34 69.12
|
||||
63.59 -22.37
|
||||
-1.58 30.08
|
||||
22.34 120.17
|
||||
24.54 67.09
|
||||
-6.18 155.43
|
||||
17.56 -76.48
|
||||
50.05 19.47
|
||||
15.36 32.33
|
||||
27.42 85.22
|
||||
3.08 101.33
|
||||
29.13 47.58
|
||||
-8.51 13.14
|
||||
10.36 -66.59
|
||||
36.04 -115.09
|
||||
33.56 -118.24
|
||||
53.52 -1.39
|
||||
48.58 2.27
|
||||
0.27 9.25
|
||||
34.52 33.38
|
||||
43.11 0
|
||||
59.49 30.17
|
||||
36.51 -2.22
|
||||
51.24 12.25
|
||||
51.25 12.14
|
||||
6.1 1.15
|
||||
40.46 -73.52
|
||||
33.57 -118.24
|
||||
50.38 5.27
|
||||
51.09 -0.11
|
||||
51.28 -0.27
|
||||
50.34 3.05
|
||||
-12.01 -77.07
|
||||
45.27 9.16
|
||||
38.46 -9.08
|
||||
46.13 14.28
|
||||
35.3 12.37
|
||||
48.14 14.11
|
||||
51.28 -0.27
|
||||
6.35 3.2
|
||||
27.56 -15.23
|
||||
-16.3 -68.11
|
||||
53.21 -2.53
|
||||
6.1 1.15
|
||||
51.53 -0.22
|
||||
-25.55 32.34
|
||||
-15.2 28.27
|
||||
4.27 114
|
||||
49.37 6.12
|
||||
-17.49 25.49
|
||||
25.41 32.43
|
||||
45.44 4.56
|
||||
13 80.11
|
||||
40.29 -3.34
|
||||
31.52 -4.13
|
||||
53.21 -2.16
|
||||
-3.04 -60
|
||||
10.34 -71.44
|
||||
-4.02 39.36
|
||||
46.22 15.47
|
||||
39.18 -94.44
|
||||
28.32 -81.2
|
||||
23.36 58.17
|
||||
44.25 8.5
|
||||
-37.44 144.54
|
||||
24.31 39.42
|
||||
-37.41 144.51
|
||||
19.26 -99.04
|
||||
12.07 -86.11
|
||||
2.01 45.19
|
||||
25.48 -80.17
|
||||
20.56 -89.41
|
||||
45.27 9.16
|
||||
35.45 10.45
|
||||
39.07 -94.36
|
||||
35.52 14.29
|
||||
4.11 73.32
|
||||
47.45 7.26
|
||||
55.33 13.22
|
||||
54.31 -1.25
|
||||
14.31 121.01
|
||||
55.58 37.25
|
||||
43.35 3.58
|
||||
-25.55 32.34
|
||||
-8.58 125.13
|
||||
43.26 5.13
|
||||
-20.26 57.41
|
||||
51.21 1.21
|
||||
44.53 -93.13
|
||||
53.52 27.33
|
||||
50.55 5.47
|
||||
29.59 -90.16
|
||||
-26.31 31.19
|
||||
48.08 11.42
|
||||
-34.5 -56.02
|
||||
45.38 8.43
|
||||
49.05 6.08
|
||||
-17.45 177.27
|
||||
40.53 14.18
|
||||
25.02 -77.28
|
||||
-1.19 36.56
|
||||
43.4 7.13
|
||||
55.02 -1.41
|
||||
45.56 6.06
|
||||
12.08 15.02
|
||||
32.56 129.56
|
||||
35.09 36.17
|
||||
13.29 2.1
|
||||
18.06 -15.57
|
||||
-13 28.39
|
||||
58.35 16.15
|
||||
35.45 140.23
|
||||
47.09 -1.36
|
||||
49.3 11.05
|
||||
52.41 1.17
|
||||
40.38 -73.46
|
||||
55.28 10.2
|
||||
46.26 30.41
|
||||
26.21 127.46
|
||||
35.26 -97.46
|
||||
40.54 9.31
|
||||
41.07 -95.55
|
||||
41.14 -8.41
|
||||
41.59 -87.54
|
||||
51.5 -8.29
|
||||
28.26 -81.19
|
||||
35.38 -0.37
|
||||
48.43 2.23
|
||||
34.47 135.27
|
||||
60.12 11.05
|
||||
51.12 2.52
|
||||
44.34 26.06
|
||||
12.21 -1.31
|
||||
43.26 -5.5
|
||||
18.34 -72.17
|
||||
48.43 2.23
|
||||
40.05 116.36
|
||||
-31.56 115.58
|
||||
4.52 7.02
|
||||
37.08 -76.3
|
||||
39.52 -75.15
|
||||
33.26 -112.01
|
||||
55.52 -4.26
|
||||
46.35 0.18
|
||||
40.3 -80.14
|
||||
-5.15 39.49
|
||||
39.33 2.44
|
||||
38.1 13.06
|
||||
11.33 104.51
|
||||
36.49 11.58
|
||||
-9.27 147.13
|
||||
10.36 -61.21
|
||||
9.05 -79.23
|
||||
50.06 14.16
|
||||
43.41 10.24
|
||||
42.26 14.11
|
||||
16.16 -61.32
|
||||
9.03 -79.24
|
||||
43.23 -0.25
|
||||
45.39 12.12
|
||||
31.37 -8.03
|
||||
34.03 -6.45
|
||||
-8.08 -34.55
|
||||
38.04 15.39
|
||||
64.08 -21.57
|
||||
16.54 96.09
|
||||
49.19 4.03
|
||||
36.23 28.07
|
||||
-29.43 -53.42
|
||||
-22.5 -43.15
|
||||
45.13 14.35
|
||||
44.01 12.37
|
||||
48.04 -1.44
|
||||
6.14 -10.22
|
||||
41.49 12.15
|
||||
14.1 145.15
|
||||
-32.55 -60.47
|
||||
51.57 4.26
|
||||
24.42 46.44
|
||||
33.37 73.06
|
||||
6.3 -58.15
|
||||
15.29 44.13
|
||||
13.42 -89.07
|
||||
32.44 -117.11
|
||||
-23 -47.08
|
||||
29.32 -98.28
|
||||
-17.56 31.06
|
||||
48.31 -24.8
|
||||
-33.23 -70.47
|
||||
42.54 -8.25
|
||||
33.14 44.14
|
||||
18.26 -69.4
|
||||
47.27 -122.18
|
||||
27 14.27
|
||||
37.33 126.48
|
||||
51.34 0.42
|
||||
-4.4 55.31
|
||||
37.37 -122.23
|
||||
31.12 121.2
|
||||
25.21 55.24
|
||||
16.45 -22.57
|
||||
1.21 103.54
|
||||
37.22 -121.56
|
||||
43.49 18.2
|
||||
9.58 -84.16
|
||||
9.59 -84.12
|
||||
18.26 -66.01
|
||||
40.31 22.58
|
||||
41.58 21.38
|
||||
40.53 -111.57
|
||||
36.58 -25.1
|
||||
52.42 -8.55
|
||||
42.42 23.24
|
||||
43.32 16.18
|
||||
-12.54 -38.2
|
||||
38.45 -90.22
|
||||
51.33 0.14
|
||||
59.39 17.55
|
||||
48.41 9.13
|
||||
38.54 16.15
|
||||
58.53 5.38
|
||||
55.58 37.25
|
||||
37.26 -5.54
|
||||
48.32 7.38
|
||||
52.22 13.3
|
||||
-33.56 151.1
|
||||
29.33 52.36
|
||||
47.48 13
|
||||
40.31 17.24
|
||||
41.19 69.24
|
||||
28.29 -16.2
|
||||
38.31 -28.43
|
||||
43.11 0
|
||||
28.29 -16.2
|
||||
14.02 -87.14
|
||||
52.29 13.24
|
||||
35.41 51.19
|
||||
41.2 19.47
|
||||
32.4 13.09
|
||||
43.37 1.23
|
||||
32.01 34.53
|
||||
22.49 5.27
|
||||
0.23 6.43
|
||||
35.43 -5.55
|
||||
-18.48 47.29
|
||||
33.56 8.06
|
||||
-24.42 -53.42
|
||||
25.04 121.33
|
||||
37.55 12.29
|
||||
51.23 -2.43
|
||||
45.12 7.39
|
||||
45.5 13.28
|
||||
45.39 12.12
|
||||
47.26 0.43
|
||||
36.18 -95.52
|
||||
36.51 10.14
|
||||
52.34 13.18
|
||||
35.33 139.46
|
||||
35.54 -83.53
|
||||
40.62 13.11
|
||||
-0.08 -78.29
|
||||
12.41 101.01
|
||||
13.45 -60.57
|
||||
44.55 4.58
|
||||
43.14 27.49
|
||||
45.3 12.21
|
||||
-23 -47.08
|
||||
48.07 16.33
|
||||
39.29 -0.29
|
||||
41.42 -4.51
|
||||
45.24 10.53
|
||||
38.57 -77.27
|
||||
52.1 20.58
|
||||
36.45 -6.04
|
||||
53.19 -113.35
|
||||
44.53 -63.31
|
||||
45.41 -74.02
|
||||
45.19 -75.4
|
||||
46.48 -71.24
|
||||
42.16 -82.58
|
||||
48.57 -54.34
|
||||
45.28 -73.44
|
||||
49.11 -123.1
|
||||
49.55 -97.14
|
||||
51.07 -114.01
|
||||
47.37 -52.45
|
||||
43.41 -79.38
|
||||
44.06 15.21
|
||||
45.45 16.04
|
||||
41.4 -1.03
|
||||
-6.13 39.13
|
||||
47.28 8.33
|
||||
51.33 0.14
|
||||
24.58 91.53
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
101
|
||||
41 49
|
||||
35 17
|
||||
55 45
|
||||
55 20
|
||||
15 30
|
||||
25 30
|
||||
20 50
|
||||
10 43
|
||||
55 60
|
||||
30 60
|
||||
20 65
|
||||
50 35
|
||||
30 25
|
||||
15 10
|
||||
30 5
|
||||
10 20
|
||||
5 30
|
||||
20 40
|
||||
15 60
|
||||
45 65
|
||||
45 20
|
||||
45 10
|
||||
55 5
|
||||
65 35
|
||||
65 20
|
||||
45 30
|
||||
35 40
|
||||
41 37
|
||||
64 42
|
||||
40 60
|
||||
31 52
|
||||
35 69
|
||||
53 52
|
||||
65 55
|
||||
63 65
|
||||
2 60
|
||||
20 20
|
||||
5 5
|
||||
60 12
|
||||
40 25
|
||||
42 7
|
||||
24 12
|
||||
23 3
|
||||
11 14
|
||||
6 38
|
||||
2 48
|
||||
8 56
|
||||
13 52
|
||||
6 68
|
||||
47 47
|
||||
49 58
|
||||
27 43
|
||||
37 31
|
||||
57 29
|
||||
63 23
|
||||
53 12
|
||||
32 12
|
||||
36 26
|
||||
21 24
|
||||
17 34
|
||||
12 24
|
||||
24 58
|
||||
27 69
|
||||
15 77
|
||||
62 77
|
||||
49 73
|
||||
67 5
|
||||
56 39
|
||||
37 47
|
||||
37 56
|
||||
57 68
|
||||
47 16
|
||||
44 17
|
||||
46 13
|
||||
49 11
|
||||
49 42
|
||||
53 43
|
||||
61 52
|
||||
57 48
|
||||
56 37
|
||||
55 54
|
||||
15 47
|
||||
14 37
|
||||
11 31
|
||||
16 22
|
||||
4 18
|
||||
28 18
|
||||
26 52
|
||||
26 35
|
||||
31 67
|
||||
15 19
|
||||
22 22
|
||||
18 24
|
||||
26 27
|
||||
25 24
|
||||
22 27
|
||||
25 21
|
||||
19 21
|
||||
20 26
|
||||
18 18
|
||||
35 35
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,35 +0,0 @@
|
|||
NAME : eil101
|
||||
COMMENT : 101-city problem (Christofides/Eilon)
|
||||
TYPE : TSP
|
||||
DIMENSION : 101
|
||||
EDGE_WEIGHT_TYPE : EUC_2D
|
||||
|
||||
NAME: ali535
|
||||
TYPE: TSP
|
||||
COMMENT: 535 Airports around the globe (Padberg/Rinaldi)
|
||||
DIMENSION: 535
|
||||
EDGE_WEIGHT_TYPE: GEO
|
||||
DISPLAY_DATA_TYPE: COORD_DISPLAY
|
||||
|
||||
NAME : pr2392
|
||||
COMMENT : 2392-city problem (Padberg/Rinaldi)
|
||||
TYPE : TSP
|
||||
DIMENSION : 2392
|
||||
EDGE_WEIGHT_TYPE : EUC_2D
|
||||
|
||||
NAME : rl5915
|
||||
COMMENT : 5915-city TSP (Reinelt)
|
||||
TYPE : TSP
|
||||
DIMENSION : 5915
|
||||
EDGE_WEIGHT_TYPE : EUC_2D
|
||||
|
||||
NAME : usa13509
|
||||
COMMENT : Cities with population at least 500 in the continental US.
|
||||
COMMENT : Contributed by David Applegate and Andre Rohe, based on the
|
||||
COMMENT : data set "US.lat-long" from the ftp site ftp.cs.toronto.edu.
|
||||
COMMENT : The file US.lat-long.Z can be found in the directory /doc/geography.
|
||||
TYPE : TSP
|
||||
DIMENSION : 13509
|
||||
EDGE_WEIGHT_TYPE : EUC_2D
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Binary file not shown.
|
|
@ -1,83 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "gen_algo.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <eoEasyEA.h>
|
||||
#include <eoGenContinue.h>
|
||||
#include <eoStochTournamentSelect.h>
|
||||
#include <eoSGATransform.h>
|
||||
#include <eoSelectNumber.h>
|
||||
|
||||
#include "share/graph.h"
|
||||
#include "share/route.h"
|
||||
#include "share/route_init.h"
|
||||
#include "share/route_eval.h"
|
||||
#include "share/order_xover.h"
|
||||
#include "share/partial_mapped_xover.h"
|
||||
#include "share/city_swap.h"
|
||||
|
||||
int main (int __argc, char * __argv []) {
|
||||
|
||||
if (__argc != 2) {
|
||||
|
||||
std :: cerr << "Usage : ./gen_algo [instance]" << std :: endl ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
Graph :: load (__argv [1]) ; // Instance
|
||||
|
||||
RouteInit init ; // Sol. Random Init.
|
||||
|
||||
RouteEval full_eval ; // Full Evaluator
|
||||
|
||||
eoPop <Route> pop (100, init) ; // Population
|
||||
apply <Route> (full_eval, pop) ;
|
||||
|
||||
std :: cout << "[From] " << pop.best_element () << std :: endl ;
|
||||
|
||||
eoGenContinue <Route> cont (1000) ; /* Continuator (A fixed number of
|
||||
1000 iterations */
|
||||
|
||||
eoStochTournamentSelect <Route> select_one ; // Selector
|
||||
|
||||
eoSelectNumber <Route> select (select_one, 100) ;
|
||||
|
||||
// OrderXover cross ; // Order Crossover
|
||||
PartialMappedXover cross ;
|
||||
|
||||
CitySwap mut ; // City Swap Mutator
|
||||
|
||||
eoSGATransform <Route> transform (cross, 1, mut, 0.01) ;
|
||||
|
||||
eoElitism <Route> merge (1) ; // Use of Elistism
|
||||
|
||||
eoStochTournamentTruncate <Route> reduce (0.7) ; // Stoch. Replacement
|
||||
|
||||
eoEasyEA <Route> ea (cont, full_eval, select, transform, merge, reduce) ;
|
||||
|
||||
ea (pop) ;
|
||||
|
||||
std :: cout << "[To] " << pop.best_element () << std :: endl ;
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
|
@ -1,81 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "hill_climb.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <moHC.h>
|
||||
#include <moFirstImprSelect.h>
|
||||
#include <moBestImprSelect.h>
|
||||
#include <moRandImprSelect.h>
|
||||
|
||||
#include "share/graph.h"
|
||||
#include "share/route.h"
|
||||
#include "share/route_eval.h"
|
||||
#include "share/route_init.h"
|
||||
|
||||
#include "share/two_opt.h"
|
||||
#include "share/two_opt_init.h"
|
||||
#include "share/two_opt_next.h"
|
||||
#include "share/two_opt_incr_eval.h"
|
||||
|
||||
int main (int __argc, char * __argv []) {
|
||||
|
||||
if (__argc != 2) {
|
||||
|
||||
std :: cerr << "Usage : ./hill_climb [instance]" << std :: endl ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
srand (1000) ;
|
||||
|
||||
Graph :: load (__argv [1]) ; // Instance
|
||||
|
||||
Route route ; // Solution
|
||||
|
||||
RouteInit init ; // Sol. Random Init.
|
||||
init (route) ;
|
||||
|
||||
RouteEval full_eval ; // Full. Eval.
|
||||
full_eval (route) ;
|
||||
|
||||
std :: cout << "[From] " << route << std :: endl ;
|
||||
|
||||
/* Tools for an efficient (? :-))
|
||||
local search ! */
|
||||
|
||||
TwoOptInit two_opt_init ; // Init.
|
||||
|
||||
TwoOptNext two_opt_next ; // Explorer.
|
||||
|
||||
TwoOptIncrEval two_opt_incr_eval ; // Eff. eval.
|
||||
|
||||
//moFirstImprSelect <TwoOpt> two_opt_select ;
|
||||
moBestImprSelect <TwoOpt> two_opt_select ;
|
||||
//moRandImprSelect <TwoOpt> two_opt_select ;
|
||||
|
||||
moHC <TwoOpt> hill_climb (two_opt_init, two_opt_next, two_opt_incr_eval, two_opt_select, full_eval) ;
|
||||
hill_climb (route) ;
|
||||
|
||||
std :: cout << "[To] " << route << std :: endl ;
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
|
@ -1,98 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "mimetic.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <eoEasyEA.h>
|
||||
#include <eoGenContinue.h>
|
||||
#include <eoStochTournamentSelect.h>
|
||||
#include <eoSGATransform.h>
|
||||
#include <eoSelectNumber.h>
|
||||
|
||||
#include <moHC.h>
|
||||
#include <moFirstImprSelect.h>
|
||||
#include <moBestImprSelect.h>
|
||||
#include <moRandImprSelect.h>
|
||||
|
||||
#include "share/graph.h"
|
||||
#include "share/route.h"
|
||||
#include "share/route_init.h"
|
||||
#include "share/route_eval.h"
|
||||
#include "share/order_xover.h"
|
||||
|
||||
#include "share/two_opt.h"
|
||||
#include "share/two_opt_init.h"
|
||||
#include "share/two_opt_next.h"
|
||||
#include "share/two_opt_incr_eval.h"
|
||||
|
||||
int main (int __argc, char * __argv []) {
|
||||
|
||||
if (__argc != 2) {
|
||||
|
||||
std :: cerr << "Usage : ./mimetic [instance]" << std :: endl ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
Graph :: load (__argv [1]) ; // Instance
|
||||
|
||||
RouteInit init ; // Sol. Random Init.
|
||||
|
||||
RouteEval full_eval ; // Full Evaluator
|
||||
|
||||
eoPop <Route> pop (100, init) ; // Population
|
||||
apply <Route> (full_eval, pop) ;
|
||||
|
||||
std :: cout << "[From] " << pop.best_element () << std :: endl ;
|
||||
|
||||
eoGenContinue <Route> cont (1000) ; /* Continuator (A fixed number of
|
||||
1000 iterations */
|
||||
|
||||
eoStochTournamentSelect <Route> select_one ; // Selector
|
||||
|
||||
eoSelectNumber <Route> select (select_one, 100) ;
|
||||
|
||||
OrderXover cross ; // Order Crossover
|
||||
|
||||
TwoOptInit two_opt_init ; // Init.
|
||||
|
||||
TwoOptNext two_opt_next ; // Explorer.
|
||||
|
||||
TwoOptIncrEval two_opt_incr_eval ; // Eff. eval.
|
||||
|
||||
moRandImprSelect <TwoOpt> two_opt_select ; // Stochastic Neigh. Selector
|
||||
|
||||
moHC <TwoOpt> hill_climb (two_opt_init, two_opt_next, two_opt_incr_eval, two_opt_select, full_eval) ;
|
||||
|
||||
eoSGATransform <Route> transform (cross, 1, hill_climb, 0.01) ;
|
||||
|
||||
eoElitism <Route> merge (1) ; // Use of Elistism
|
||||
|
||||
eoStochTournamentTruncate <Route> reduce (0.7) ; // Stoch. Replacement
|
||||
|
||||
eoEasyEA <Route> ea (cont, full_eval, select, transform, merge, reduce) ;
|
||||
|
||||
ea (pop) ;
|
||||
|
||||
std :: cout << "[To] " << pop.best_element () << std :: endl ;
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
|
|
@ -1,455 +0,0 @@
|
|||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# examples/tsp/share/Makefile. Generated from Makefile.in by configure.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
|
||||
srcdir = .
|
||||
top_srcdir = ../../..
|
||||
|
||||
pkgdatadir = $(datadir)/mo
|
||||
pkglibdir = $(libdir)/mo
|
||||
pkgincludedir = $(includedir)/mo
|
||||
top_builddir = ../../..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = /usr/bin/install -c
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
subdir = examples/tsp/share
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(libdir)"
|
||||
libLIBRARIES_INSTALL = $(INSTALL_DATA)
|
||||
LIBRARIES = $(lib_LIBRARIES)
|
||||
AR = ar
|
||||
ARFLAGS = cru
|
||||
libtsp_share_a_AR = $(AR) $(ARFLAGS)
|
||||
libtsp_share_a_LIBADD =
|
||||
am_libtsp_share_a_OBJECTS = graph.$(OBJEXT) route_init.$(OBJEXT) \
|
||||
route_eval.$(OBJEXT) part_route_eval.$(OBJEXT) \
|
||||
edge_xover.$(OBJEXT) order_xover.$(OBJEXT) \
|
||||
route_valid.$(OBJEXT) partial_mapped_xover.$(OBJEXT) \
|
||||
city_swap.$(OBJEXT) two_opt.$(OBJEXT) two_opt_init.$(OBJEXT) \
|
||||
two_opt_next.$(OBJEXT) two_opt_incr_eval.$(OBJEXT) \
|
||||
two_opt_tabu_list.$(OBJEXT) two_opt_rand.$(OBJEXT)
|
||||
libtsp_share_a_OBJECTS = $(am_libtsp_share_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
|
||||
-o $@
|
||||
SOURCES = $(libtsp_share_a_SOURCES)
|
||||
DIST_SOURCES = $(libtsp_share_a_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = ${SHELL} /home/jc/paradiseo-mo/missing --run aclocal-1.9
|
||||
AMDEP_FALSE = #
|
||||
AMDEP_TRUE =
|
||||
AMTAR = ${SHELL} /home/jc/paradiseo-mo/missing --run tar
|
||||
AUTOCONF = ${SHELL} /home/jc/paradiseo-mo/missing --run autoconf
|
||||
AUTOHEADER = ${SHELL} /home/jc/paradiseo-mo/missing --run autoheader
|
||||
AUTOMAKE = ${SHELL} /home/jc/paradiseo-mo/missing --run automake-1.9
|
||||
AWK = gawk
|
||||
CC = gcc
|
||||
CCDEPMODE = depmode=gcc3
|
||||
CFLAGS = -g -O2
|
||||
CPP = gcc -E
|
||||
CPPFLAGS =
|
||||
CXX = g++
|
||||
CXXDEPMODE = depmode=gcc3
|
||||
CXXFLAGS = -g -O2
|
||||
CYGPATH_W = echo
|
||||
DEFS = -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"mo\" -DVERSION=\"0.1\" -DSTDC_HEADERS=1 -DHAVE_NAMESPACES= -DHAVE_SSTREAM= -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
|
||||
DEPDIR = .deps
|
||||
ECHO_C =
|
||||
ECHO_N = -n
|
||||
ECHO_T =
|
||||
EGREP = grep -E
|
||||
EO_DIR = /home/jc/eo
|
||||
EXEEXT =
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
|
||||
LDFLAGS =
|
||||
LIBOBJS =
|
||||
LIBS =
|
||||
LN_S = ln -s
|
||||
LTLIBOBJS =
|
||||
MAKEINFO = ${SHELL} /home/jc/paradiseo-mo/missing --run makeinfo
|
||||
OBJEXT = o
|
||||
PACKAGE = mo
|
||||
PACKAGE_BUGREPORT =
|
||||
PACKAGE_NAME =
|
||||
PACKAGE_STRING =
|
||||
PACKAGE_TARNAME =
|
||||
PACKAGE_VERSION =
|
||||
PATH_SEPARATOR = :
|
||||
RANLIB = ranlib
|
||||
SET_MAKE =
|
||||
SHELL = /bin/sh
|
||||
STRIP =
|
||||
VERSION = 0.1
|
||||
ac_ct_CC = gcc
|
||||
ac_ct_CXX = g++
|
||||
ac_ct_RANLIB = ranlib
|
||||
ac_ct_STRIP =
|
||||
am__fastdepCC_FALSE = #
|
||||
am__fastdepCC_TRUE =
|
||||
am__fastdepCXX_FALSE = #
|
||||
am__fastdepCXX_TRUE =
|
||||
am__include = include
|
||||
am__leading_dot = .
|
||||
am__quote =
|
||||
am__tar = ${AMTAR} chof - "$$tardir"
|
||||
am__untar = ${AMTAR} xf -
|
||||
bindir = ${exec_prefix}/bin
|
||||
build_alias =
|
||||
datadir = ${prefix}/share
|
||||
exec_prefix = ${prefix}
|
||||
host_alias =
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${prefix}/info
|
||||
install_sh = /home/jc/paradiseo-mo/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localstatedir = ${prefix}/var
|
||||
mandir = ${prefix}/man
|
||||
mkdir_p = mkdir -p --
|
||||
oldincludedir = /usr/include
|
||||
prefix = /usr/local
|
||||
program_transform_name = s,x,x,
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
sysconfdir = ${prefix}/etc
|
||||
target_alias =
|
||||
INCLUDES = -I${EO_DIR}/src/ -I${PARADISEO_DIR}/examples/tsp/ -I../../../src/
|
||||
AM_CXXFLAGS = \
|
||||
-Wall
|
||||
|
||||
lib_LIBRARIES = libtsp_share.a
|
||||
libtsp_share_a_SOURCES = \
|
||||
graph.cpp\
|
||||
route_init.cpp\
|
||||
route_eval.cpp\
|
||||
part_route_eval.cpp\
|
||||
edge_xover.cpp\
|
||||
order_xover.cpp\
|
||||
route_valid.cpp\
|
||||
partial_mapped_xover.cpp\
|
||||
city_swap.cpp\
|
||||
two_opt.cpp\
|
||||
two_opt_init.cpp\
|
||||
two_opt_next.cpp\
|
||||
two_opt_incr_eval.cpp\
|
||||
two_opt_tabu_list.cpp\
|
||||
two_opt_rand.cpp
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/tsp/share/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu examples/tsp/share/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-libLIBRARIES: $(lib_LIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
@$(POST_INSTALL)
|
||||
@list='$(lib_LIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
p=$(am__strip_dir) \
|
||||
echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
$(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LIBRARIES)'; for p in $$list; do \
|
||||
p=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
rm -f "$(DESTDIR)$(libdir)/$$p"; \
|
||||
done
|
||||
|
||||
clean-libLIBRARIES:
|
||||
-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
|
||||
libtsp_share.a: $(libtsp_share_a_OBJECTS) $(libtsp_share_a_DEPENDENCIES)
|
||||
-rm -f libtsp_share.a
|
||||
$(libtsp_share_a_AR) libtsp_share.a $(libtsp_share_a_OBJECTS) $(libtsp_share_a_LIBADD)
|
||||
$(RANLIB) libtsp_share.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
include ./$(DEPDIR)/city_swap.Po
|
||||
include ./$(DEPDIR)/edge_xover.Po
|
||||
include ./$(DEPDIR)/graph.Po
|
||||
include ./$(DEPDIR)/order_xover.Po
|
||||
include ./$(DEPDIR)/part_route_eval.Po
|
||||
include ./$(DEPDIR)/partial_mapped_xover.Po
|
||||
include ./$(DEPDIR)/route_eval.Po
|
||||
include ./$(DEPDIR)/route_init.Po
|
||||
include ./$(DEPDIR)/route_valid.Po
|
||||
include ./$(DEPDIR)/two_opt.Po
|
||||
include ./$(DEPDIR)/two_opt_incr_eval.Po
|
||||
include ./$(DEPDIR)/two_opt_init.Po
|
||||
include ./$(DEPDIR)/two_opt_next.Po
|
||||
include ./$(DEPDIR)/two_opt_rand.Po
|
||||
include ./$(DEPDIR)/two_opt_tabu_list.Po
|
||||
|
||||
.cpp.o:
|
||||
if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
# source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cpp.obj:
|
||||
if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
# source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
uninstall-info-am:
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-libLIBRARIES
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-libLIBRARIES
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLIBRARIES ctags distclean distclean-compile \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-libLIBRARIES install-man install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-info-am uninstall-libLIBRARIES
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
INCLUDES = -I${EO_DIR}/src/ -I${PARADISEO_DIR}/examples/tsp/ -I../../../src/
|
||||
|
||||
AM_CXXFLAGS =\
|
||||
-Wall
|
||||
|
||||
lib_LIBRARIES = libtsp_share.a
|
||||
|
||||
libtsp_share_a_SOURCES =\
|
||||
graph.cpp\
|
||||
route_init.cpp\
|
||||
route_eval.cpp\
|
||||
part_route_eval.cpp\
|
||||
edge_xover.cpp\
|
||||
order_xover.cpp\
|
||||
route_valid.cpp\
|
||||
partial_mapped_xover.cpp\
|
||||
city_swap.cpp\
|
||||
two_opt.cpp\
|
||||
two_opt_init.cpp\
|
||||
two_opt_next.cpp\
|
||||
two_opt_incr_eval.cpp\
|
||||
two_opt_tabu_list.cpp\
|
||||
two_opt_rand.cpp
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,455 +0,0 @@
|
|||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ../../..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
subdir = examples/tsp/share
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(libdir)"
|
||||
libLIBRARIES_INSTALL = $(INSTALL_DATA)
|
||||
LIBRARIES = $(lib_LIBRARIES)
|
||||
AR = ar
|
||||
ARFLAGS = cru
|
||||
libtsp_share_a_AR = $(AR) $(ARFLAGS)
|
||||
libtsp_share_a_LIBADD =
|
||||
am_libtsp_share_a_OBJECTS = graph.$(OBJEXT) route_init.$(OBJEXT) \
|
||||
route_eval.$(OBJEXT) part_route_eval.$(OBJEXT) \
|
||||
edge_xover.$(OBJEXT) order_xover.$(OBJEXT) \
|
||||
route_valid.$(OBJEXT) partial_mapped_xover.$(OBJEXT) \
|
||||
city_swap.$(OBJEXT) two_opt.$(OBJEXT) two_opt_init.$(OBJEXT) \
|
||||
two_opt_next.$(OBJEXT) two_opt_incr_eval.$(OBJEXT) \
|
||||
two_opt_tabu_list.$(OBJEXT) two_opt_rand.$(OBJEXT)
|
||||
libtsp_share_a_OBJECTS = $(am_libtsp_share_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
|
||||
-o $@
|
||||
SOURCES = $(libtsp_share_a_SOURCES)
|
||||
DIST_SOURCES = $(libtsp_share_a_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EO_DIR = @EO_DIR@
|
||||
EXEEXT = @EXEEXT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
INCLUDES = -I${EO_DIR}/src/ -I${PARADISEO_DIR}/examples/tsp/ -I../../../src/
|
||||
AM_CXXFLAGS = \
|
||||
-Wall
|
||||
|
||||
lib_LIBRARIES = libtsp_share.a
|
||||
libtsp_share_a_SOURCES = \
|
||||
graph.cpp\
|
||||
route_init.cpp\
|
||||
route_eval.cpp\
|
||||
part_route_eval.cpp\
|
||||
edge_xover.cpp\
|
||||
order_xover.cpp\
|
||||
route_valid.cpp\
|
||||
partial_mapped_xover.cpp\
|
||||
city_swap.cpp\
|
||||
two_opt.cpp\
|
||||
two_opt_init.cpp\
|
||||
two_opt_next.cpp\
|
||||
two_opt_incr_eval.cpp\
|
||||
two_opt_tabu_list.cpp\
|
||||
two_opt_rand.cpp
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/tsp/share/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu examples/tsp/share/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-libLIBRARIES: $(lib_LIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
|
||||
@list='$(lib_LIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(libLIBRARIES_INSTALL) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
|
||||
$(libLIBRARIES_INSTALL) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
|
||||
else :; fi; \
|
||||
done
|
||||
@$(POST_INSTALL)
|
||||
@list='$(lib_LIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
p=$(am__strip_dir) \
|
||||
echo " $(RANLIB) '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
$(RANLIB) "$(DESTDIR)$(libdir)/$$p"; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(lib_LIBRARIES)'; for p in $$list; do \
|
||||
p=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(libdir)/$$p'"; \
|
||||
rm -f "$(DESTDIR)$(libdir)/$$p"; \
|
||||
done
|
||||
|
||||
clean-libLIBRARIES:
|
||||
-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
|
||||
libtsp_share.a: $(libtsp_share_a_OBJECTS) $(libtsp_share_a_DEPENDENCIES)
|
||||
-rm -f libtsp_share.a
|
||||
$(libtsp_share_a_AR) libtsp_share.a $(libtsp_share_a_OBJECTS) $(libtsp_share_a_LIBADD)
|
||||
$(RANLIB) libtsp_share.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/city_swap.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edge_xover.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graph.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/order_xover.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/part_route_eval.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/partial_mapped_xover.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/route_eval.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/route_init.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/route_valid.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_opt.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_opt_incr_eval.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_opt_init.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_opt_next.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_opt_rand.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/two_opt_tabu_list.Po@am__quote@
|
||||
|
||||
.cpp.o:
|
||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cpp.obj:
|
||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
uninstall-info-am:
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(libdir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-libLIBRARIES
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-libLIBRARIES
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLIBRARIES ctags distclean distclean-compile \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-libLIBRARIES install-man install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-info-am uninstall-libLIBRARIES
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "city_swap.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2002
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
#include "city_swap.h"
|
||||
|
||||
bool CitySwap :: operator () (Route & __route) {
|
||||
|
||||
std :: swap (__route [rng.random (__route.size ())],
|
||||
__route [rng.random (__route.size ())]) ;
|
||||
|
||||
__route.invalidate () ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "city_swap.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2002
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef city_swap_h
|
||||
#define city_swap_h
|
||||
|
||||
#include <eoOp.h>
|
||||
|
||||
#include "route.h"
|
||||
|
||||
/** Its swaps two vertices
|
||||
randomly choosen */
|
||||
class CitySwap : public eoMonOp <Route> {
|
||||
|
||||
public :
|
||||
|
||||
bool operator () (Route & __route) ;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "edge_xover.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
#include "edge_xover.h"
|
||||
#include "route_valid.h"
|
||||
|
||||
#define MAXINT 1000000
|
||||
|
||||
void EdgeXover :: build_map (const Route & __par1, const Route & __par2) {
|
||||
|
||||
unsigned len = __par1.size () ;
|
||||
|
||||
/* Initialization */
|
||||
_map.clear () ;
|
||||
_map.resize (len) ;
|
||||
|
||||
for (unsigned i = 0 ; i < len ; i ++) {
|
||||
_map [__par1 [i]].insert (__par1 [(i + 1) % len]) ;
|
||||
_map [__par2 [i]].insert (__par2 [(i + 1) % len]) ;
|
||||
_map [__par1 [i]].insert (__par1 [(i - 1 + len) % len]) ;
|
||||
_map [__par2 [i]].insert (__par2 [(i - 1 + len) % len]) ;
|
||||
}
|
||||
|
||||
visited.clear () ;
|
||||
visited.resize (len, false) ;
|
||||
}
|
||||
|
||||
void EdgeXover :: remove_entry (unsigned __vertex, std :: vector <std :: set <unsigned> > & __map) {
|
||||
|
||||
std :: set <unsigned> & neigh = __map [__vertex] ;
|
||||
|
||||
for (std :: set <unsigned> :: iterator it = neigh.begin () ;
|
||||
it != neigh.end () ;
|
||||
it ++)
|
||||
__map [* it].erase (__vertex) ;
|
||||
|
||||
}
|
||||
|
||||
void EdgeXover :: add_vertex (unsigned __vertex, Route & __child) {
|
||||
|
||||
visited [__vertex] = true ;
|
||||
__child.push_back (__vertex) ;
|
||||
remove_entry (__vertex, _map) ; /* Removing entries */
|
||||
}
|
||||
|
||||
void EdgeXover :: cross (const Route & __par1, const Route & __par2, Route & __child) {
|
||||
|
||||
build_map (__par1, __par2) ;
|
||||
|
||||
unsigned len = __par1.size () ;
|
||||
|
||||
/* Go ! */
|
||||
__child.clear () ;
|
||||
|
||||
unsigned cur_vertex = rng.random (len) ;
|
||||
|
||||
add_vertex (cur_vertex, __child) ;
|
||||
|
||||
for (unsigned i = 1 ; i < len ; i ++) {
|
||||
|
||||
unsigned len_min_entry = MAXINT ;
|
||||
|
||||
std :: set <unsigned> & neigh = _map [cur_vertex] ;
|
||||
|
||||
for (std :: set <unsigned> :: iterator it = neigh.begin () ;
|
||||
it != neigh.end () ;
|
||||
it ++) {
|
||||
unsigned l = _map [* it].size () ;
|
||||
if (len_min_entry > l)
|
||||
len_min_entry = l ;
|
||||
}
|
||||
|
||||
std :: vector <unsigned> cand ; /* Candidates */
|
||||
|
||||
for (std :: set <unsigned> :: iterator it = neigh.begin () ;
|
||||
it != neigh.end () ;
|
||||
it ++) {
|
||||
unsigned l = _map [* it].size () ;
|
||||
if (len_min_entry == l)
|
||||
cand.push_back (* it) ;
|
||||
}
|
||||
|
||||
if (! cand.size ()) {
|
||||
|
||||
/* Oh no ! Implicit mutation */
|
||||
for (unsigned j = 0 ; j < len ; j ++)
|
||||
if (! visited [j])
|
||||
cand.push_back (j) ;
|
||||
}
|
||||
|
||||
cur_vertex = cand [rng.random (cand.size ())] ;
|
||||
|
||||
add_vertex (cur_vertex, __child) ;
|
||||
}
|
||||
}
|
||||
|
||||
bool EdgeXover :: operator () (Route & __route1, Route & __route2) {
|
||||
|
||||
// Init. copy
|
||||
Route par [2] ;
|
||||
par [0] = __route1 ;
|
||||
par [1] = __route2 ;
|
||||
|
||||
cross (par [0], par [1], __route1) ;
|
||||
cross (par [1], par [0], __route2) ;
|
||||
|
||||
assert (valid (__route1)) ;
|
||||
assert (valid (__route2)) ;
|
||||
|
||||
__route1.invalidate () ;
|
||||
__route2.invalidate () ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "edge_xover.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef edge_xover_h
|
||||
#define edge_xover_h
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
#include <eoOp.h>
|
||||
|
||||
#include "route.h"
|
||||
|
||||
/** Edge Crossover */
|
||||
class EdgeXover : public eoQuadOp <Route> {
|
||||
|
||||
public :
|
||||
|
||||
bool operator () (Route & __route1, Route & __route2) ;
|
||||
|
||||
private :
|
||||
|
||||
void cross (const Route & __par1, const Route & __par2, Route & __child) ; /* Binary */
|
||||
|
||||
void remove_entry (unsigned __vertex, std :: vector <std :: set <unsigned> > & __map) ;
|
||||
/* Updating the map of entries */
|
||||
|
||||
void build_map (const Route & __par1, const Route & __par2) ;
|
||||
|
||||
void add_vertex (unsigned __vertex, Route & __child) ;
|
||||
|
||||
std :: vector <std :: set <unsigned> > _map ; /* The handled map */
|
||||
|
||||
std :: vector <bool> visited ; /* Vertices that are already visited */
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "graph.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
|
||||
#include "graph.h"
|
||||
|
||||
namespace Graph {
|
||||
|
||||
static std :: vector <std :: pair <double, double> > vectCoord ; // Coordinates
|
||||
|
||||
static std :: vector <std :: vector <unsigned> > dist ; // Distances Mat.
|
||||
|
||||
unsigned size () {
|
||||
|
||||
return dist.size () ;
|
||||
}
|
||||
|
||||
void computeDistances () {
|
||||
|
||||
// Dim.
|
||||
unsigned numCities = vectCoord.size () ;
|
||||
dist.resize (numCities) ;
|
||||
for (unsigned i = 0 ; i < dist.size () ; i ++)
|
||||
dist [i].resize (numCities) ;
|
||||
|
||||
// Computations.
|
||||
for (unsigned i = 0 ; i < dist.size () ; i ++)
|
||||
for (unsigned j = i + 1 ; j < dist.size () ; j ++) {
|
||||
double distX = vectCoord [i].first - vectCoord [j].first ;
|
||||
double distY = vectCoord [i].second - vectCoord [j].second ;
|
||||
dist [i] [j] = dist [j] [i] = (unsigned) (sqrt ((float) (distX * distX + distY * distY)) + 0.5) ;
|
||||
}
|
||||
}
|
||||
|
||||
void load (const char * __fileName) {
|
||||
|
||||
std :: ifstream f (__fileName) ;
|
||||
|
||||
std :: cout << ">> Loading [" << __fileName << "]" << std :: endl ;
|
||||
|
||||
if (f) {
|
||||
|
||||
unsigned num_vert ;
|
||||
|
||||
f >> num_vert ;
|
||||
vectCoord.resize (num_vert) ;
|
||||
|
||||
for (unsigned i = 0 ; i < num_vert ; i ++)
|
||||
f >> vectCoord [i].first >> vectCoord [i].second ;
|
||||
|
||||
f.close () ;
|
||||
|
||||
computeDistances () ;
|
||||
}
|
||||
else {
|
||||
|
||||
std :: cout << __fileName << " doesn't exist !!!" << std :: endl ;
|
||||
// Bye !!!
|
||||
exit (1) ;
|
||||
}
|
||||
}
|
||||
|
||||
float distance (unsigned __from, unsigned __to) {
|
||||
|
||||
return dist [__from] [__to] ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "graph.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef graph_h
|
||||
#define graph_h
|
||||
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
namespace Graph {
|
||||
|
||||
void load (const char * __file_name) ;
|
||||
/* Loading cities
|
||||
(expressed by their coordinates)
|
||||
from the given file name */
|
||||
|
||||
float distance (unsigned __from, unsigned __to) ;
|
||||
|
||||
unsigned size () ; // How many cities ?
|
||||
}
|
||||
|
||||
#endif
|
||||
Binary file not shown.
|
|
@ -1,35 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "mix.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef mix_h
|
||||
#define mix_h
|
||||
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
template <class T> void mix (std :: vector <T> & __vect) {
|
||||
|
||||
for (unsigned i = 0 ; i < __vect.size () ; i ++)
|
||||
std :: swap (__vect [i], __vect [rng.random (__vect.size ())]) ;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "order_xover.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2002
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
#include "order_xover.h"
|
||||
#include "route_valid.h"
|
||||
|
||||
void OrderXover :: cross (const Route & __par1, const Route & __par2, Route & __child) {
|
||||
|
||||
|
||||
unsigned cut = rng.random (__par1.size ()) ;
|
||||
|
||||
/* To store vertices that have
|
||||
already been crossed */
|
||||
bool v [__par1.size ()] ;
|
||||
for (unsigned i = 0 ; i < __par1.size () ; i ++)
|
||||
v [i] = false ;
|
||||
|
||||
/* Copy of the left partial
|
||||
route of the first parent */
|
||||
for (unsigned i = 0 ; i < cut ; i ++) {
|
||||
__child [i] = __par1 [i] ;
|
||||
v [__par1 [i]] = true ;
|
||||
}
|
||||
|
||||
/* Searching the vertex of the second path, that ended
|
||||
the previous first one */
|
||||
unsigned from = 0 ;
|
||||
for (unsigned i = 0 ; i < __par2.size () ; i ++)
|
||||
if (__par2 [i] == __child [cut - 1]) {
|
||||
from = i ;
|
||||
break ;
|
||||
}
|
||||
|
||||
/* Selecting a direction
|
||||
Left or Right */
|
||||
char direct = rng.flip () ? 1 : -1 ;
|
||||
|
||||
/* Copy of the left vertices from
|
||||
the second parent path */
|
||||
unsigned l = cut ;
|
||||
|
||||
for (unsigned i = 0 ; i < __par2.size () ; i ++) {
|
||||
unsigned bidule /* :-) */ = (direct * i + from + __par2.size ()) % __par2.size () ;
|
||||
if (! v [__par2 [bidule]]) {
|
||||
__child [l ++] = __par2 [bidule] ;
|
||||
v [__par2 [bidule]] = true ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool OrderXover :: operator () (Route & __route1, Route & __route2) {
|
||||
|
||||
// Init. copy
|
||||
Route par [2] ;
|
||||
par [0] = __route1 ;
|
||||
par [1] = __route2 ;
|
||||
|
||||
cross (par [0], par [1], __route1) ;
|
||||
cross (par [1], par [0], __route2) ;
|
||||
|
||||
assert (valid (__route1)) ;
|
||||
assert (valid (__route2)) ;
|
||||
|
||||
__route1.invalidate () ;
|
||||
__route2.invalidate () ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "order_xover.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef order_xover_h
|
||||
#define order_xover_h
|
||||
|
||||
#include <eoOp.h>
|
||||
|
||||
#include "route.h"
|
||||
|
||||
/** Order Crossover */
|
||||
class OrderXover : public eoQuadOp <Route> {
|
||||
|
||||
public :
|
||||
|
||||
bool operator () (Route & __route1, Route & __route2) ;
|
||||
|
||||
private :
|
||||
|
||||
void cross (const Route & __par1, const Route & __par2, Route & __child) ;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "part_route_eval.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include "part_route_eval.h"
|
||||
#include "graph.h"
|
||||
|
||||
PartRouteEval :: PartRouteEval (float __from,
|
||||
float __to
|
||||
) : from (__from),
|
||||
to (__to) {
|
||||
|
||||
}
|
||||
|
||||
void PartRouteEval :: operator () (Route & __route) {
|
||||
|
||||
|
||||
float len = 0 ;
|
||||
|
||||
for (unsigned i = (unsigned) (__route.size () * from) ;
|
||||
i < (unsigned) (__route.size () * to) ;
|
||||
i ++)
|
||||
len -= Graph :: distance (__route [i], __route [(i + 1) % Graph :: size ()]) ;
|
||||
|
||||
__route.fitness (len) ;
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "part_route_eval.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef part_route_eval_h
|
||||
#define part_route_eval_h
|
||||
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
#include "route.h"
|
||||
|
||||
/** Route Evaluator */
|
||||
class PartRouteEval : public eoEvalFunc <Route> {
|
||||
|
||||
public :
|
||||
|
||||
/** Constructor */
|
||||
PartRouteEval (float __from, float __to) ;
|
||||
|
||||
void operator () (Route & __route) ;
|
||||
|
||||
private :
|
||||
|
||||
float from, to ;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "part_two_opt_init.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
#include "part_two_opt_init.h"
|
||||
|
||||
void PartTwoOptInit :: operator () (TwoOpt & __move, const Route & __route) {
|
||||
|
||||
__move.first = rng.random (__route.size () - 6) ;
|
||||
__move.second = __move.first + 2 ;
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "part_two_opt_init.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef part_two_opt_init_h
|
||||
#define part_two_opt_init_h
|
||||
|
||||
#include <eoMoveInit.h>
|
||||
|
||||
#include "two_opt.h"
|
||||
|
||||
/** It sets the first couple of edges */
|
||||
class PartTwoOptInit : public eoMoveInit <TwoOpt> {
|
||||
|
||||
public :
|
||||
|
||||
void operator () (TwoOpt & __move, const Route & __route) ;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "part_two_opt_next.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include "part_two_opt_next.h"
|
||||
#include "graph.h"
|
||||
|
||||
bool TwoOptNext :: operator () (TwoOpt & __move, const Route & __route) {
|
||||
|
||||
if (__move.first == Graph :: size () - 4 && __move.second == __move.first + 2)
|
||||
return false ;
|
||||
|
||||
else {
|
||||
|
||||
__move.second ++ ;
|
||||
if (__move.second == Graph :: size () - 1) {
|
||||
__move.first ++ ;
|
||||
__move.second = __move.first + 2 ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "part_two_opt_next.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef part_two_opt_next_h
|
||||
#define part_two_opt_next_h
|
||||
|
||||
#include <eoNextMove.h>
|
||||
#include "two_opt.h"
|
||||
|
||||
/** It updates a couple of edges */
|
||||
class PartTwoOptNext : public eoNextMove <TwoOpt> {
|
||||
|
||||
public :
|
||||
|
||||
bool operator () (TwoOpt & __move, const Route & __route) ;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "partial_mapped_xover.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
#include "partial_mapped_xover.h"
|
||||
#include "route_valid.h"
|
||||
#include "mix.h"
|
||||
|
||||
void PartialMappedXover :: repair (Route & __route, unsigned __cut1, unsigned __cut2) {
|
||||
|
||||
unsigned v [__route.size ()] ; // Number of times a cities are visited ...
|
||||
|
||||
for (unsigned i = 0 ; i < __route.size () ; i ++)
|
||||
v [i] = 0 ;
|
||||
|
||||
for (unsigned i = 0 ; i < __route.size () ; i ++)
|
||||
v [__route [i]] ++ ;
|
||||
|
||||
std :: vector <unsigned> vert ;
|
||||
|
||||
for (unsigned i = 0 ; i < __route.size () ; i ++)
|
||||
if (! v [i])
|
||||
vert.push_back (i) ;
|
||||
|
||||
mix (vert) ;
|
||||
|
||||
for (unsigned i = 0 ; i < __route.size () ; i ++)
|
||||
if (i < __cut1 || i >= __cut2)
|
||||
if (v [__route [i]] > 1) {
|
||||
__route [i] = vert.back () ;
|
||||
vert.pop_back () ;
|
||||
}
|
||||
}
|
||||
|
||||
bool PartialMappedXover :: operator () (Route & __route1, Route & __route2) {
|
||||
|
||||
unsigned cut1 = rng.random (__route1.size ()), cut2 = rng.random (__route2.size ()) ;
|
||||
|
||||
if (cut2 < cut1)
|
||||
std :: swap (cut1, cut2) ;
|
||||
|
||||
// Between the cuts
|
||||
for (unsigned i = cut1 ; i < cut2 ; i ++)
|
||||
std :: swap (__route1 [i], __route2 [i]) ;
|
||||
|
||||
// Outside the cuts
|
||||
repair (__route1, cut1, cut2) ;
|
||||
repair (__route2, cut1, cut2) ;
|
||||
|
||||
// Debug
|
||||
assert (valid (__route1)) ;
|
||||
assert (valid (__route2)) ;
|
||||
|
||||
__route1.invalidate () ;
|
||||
__route2.invalidate () ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "partial_mapped_xover.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef partial_mapped_xover_h
|
||||
#define partial_mapped_xover_h
|
||||
|
||||
#include <eoOp.h>
|
||||
|
||||
#include "route.h"
|
||||
|
||||
/** Partial Mapped Crossover */
|
||||
class PartialMappedXover : public eoQuadOp <Route> {
|
||||
|
||||
public :
|
||||
|
||||
bool operator () (Route & __route1, Route & __route2) ;
|
||||
|
||||
private :
|
||||
|
||||
void repair (Route & __route, unsigned __cut1, unsigned __cut2) ;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "route.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef route_h
|
||||
#define route_h
|
||||
|
||||
#include <eoVector.h>
|
||||
|
||||
typedef eoVector <float, unsigned> Route ; // [Fitness (- length), Gene (city)]
|
||||
|
||||
#endif
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "route_eval.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include "route_eval.h"
|
||||
#include "graph.h"
|
||||
|
||||
void RouteEval :: operator () (Route & __route) {
|
||||
|
||||
float len = 0 ;
|
||||
|
||||
for (unsigned i = 0 ; i < Graph :: size () ; i ++)
|
||||
len -= Graph :: distance (__route [i], __route [(i + 1) % Graph :: size ()]) ;
|
||||
|
||||
__route.fitness (len) ;
|
||||
}
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "route_eval.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef route_eval_h
|
||||
#define route_eval_h
|
||||
|
||||
#include <eoEvalFunc.h>
|
||||
|
||||
#include "route.h"
|
||||
|
||||
/** Route Evaluator */
|
||||
class RouteEval : public eoEvalFunc <Route> {
|
||||
|
||||
public :
|
||||
|
||||
void operator () (Route & __route) ;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "route_init.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
#include "route_init.h"
|
||||
#include "graph.h"
|
||||
|
||||
void RouteInit :: operator () (Route & __route) {
|
||||
|
||||
// Init.
|
||||
__route.clear () ;
|
||||
for (unsigned i = 0 ; i < Graph :: size () ; i ++)
|
||||
__route.push_back (i) ;
|
||||
|
||||
// Swap. cities
|
||||
|
||||
for (unsigned i = 0 ; i < Graph :: size () ; i ++) {
|
||||
//unsigned j = rng.random (Graph :: size ()) ;
|
||||
|
||||
unsigned j = (unsigned) (Graph :: size () * (rand () / (RAND_MAX + 1.0))) ;
|
||||
unsigned city = __route [i] ;
|
||||
__route [i] = __route [j] ;
|
||||
__route [j] = city ;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "route_init.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2002
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef route_init_h
|
||||
#define route_init_h
|
||||
|
||||
#include <eoInit.h>
|
||||
|
||||
#include "route.h"
|
||||
|
||||
class RouteInit : public eoInit <Route> {
|
||||
|
||||
public :
|
||||
|
||||
void operator () (Route & __route) ;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "route_valid.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include "route_valid.h"
|
||||
|
||||
bool valid (Route & __route) {
|
||||
|
||||
unsigned t [__route.size ()] ;
|
||||
|
||||
for (unsigned i = 0 ; i < __route.size () ; i ++)
|
||||
t [i] = 0 ;
|
||||
|
||||
for (unsigned i = 0 ; i < __route.size () ; i ++)
|
||||
t [__route [i]] ++ ;
|
||||
|
||||
for (unsigned i = 0 ; i < __route.size () ; i ++)
|
||||
if (t [i] != 1)
|
||||
return false ;
|
||||
|
||||
return true ; // OK.
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "route_valid.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef route_valid_h
|
||||
#define route_valid_h
|
||||
|
||||
#include "route.h"
|
||||
|
||||
bool valid (Route & __route) ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "two_opt.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include "two_opt.h"
|
||||
|
||||
TwoOpt TwoOpt :: operator ! () const {
|
||||
|
||||
TwoOpt move = * this ;
|
||||
std :: swap (move.first, move.second) ;
|
||||
|
||||
return move ;
|
||||
}
|
||||
|
||||
void TwoOpt :: operator () (Route & __route) {
|
||||
|
||||
std :: vector <unsigned> seq_cities ;
|
||||
|
||||
for (unsigned i = second ; i > first ; i --)
|
||||
seq_cities.push_back (__route [i]) ;
|
||||
|
||||
unsigned j = 0 ;
|
||||
for (unsigned i = first + 1 ; i < second + 1 ; i ++)
|
||||
__route [i] = seq_cities [j ++] ;
|
||||
}
|
||||
|
||||
void TwoOpt :: readFrom (std :: istream & __is) {
|
||||
|
||||
__is >> first >> second ;
|
||||
}
|
||||
|
||||
void TwoOpt :: printOn (std :: ostream & __os) const {
|
||||
|
||||
__os << first << ' ' << second ;
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "two_opt.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef two_opt_h
|
||||
#define two_opt_h
|
||||
|
||||
#include <eoPersistent.h>
|
||||
|
||||
#include <utility>
|
||||
#include <moMove.h>
|
||||
|
||||
#include "route.h"
|
||||
|
||||
class TwoOpt : public moMove <Route>, public std :: pair <unsigned, unsigned>, public eoPersistent {
|
||||
|
||||
public :
|
||||
|
||||
TwoOpt operator ! () const ;
|
||||
|
||||
void operator () (Route & __route) ;
|
||||
|
||||
void readFrom (std :: istream & __is) ;
|
||||
|
||||
void printOn (std :: ostream & __os) const ;
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "TwoOptIncrEval.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include "two_opt_incr_eval.h"
|
||||
#include "graph.h"
|
||||
|
||||
float TwoOptIncrEval :: operator () (const TwoOpt & __move, const Route & __route) {
|
||||
|
||||
// From
|
||||
unsigned v1 = __route [__move.first], v1_next = __route [__move.first + 1] ;
|
||||
|
||||
// To
|
||||
unsigned v2 = __route [__move.second], v2_next = __route [__move.second + 1] ;
|
||||
|
||||
return __route.fitness () - Graph :: distance (v1, v2) - Graph :: distance (v1_next, v2_next) + Graph :: distance (v1, v1_next) + Graph :: distance (v2, v2_next) ;
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "TwoOptIncrEval.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef two_optincr_eval_h
|
||||
#define two_optincr_eval_h
|
||||
|
||||
#include <moMoveIncrEval.h>
|
||||
#include "two_opt.h"
|
||||
|
||||
class TwoOptIncrEval : public moMoveIncrEval <TwoOpt> {
|
||||
|
||||
public :
|
||||
|
||||
float operator () (const TwoOpt & __move, const Route & __route) ;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "two_opt_init.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include "two_opt_init.h"
|
||||
|
||||
void TwoOptInit :: operator () (TwoOpt & __move, const Route & __route) {
|
||||
|
||||
__move.first = 0 ;
|
||||
__move.second = 2 ;
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "two_opt_init.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef two_opt_init_h
|
||||
#define two_opt_init_h
|
||||
|
||||
#include <moMoveInit.h>
|
||||
|
||||
#include "two_opt.h"
|
||||
|
||||
/** It sets the first couple of edges */
|
||||
class TwoOptInit : public moMoveInit <TwoOpt> {
|
||||
|
||||
public :
|
||||
|
||||
void operator () (TwoOpt & __move, const Route & __route) ;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "two_opt_next.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include "two_opt_next.h"
|
||||
#include "graph.h"
|
||||
|
||||
bool TwoOptNext :: operator () (TwoOpt & __move, const Route & __route) {
|
||||
|
||||
if (__move.first == Graph :: size () - 4 && __move.second == __move.first + 2)
|
||||
return false ;
|
||||
|
||||
else {
|
||||
|
||||
__move.second ++ ;
|
||||
if (__move.second == Graph :: size () - 1) {
|
||||
__move.first ++ ;
|
||||
__move.second = __move.first + 2 ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "two_opt_next.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef two_opt_next_h
|
||||
#define two_opt_next_h
|
||||
|
||||
#include <moNextMove.h>
|
||||
#include "two_opt.h"
|
||||
|
||||
/** It updates a couple of edges */
|
||||
class TwoOptNext : public moNextMove <TwoOpt> {
|
||||
|
||||
public :
|
||||
|
||||
bool operator () (TwoOpt & __move, const Route & __route) ;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "two_opt_rand.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include "two_opt_rand.h"
|
||||
#include "graph.h"
|
||||
#include <utils/eoRNG.h>
|
||||
|
||||
void TwoOptRand :: operator () (TwoOpt & __move) {
|
||||
|
||||
__move.first = rng.random (Graph :: size () - 3) ;
|
||||
__move.second = __move.first + 2 + rng.random (Graph :: size () - __move.first - 3) ;
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "two_opt_rand.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef two_opt_rand_h
|
||||
#define two_opt_rand_h
|
||||
|
||||
#include <moRandMove.h>
|
||||
|
||||
#include "two_opt.h"
|
||||
|
||||
class TwoOptRand : public moRandMove <TwoOpt> {
|
||||
|
||||
public :
|
||||
|
||||
void operator () (TwoOpt & __move) ;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "two_opt_tabu_list.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include "two_opt_tabu_list.h"
|
||||
#include "graph.h"
|
||||
|
||||
#define TABU_LENGTH 10
|
||||
|
||||
void TwoOptTabuList :: init () {
|
||||
|
||||
// Size (eventually)
|
||||
tabu_span.resize (Graph :: size ()) ;
|
||||
for (unsigned i = 0 ; i < tabu_span.size () ; i ++)
|
||||
tabu_span [i].resize (Graph :: size ()) ;
|
||||
|
||||
// Clear
|
||||
for (unsigned i = 0 ; i < tabu_span.size () ; i ++)
|
||||
for (unsigned j = 0 ; j < tabu_span [i].size () ; j ++)
|
||||
tabu_span [i] [j] = 0 ;
|
||||
}
|
||||
|
||||
bool TwoOptTabuList :: operator () (const TwoOpt & __move, const Route & __sol) {
|
||||
|
||||
return tabu_span [__move.first] [__move.second] > 0 ;
|
||||
}
|
||||
|
||||
void TwoOptTabuList :: add (const TwoOpt & __move, const Route & __sol) {
|
||||
|
||||
tabu_span [__move.first] [__move.second] = tabu_span [__move.second] [__move.first] = TABU_LENGTH ;
|
||||
}
|
||||
|
||||
void TwoOptTabuList :: update () {
|
||||
|
||||
for (unsigned i = 0 ; i < tabu_span.size () ; i ++)
|
||||
for (unsigned j = 0 ; j < tabu_span [i].size () ; j ++)
|
||||
if (tabu_span [i] [j] > 0)
|
||||
tabu_span [i] [j] -- ;
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "two_opt_tabu_list.h"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#ifndef two_opt_tabu_list_h
|
||||
#define two_opt_tabu_list_h
|
||||
|
||||
#include <moTabuList.h>
|
||||
#include "two_opt.h"
|
||||
#include "route.h"
|
||||
|
||||
/** The table of tabu movements, i.e. forbidden edges */
|
||||
class TwoOptTabuList : public moTabuList <TwoOpt> {
|
||||
|
||||
public :
|
||||
|
||||
bool operator () (const TwoOpt & __move, const Route & __sol) ;
|
||||
|
||||
void add (const TwoOpt & __move, const Route & __sol) ;
|
||||
|
||||
void update () ;
|
||||
|
||||
void init () ;
|
||||
|
||||
private :
|
||||
|
||||
std :: vector <std :: vector <unsigned> > tabu_span ;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
Binary file not shown.
|
|
@ -1,79 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "simul_anneal.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <moSA.h>
|
||||
#include <moEasyCoolSched.h>
|
||||
#include <moGenSolContinue.h>
|
||||
|
||||
#include "share/graph.h"
|
||||
#include "share/route.h"
|
||||
#include "share/route_eval.h"
|
||||
#include "share/route_init.h"
|
||||
|
||||
#include "share/two_opt.h"
|
||||
#include "share/two_opt_rand.h"
|
||||
#include "share/two_opt_incr_eval.h"
|
||||
|
||||
int main (int __argc, char * __argv []) {
|
||||
|
||||
if (__argc != 2) {
|
||||
|
||||
std :: cerr << "Usage : ./simul_anneal [instance]" << std :: endl ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
Graph :: load (__argv [1]) ; // Instance
|
||||
|
||||
Route route ; // Solution
|
||||
|
||||
RouteInit init ; // Sol. Random Init.
|
||||
init (route) ;
|
||||
|
||||
RouteEval full_eval ; // Full. Eval.
|
||||
full_eval (route) ;
|
||||
|
||||
std :: cout << "[From] " << route << std :: endl ;
|
||||
|
||||
/* Tools for an efficient (? :-))
|
||||
local search ! */
|
||||
|
||||
TwoOptRand two_opt_rand ; // Route Random. Gen.
|
||||
|
||||
TwoOptIncrEval two_opt_incr_eval ; // Eff. eval.
|
||||
|
||||
TwoOpt move ;
|
||||
|
||||
moEasyCoolSched cool_sched (0.1, 0.98) ; // Cooling Schedule
|
||||
|
||||
moGenSolContinue <Route> cont (1000) ; /* Temperature Descreasing
|
||||
will occur each 100
|
||||
iterations */
|
||||
|
||||
moSA <TwoOpt> simul_anneal (two_opt_rand, two_opt_incr_eval, cont, 1000, cool_sched, full_eval) ;
|
||||
simul_anneal (route) ;
|
||||
|
||||
std :: cout << "[To] " << route << std :: endl ;
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
|
@ -1,85 +0,0 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "tabu_search.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003
|
||||
|
||||
/* This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Contact: cahon@lifl.fr
|
||||
*/
|
||||
|
||||
#include <moTS.h>
|
||||
#include <moNoAspirCrit.h>
|
||||
#include <moImprBestFitAspirCrit.h>
|
||||
#include <moGenSolContinue.h>
|
||||
#include <moFirstImprSelect.h>
|
||||
#include <moBestImprSelect.h>
|
||||
#include <moRandImprSelect.h>
|
||||
|
||||
#include "share/graph.h"
|
||||
#include "share/route.h"
|
||||
#include "share/route_eval.h"
|
||||
#include "share/route_init.h"
|
||||
|
||||
#include "share/two_opt.h"
|
||||
#include "share/two_opt_init.h"
|
||||
#include "share/two_opt_next.h"
|
||||
#include "share/two_opt_incr_eval.h"
|
||||
#include "share/two_opt_tabu_list.h"
|
||||
|
||||
int main (int __argc, char * __argv []) {
|
||||
|
||||
if (__argc != 2) {
|
||||
|
||||
std :: cerr << "Usage : ./tabu_search [instance]" << std :: endl ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
Graph :: load (__argv [1]) ; // Instance
|
||||
|
||||
Route route ; // Solution
|
||||
|
||||
RouteInit init ; // Sol. Random Init.
|
||||
init (route) ;
|
||||
|
||||
RouteEval full_eval ; // Full. Eval.
|
||||
full_eval (route) ;
|
||||
|
||||
std :: cout << "[From] " << route << std :: endl ;
|
||||
|
||||
/* Tools for an efficient (? :-))
|
||||
local search ! */
|
||||
|
||||
TwoOptInit two_opt_init ; // Init.
|
||||
|
||||
TwoOptNext two_opt_next ; // Explorer.
|
||||
|
||||
TwoOptIncrEval two_opt_incr_eval ; // Eff. eval.
|
||||
|
||||
TwoOptTabuList tabu_list ; // Tabu List
|
||||
|
||||
moNoAspirCrit <TwoOpt> aspir_crit ; // Aspiration Criterion
|
||||
|
||||
moGenSolContinue <Route> cont (50000) ; // Continuator
|
||||
|
||||
moTS <TwoOpt> tabu_search (two_opt_init, two_opt_next, two_opt_incr_eval, tabu_list, aspir_crit, cont, full_eval) ;
|
||||
tabu_search (route) ;
|
||||
|
||||
std :: cout << "[To] " << route << std :: endl ;
|
||||
|
||||
return 0 ;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue