extensions [matrix] breed [antibody] breed [antibody-population-set] breed [random-generated-antibody] breed [salesman] breed [re-selected-antibody] breed [clone-antibody] breed [antibody-to-be-assigned-ordinal-number] breed [clone-antibody-hypermutated] breed [clone-antibody-receptor-edited] breed [elite-pool-antibody] breed [antibody-for-reselecting] breed [crossover-antibody] globals [generation replacement-size average-distance min-distance max-distance winner global-min-string path-length distance-matrix alfa expo-alfa string-length ] turtles-own [ string affinity ;;affinity is the distance measure as "1/antibody-distance" antibody-distance last-city current-city ordinal-number mutation-number receptor-editing-number ] patches-own [ name p-0-x p-0-y p-1-x p-1-y p-2-x p-2-y p-3-x p-3-y p-4-x p-4-y p-5-x p-5-y p-6-x p-6-y p-7-x p-7-y p-8-x p-8-y p-9-x p-9-y p-10-x p-10-y p-11-x p-11-y p-12-x p-12-y p-13-x p-13-y p-14-x p-14-y p-15-x p-15-y p-16-x p-16-y p-17-x p-17-y p-18-x p-18-y p-19-x p-19-y p-20-x p-20-y p-21-x p-21-y p-22-x p-22-y p-23-x p-23-y p-24-x p-24-y p-25-x p-25-y p-26-x p-26-y p-27-x p-27-y p-28-x p-28-y p-29-x p-29-y p-30-x p-30-y p-31-x p-31-y p-32-x p-32-y p-33-x p-33-y p-34-x p-34-y p-35-x p-35-y p-36-x p-36-y p-37-x p-37-y p-38-x p-38-y p-39-x p-39-y p-40-x p-40-y p-41-x p-41-y p-42-x p-42-y p-43-x p-43-y p-44-x p-44-y p-45-x p-45-y p-46-x p-46-y p-47-x p-47-y p-48-x p-48-y p-49-x p-49-y p-50-x p-50-y ] to setup clear-all ;; In this section there is euclidean distance matrix for "Eil51" travelling salesman problem set distance-matrix matrix:from-row-list [[37 52][49 49][52 64][20 26][40 30][21 47][17 63][31 62][52 33][51 21][42 41][31 32][5 25][12 42][36 16][52 41][27 23][17 33][13 13][57 58][62 42] [42 57][16 57][8 52][7 38][27 68][30 48][43 67][58 48][58 27][37 69][38 46][46 10][61 33][62 63][63 69][32 22][45 35][59 15][5 6][10 17][21 10][5 64][30 15][39 10][32 39][25 32][25 55] [48 28][56 37][30 40]] ;; create random antibody population. ;; each antibody (turtle) have a random vector called as string and this vector represent traveling tour for each antibody. create-turtles initial-population-size [ set string n-values 600 [one-of [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50]] set string remove-duplicates string if not (length string = (number-of-city - 1)) [ while [ not (length string = (number-of-city - 1))] [set string n-values 600 [one-of [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50]] set string remove-duplicates string ] ] set string fput 0 string set string lput 0 string ] ask turtles [ calculate-affinity ;; this process is used calculate affinity value of antibody. set breed antibody-population-set ] set alfa 0.5 ;;alfa is used in mutation-number-assigment process.. set expo-alfa 100 ;;expo-alfa is used in re-select process.. setup-plot update-plot end to go set generation 0 while [generation < number-of-generation] [ ;; replace-antibody process in each replacement-frequency generation.. ;; and draw path of best solution.. if ( (remainder generation replacement-frequency) = 0 ) [ set replacement-size round (replacement-rate / 100 * (selection-size)) ask antibody-population-set [ set breed antibody ] replace-antibody ask turtles [set breed antibody-population-set] find-global-min-path draw-best-path ask salesman [die] ] let total-distance 0 let distance-list [antibody-distance] of turtles set min-distance min distance-list set max-distance max distance-list set average-distance mean distance-list ask turtles [ select antibody-eliminate-for-equal-affinity ] clone mutation-number-assigment ;; mutation-number-assigment process is used to determine ;;how many cloned antibody will hypermutate and how many cloned antibody will receptor-edit.. ask clone-antibody [ if ((not (ordinal-number = selection-size)) and (mutation-number < 1) and (receptor-editing-number < 1)) [ set mutation-number 1] ] hypermutation receptor-editing-process crossover ask clone-antibody-hypermutated [set breed antibody-for-reselecting] ask clone-antibody-receptor-edited [set breed antibody-for-reselecting] ask crossover-antibody [set breed antibody-for-reselecting] re-select ask antibody-for-reselecting [set breed antibody] ask turtles [ antibody-kill-for-equal-affinity] ask antibody [die] ask turtles [ set breed antibody-population-set ] set generation generation + 1 tick set distance-list [antibody-distance] of turtles set min-distance min distance-list set max-distance max distance-list set average-distance mean distance-list update-plot cp clear-drawing ask turtles [show-turtle] ] find-global-min-path draw-best-path end to calculate-affinity set antibody-distance 0 set last-city 0 set current-city 0 let item# 1 let i 1 while [item# < (number-of-city)] [ set i 1 while [ i < (number-of-city)] [ ifelse ( item item# string = i ) [set current-city i set antibody-distance (antibody-distance) + (round (sqrt((((matrix:get distance-matrix last-city 0)-(matrix:get distance-matrix current-city 0)) ^ 2)+(((matrix:get distance-matrix last-city 1)-(matrix:get distance-matrix current-city 1)) ^ 2)))) set last-city i set i (number-of-city)] [set i i + 1] ] set item# item# + 1 ] set current-city 0 set antibody-distance (antibody-distance) + (round (sqrt((((matrix:get distance-matrix last-city 0)-(matrix:get distance-matrix current-city 0)) ^ 2)+(((matrix:get distance-matrix last-city 1)-(matrix:get distance-matrix current-city 1)) ^ 2)))) set affinity 1 / (antibody-distance) end to select if (count antibody >= selection-size) [stop] ask max-n-of selection-size antibody-population-set [affinity] [ move-to one-of patches set breed antibody ] assign-ordinal-number ;; this process is used to sort selected antibodies in descending order according to affinity.. end to assign-ordinal-number let k 0 while [ k < selection-size ] [ ask max-one-of antibody [affinity] [ set k k + 1 set ordinal-number k set breed antibody-to-be-assigned-ordinal-number ] ] ask antibody-to-be-assigned-ordinal-number [ set breed antibody] end to antibody-eliminate-for-equal-affinity let number-of-selected-antibody count antibody if (number-of-selected-antibody > selection-size) [ let affinity-of-turtle 0 foreach sort antibody [ ifelse (not (affinity-of-turtle = affinity)) [ set affinity-of-turtle affinity ] [set breed antibody-population-set] ] ] end to antibody-kill-for-equal-affinity let number-of-selected-antibody count re-selected-antibody if (number-of-selected-antibody > selection-size) [ let affinity-of-turtle 0 foreach sort re-selected-antibody [ ifelse (not (affinity-of-turtle = affinity)) [ set affinity-of-turtle affinity ] [die] ] ] ask re-selected-antibody [set breed antibody-population-set] end to clone let i 1 while [ i <= selection-size ] [ ask antibody with [ ordinal-number = i ] [ ;; In this section of algorithm a function is used to determine real clone size.. Antibodies that have higher affinity will clone more.. ifelse ((round (clone-size * ((selection-size - ordinal-number) / selection-size ))) >= 1) [ hatch (round (clone-size * ((selection-size - ordinal-number) / selection-size ))) [set breed clone-antibody] ] [ hatch 1 [set breed clone-antibody] ] ] set i i + 1 ] end to mutation-number-assigment ask clone-antibody [ set mutation-number (round (alfa * (round (clone-size * ((selection-size - ordinal-number) / selection-size ))))) set receptor-editing-number ((round (clone-size * ((selection-size - ordinal-number) / selection-size ))) - mutation-number ) ] end to hypermutation let i 1 while [ i <= selection-size ] [ ask clone-antibody with [ordinal-number = i] [ if (count clone-antibody-hypermutated with [ordinal-number = i] >= mutation-number ) [stop] ask n-of mutation-number clone-antibody with [ ordinal-number = i] [ hypermutate calculate-affinity] ] set i i + 1 ] end to receptor-editing-process let i 1 while [ i <= selection-size ] [ ask clone-antibody with [ordinal-number = i] [ receptor-editing calculate-affinity] set i i + 1 ] end to crossover ;; distance maintaining compact quantum crossover (for detailed information see reference [1] in the information tab). let i 1 let j selection-size while [ i <= (selection-size / 2)] [ let k random (number-of-city - 1) let m 0 let n 1 let string1 [] let string2 [] let string3 [] ask antibody with [ ordinal-number = i ] [ set string1 string ] ask antibody with [ ordinal-number = j ] [ set string2 string ] set string1 remove-item (number-of-city) string1 set string2 remove-item (number-of-city) string2 set string1 remove-item 0 string1 set string2 remove-item 0 string2 let c item (number-of-city - 2) string1 set string1 remove-item (number-of-city - 2) string1 let d item (number-of-city - 2) string2 set string2 remove-item (number-of-city - 2) string2 let currentcity1-2 0 let currentcity2-2 0 let currentcity1-1 0 let currentcity2-1 0 while [ n <= (number-of-city - 1)] [ if (k = (number-of-city - 2)) [set currentcity1-1 c set currentcity1-2 ((random (number-of-city - 2)) + 1)] if (k < (number-of-city - 3)) [set currentcity1-1 item k string1 set currentcity1-2 item (k + 1) string1] if (k = (number-of-city - 3)) [set currentcity1-1 item k string1 set currentcity1-2 c] if (m = (number-of-city - 2)) [set currentcity2-1 d set currentcity2-2 ((random (number-of-city - 2)) + 1)] if (m < (number-of-city - 3)) [set currentcity2-1 item m string2 set currentcity2-2 item (m + 1) string2] if (m = (number-of-city - 3)) [set currentcity2-1 item m string2 set currentcity2-2 d] if ( (member? currentcity1-2 string3) and (member? currentcity2-2 string3) ) [ let most-closed-city 0 let p 0 let min-local-distance 9999999 let y 1 let z currentcity1-1 while [ y < (number-of-city)] [ set p (round (sqrt((((matrix:get distance-matrix z 0)-(matrix:get distance-matrix y 0)) ^ 2)+(((matrix:get distance-matrix z 1)-(matrix:get distance-matrix y 1)) ^ 2)))) if ((p <= min-local-distance) and (not (member? y string3)) ) [set min-local-distance p set most-closed-city y] set y y + 1 ] set currentcity1-2 most-closed-city ] if ( (member? currentcity1-2 string3) and (not (member? currentcity2-2 string3)) ) [ set string3 lput currentcity2-2 string3 ifelse (currentcity2-2 = d) [set m (number-of-city - 2) ] [set m m + 1] ifelse ( currentcity2-2 = c) [ set k (number-of-city - 2) ] [set k (position currentcity2-2 string1)] ] if ( (member? currentcity2-2 string3) and (not (member? currentcity1-2 string3)) ) [ set string3 lput currentcity1-2 string3 ifelse (currentcity1-2 = c) [set k (number-of-city - 2) ] [set k k + 1] ifelse (currentcity1-2 = d) [set m (number-of-city - 2) ] [set m (position currentcity1-2 string2) ] ] let a (round (sqrt((((matrix:get distance-matrix currentcity1-1 0)-(matrix:get distance-matrix currentcity1-2 0)) ^ 2)+(((matrix:get distance-matrix currentcity1-1 1)-(matrix:get distance-matrix currentcity1-2 1)) ^ 2)))) let b (round (sqrt((((matrix:get distance-matrix currentcity2-1 0)-(matrix:get distance-matrix currentcity2-2 0)) ^ 2)+(((matrix:get distance-matrix currentcity2-1 1)-(matrix:get distance-matrix currentcity2-2 1)) ^ 2)))) if ( (a <= b) and (not (member? currentcity2-2 string3)) and (not (member? currentcity1-2 string3)) ) [ set string3 lput currentcity1-2 string3 ifelse (currentcity1-2 = c) [set k (number-of-city - 2) ] [set k k + 1] ifelse (currentcity1-2 = d) [ set m (number-of-city - 2) ] [set m (position currentcity1-2 string2) ] ] if ( (a > b) and (not (member? currentcity1-2 string3)) and (not (member? currentcity2-2 string3)) ) [ set string3 lput currentcity2-2 string3 ifelse (currentcity2-2 = d) [set m (number-of-city - 2)] [set m m + 1] ifelse ( currentcity2-2 = c) [ set k (number-of-city - 2) ] [set k (position currentcity2-2 string1)] ] set n n + 1 ] set string3 lput 0 string3 set string3 fput 0 string3 create-crossover-antibody 1 [ set ordinal-number j set string string3 calculate-affinity move-to one-of patches ] set i i + 1 set j j - 1 ] end to receptor-editing ;; receptor editing process (for detailed information see reference [2] in the information tab). let i 0 let j 0 let string1 remove-item 0 string let string2 remove-item (number-of-city - 1) string1 while [ (i = j) or (abs (i - j) <= 1) ] [ set i random (number-of-city - 2) set j random (number-of-city - 2) ] if (i < j ) [ let inversion-list sublist string2 (i + 1) j set inversion-list reverse inversion-list let m i + 1 let string3 [] while [ m <= (j - 1 ) ] [ set string2 remove-item (i + 1) string2 set string3 string2 set m m + 1 ] let string4 lput 0 string3 if (i = 0) [ set string2 sentence inversion-list string3 ] if (j = (number-of-city - 2)) [ let string5 sublist string4 0 i let string6 sublist string4 i ((number-of-city - 2) - (j - i) + 2) let string7 sentence string5 inversion-list set string2 sentence string7 string6 ] if ( (i > 0 ) and (j < (number-of-city - 2)) )[ let string5 sublist string4 0 (i + 1) let string6 sublist string4 (i + 1) ((number-of-city - 2) - (j - i) + 2) let string7 sentence string5 inversion-list set string2 sentence string7 string6 ] set string1 fput 0 string2 set string lput 0 string1 ] if (i > j) [ let inversion-list sublist string2 (j + 1) i set inversion-list reverse inversion-list let m j + 1 let string3 [] while [ m <= (i - 1 ) ] [ set string2 remove-item (j + 1) string2 set string3 string2 set m m + 1 ] let string4 lput 0 string3 if (j = 0) [ set string2 sentence inversion-list string3 ] if (i = (number-of-city - 2)) [ let string5 sublist string4 0 j let string6 sublist string4 j ((number-of-city - 2) - (i - j) + 2) let string7 sentence string5 inversion-list set string2 sentence string7 string6 ] if ( (j > 0 ) and (i < (number-of-city - 2)) ) [ let string5 sublist string4 0 (j + 1) let string6 sublist string4 (j + 1) ((number-of-city - 2) - (i - j) + 2) let string7 sentence string5 inversion-list set string2 sentence string7 string6 ] set string1 fput 0 string2 set string lput 0 string1 ] set breed clone-antibody-receptor-edited end to hypermutate let a 0 let b 0 let string1 remove-item 0 string let string2 remove-item (number-of-city - 1) string1 while [a = b] [ set a random (number-of-city - 2) set b random (number-of-city - 2) ] let c item a string2 let d item b string2 set string2 replace-item a string2 d set string2 replace-item b string2 c set string1 fput 0 string2 set string lput 0 string1 set breed clone-antibody-hypermutated end to re-select if (count re-selected-antibody >= selection-size) [stop] ask antibody with [ordinal-number = selection-size] [set breed re-selected-antibody] let i 1 while [ i < selection-size ] [ let a 0 ask one-of antibody with [ordinal-number = i] [set a affinity] ask max-one-of (antibody-for-reselecting with [ordinal-number = i]) [affinity] [ let b affinity if (a < b) [ set breed re-selected-antibody ] if ( (a >= b) and (i = 1) ) [ ask antibody with [ordinal-number = i] [set breed re-selected-antibody] set breed antibody-for-reselecting ] if ( (a >= b) and (i > 1) ) [ let p exp ((a - b) / expo-alfa) ifelse (random-float 1 >= p) [ ask antibody with [ordinal-number = i] [set breed re-selected-antibody] set breed antibody-for-reselecting ] [set breed re-selected-antibody ] ] ] set i i + 1 ] move-to one-of patches end to replace-antibody if (count elite-pool-antibody >= selection-size) [stop] ask max-n-of selection-size antibody [affinity] [ set breed elite-pool-antibody ] ask min-n-of replacement-size elite-pool-antibody [affinity] [die] random-generate end to random-generate create-random-generated-antibody replacement-size [ set string n-values 600 [one-of [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50]] set string remove-duplicates string if not (length string = (number-of-city - 1)) [ while [ not (length string = (number-of-city - 1))] [set string n-values 600 [one-of [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50]] set string remove-duplicates string] ] set string fput 0 string set string lput 0 string ] ask random-generated-antibody [ calculate-affinity set breed antibody-population-set ] end to find-global-min-path set winner max-one-of turtles [affinity] set global-min-string [string] of winner end to draw-best-path ask antibody-population-set [hide-turtle] ask patches[ set p-0-x (matrix:get distance-matrix 0 0) set p-0-y (matrix:get distance-matrix 0 1) set p-1-x (matrix:get distance-matrix 1 0) set p-1-y (matrix:get distance-matrix 1 1) set p-2-x (matrix:get distance-matrix 2 0) set p-2-y (matrix:get distance-matrix 2 1) set p-3-x (matrix:get distance-matrix 3 0) set p-3-y (matrix:get distance-matrix 3 1) set p-4-x (matrix:get distance-matrix 4 0) set p-4-y (matrix:get distance-matrix 4 1) set p-5-x (matrix:get distance-matrix 5 0) set p-5-y (matrix:get distance-matrix 5 1) set p-6-x (matrix:get distance-matrix 6 0) set p-6-y (matrix:get distance-matrix 6 1) set p-7-x (matrix:get distance-matrix 7 0) set p-7-y (matrix:get distance-matrix 7 1) set p-8-x (matrix:get distance-matrix 8 0) set p-8-y (matrix:get distance-matrix 8 1) set p-9-x (matrix:get distance-matrix 9 0) set p-9-y (matrix:get distance-matrix 9 1) set p-10-x (matrix:get distance-matrix 10 0) set p-10-y (matrix:get distance-matrix 10 1) set p-11-x (matrix:get distance-matrix 11 0) set p-11-y (matrix:get distance-matrix 11 1) set p-12-x (matrix:get distance-matrix 12 0) set p-12-y (matrix:get distance-matrix 12 1) set p-13-x (matrix:get distance-matrix 13 0) set p-13-y (matrix:get distance-matrix 13 1) set p-14-x (matrix:get distance-matrix 14 0) set p-14-y (matrix:get distance-matrix 14 1) set p-15-x (matrix:get distance-matrix 15 0) set p-15-y (matrix:get distance-matrix 15 1) set p-16-x (matrix:get distance-matrix 16 0) set p-16-y (matrix:get distance-matrix 16 1) set p-17-x (matrix:get distance-matrix 17 0) set p-17-y (matrix:get distance-matrix 17 1) set p-18-x (matrix:get distance-matrix 18 0) set p-18-y (matrix:get distance-matrix 18 1) set p-19-x (matrix:get distance-matrix 19 0) set p-19-y (matrix:get distance-matrix 19 1) set p-20-x (matrix:get distance-matrix 20 0) set p-20-y (matrix:get distance-matrix 20 1) set p-21-x (matrix:get distance-matrix 21 0) set p-21-y (matrix:get distance-matrix 21 1) set p-22-x (matrix:get distance-matrix 22 0) set p-22-y (matrix:get distance-matrix 22 1) set p-23-x (matrix:get distance-matrix 23 0) set p-23-y (matrix:get distance-matrix 23 1) set p-24-x (matrix:get distance-matrix 24 0) set p-24-y (matrix:get distance-matrix 24 1) set p-25-x (matrix:get distance-matrix 25 0) set p-25-y (matrix:get distance-matrix 25 1) set p-26-x (matrix:get distance-matrix 26 0) set p-26-y (matrix:get distance-matrix 26 1) set p-27-x (matrix:get distance-matrix 27 0) set p-27-y (matrix:get distance-matrix 27 1) set p-28-x (matrix:get distance-matrix 28 0) set p-28-y (matrix:get distance-matrix 28 1) set p-29-x (matrix:get distance-matrix 29 0) set p-29-y (matrix:get distance-matrix 29 1) set p-30-x (matrix:get distance-matrix 30 0) set p-30-y (matrix:get distance-matrix 30 1) set p-31-x (matrix:get distance-matrix 31 0) set p-31-y (matrix:get distance-matrix 31 1) set p-32-x (matrix:get distance-matrix 32 0) set p-32-y (matrix:get distance-matrix 32 1) set p-33-x (matrix:get distance-matrix 33 0) set p-33-y (matrix:get distance-matrix 33 1) set p-34-x (matrix:get distance-matrix 34 0) set p-34-y (matrix:get distance-matrix 34 1) set p-35-x (matrix:get distance-matrix 35 0) set p-35-y (matrix:get distance-matrix 35 1) set p-36-x (matrix:get distance-matrix 36 0) set p-36-y (matrix:get distance-matrix 36 1) set p-37-x (matrix:get distance-matrix 37 0) set p-37-y (matrix:get distance-matrix 37 1) set p-38-x (matrix:get distance-matrix 38 0) set p-38-y (matrix:get distance-matrix 38 1) set p-39-x (matrix:get distance-matrix 39 0) set p-39-y (matrix:get distance-matrix 39 1) set p-40-x (matrix:get distance-matrix 40 0) set p-40-y (matrix:get distance-matrix 40 1) set p-41-x (matrix:get distance-matrix 41 0) set p-41-y (matrix:get distance-matrix 41 1) set p-42-x (matrix:get distance-matrix 42 0) set p-42-y (matrix:get distance-matrix 42 1) set p-43-x (matrix:get distance-matrix 43 0) set p-43-y (matrix:get distance-matrix 43 1) set p-44-x (matrix:get distance-matrix 44 0) set p-44-y (matrix:get distance-matrix 44 1) set p-45-x (matrix:get distance-matrix 45 0) set p-45-y (matrix:get distance-matrix 45 1) set p-46-x (matrix:get distance-matrix 46 0) set p-46-y (matrix:get distance-matrix 46 1) set p-47-x (matrix:get distance-matrix 47 0) set p-47-y (matrix:get distance-matrix 47 1) set p-48-x (matrix:get distance-matrix 48 0) set p-48-y (matrix:get distance-matrix 48 1) set p-49-x (matrix:get distance-matrix 49 0) set p-49-y (matrix:get distance-matrix 49 1) set p-50-x (matrix:get distance-matrix 50 0) set p-50-y (matrix:get distance-matrix 50 1) ask patch p-0-x p-0-y [(set pcolor red) (set name "city 0__") set plabel name] ask patch p-1-x p-1-y [(set pcolor red) (set name "city 1__") set plabel name ] ask patch p-2-x p-2-y [(set pcolor red) (set name "city 2__") set plabel name ] ask patch p-3-x p-3-y [(set pcolor red) (set name "city 3__") set plabel name ] ask patch p-4-x p-4-y [(set pcolor red) (set name "city 4__") set plabel name ] ask patch p-5-x p-5-y [(set pcolor red) (set name "city 5__") set plabel name ] ask patch p-6-x p-6-y [(set pcolor red) (set name "city 6__") set plabel name ] ask patch p-7-x p-7-y [(set pcolor red) (set name "city 7__") set plabel name ] ask patch p-8-x p-8-y [(set pcolor red) (set name "city 8__") set plabel name ] ask patch p-9-x p-9-y [(set pcolor red) (set name "city 9__") set plabel name ] ask patch p-10-x p-10-y [(set pcolor red) (set name "city 10__") set plabel name ] ask patch p-11-x p-11-y [(set pcolor red) (set name "city 11__") set plabel name ] ask patch p-12-x p-12-y [(set pcolor red) (set name "city 12__") set plabel name ] ask patch p-13-x p-13-y [(set pcolor red) (set name "city 13__") set plabel name ] ask patch p-14-x p-14-y [(set pcolor red) (set name "city 14__") set plabel name ] ask patch p-15-x p-15-y [(set pcolor red) (set name "city 15__") set plabel name ] ask patch p-16-x p-16-y [(set pcolor red) (set name "city 16__") set plabel name ] ask patch p-17-x p-17-y [(set pcolor red) (set name "city 17__") set plabel name] ask patch p-18-x p-18-y [(set pcolor red) (set name "city 18__") set plabel name] ask patch p-19-x p-19-y [(set pcolor red) (set name "city 19__") set plabel name] ask patch p-20-x p-20-y [(set pcolor red) (set name "city 20__") set plabel name] ask patch p-21-x p-21-y [(set pcolor red) (set name "city 21__") set plabel name] ask patch p-22-x p-22-y [(set pcolor red) (set name "city 22__") set plabel name] ask patch p-23-x p-23-y [(set pcolor red) (set name "city 23__") set plabel name] ask patch p-24-x p-24-y [(set pcolor red) (set name "city 24__") set plabel name] ask patch p-25-x p-25-y [(set pcolor red) (set name "city 25__") set plabel name] ask patch p-26-x p-26-y [(set pcolor red) (set name "city 26__") set plabel name] ask patch p-27-x p-27-y [(set pcolor red) (set name "city 27__") set plabel name] ask patch p-28-x p-28-y [(set pcolor red) (set name "city 28__") set plabel name] ask patch p-29-x p-29-y [(set pcolor red) (set name "city 29__") set plabel name] ask patch p-30-x p-30-y [(set pcolor red) (set name "city 30__") set plabel name] ask patch p-31-x p-31-y [(set pcolor red) (set name "city 31__") set plabel name] ask patch p-32-x p-32-y [(set pcolor red) (set name "city 32__") set plabel name] ask patch p-33-x p-33-y [(set pcolor red) (set name "city 33__") set plabel name] ask patch p-34-x p-34-y [(set pcolor red) (set name "city 34__") set plabel name] ask patch p-35-x p-35-y [(set pcolor red) (set name "city 35__") set plabel name] ask patch p-36-x p-36-y [(set pcolor red) (set name "city 36__") set plabel name] ask patch p-37-x p-37-y [(set pcolor red) (set name "city 37__") set plabel name] ask patch p-38-x p-38-y [(set pcolor red) (set name "city 38__") set plabel name] ask patch p-39-x p-39-y [(set pcolor red) (set name "city 39__") set plabel name] ask patch p-40-x p-40-y [(set pcolor red) (set name "city 40__") set plabel name] ask patch p-41-x p-41-y [(set pcolor red) (set name "city 41__") set plabel name] ask patch p-42-x p-42-y [(set pcolor red) (set name "city 42__") set plabel name] ask patch p-43-x p-43-y [(set pcolor red) (set name "city 43__") set plabel name] ask patch p-44-x p-44-y [(set pcolor red) (set name "city 44__") set plabel name] ask patch p-45-x p-45-y [(set pcolor red) (set name "city 45__") set plabel name] ask patch p-46-x p-46-y [(set pcolor red) (set name "city 46__") set plabel name] ask patch p-47-x p-47-y [(set pcolor red) (set name "city 47__") set plabel name] ask patch p-48-x p-48-y [(set pcolor red) (set name "city 48__") set plabel name] ask patch p-49-x p-49-y [(set pcolor red) (set name "city 49__") set plabel name] ask patch p-50-x p-50-y [(set pcolor red) (set name "city 50__") set plabel name] ] create-salesman 1 [ set color blue setxy p-0-x p-0-y set string global-min-string calculate-affinity set path-length antibody-distance pen-down set pen-size 2.5 set shape "person" set size 4 ] ask salesman [ let x 1 while [x < (number-of-city)] [ if item x string = 1 [setxy p-1-x p-1-y] if item x string = 2 [setxy p-2-x p-2-y ] if item x string = 3 [setxy p-3-x p-3-y ] if item x string = 4 [setxy p-4-x p-4-y ] if item x string = 5 [setxy p-5-x p-5-y ] if item x string = 6 [setxy p-6-x p-6-y ] if item x string = 7 [setxy p-7-x p-7-y ] if item x string = 8 [setxy p-8-x p-8-y ] if item x string = 9 [setxy p-9-x p-9-y ] if item x string = 10 [setxy p-10-x p-10-y] if item x string = 11 [setxy p-11-x p-11-y ] if item x string = 12 [setxy p-12-x p-12-y ] if item x string = 13 [setxy p-13-x p-13-y ] if item x string = 14 [setxy p-14-x p-14-y ] if item x string = 15 [setxy p-15-x p-15-y] if item x string = 16 [setxy p-16-x p-16-y] if item x string = 17 [setxy p-17-x p-17-y] if item x string = 18 [setxy p-18-x p-18-y] if item x string = 19 [setxy p-19-x p-19-y] if item x string = 20 [setxy p-20-x p-20-y] if item x string = 21 [setxy p-21-x p-21-y] if item x string = 22 [setxy p-22-x p-22-y] if item x string = 23 [setxy p-23-x p-23-y] if item x string = 24 [setxy p-24-x p-24-y] if item x string = 25 [setxy p-25-x p-25-y] if item x string = 26 [setxy p-26-x p-26-y] if item x string = 27 [setxy p-27-x p-27-y] if item x string = 28 [setxy p-28-x p-28-y] if item x string = 29 [setxy p-29-x p-29-y] if item x string = 30 [setxy p-30-x p-30-y] if item x string = 31 [setxy p-31-x p-31-y] if item x string = 32 [setxy p-32-x p-32-y] if item x string = 33 [setxy p-33-x p-33-y] if item x string = 34 [setxy p-34-x p-34-y] if item x string = 35 [setxy p-35-x p-35-y] if item x string = 36 [setxy p-36-x p-36-y] if item x string = 37 [setxy p-37-x p-37-y] if item x string = 38 [setxy p-38-x p-38-y] if item x string = 39 [setxy p-39-x p-39-y] if item x string = 40 [setxy p-40-x p-40-y] if item x string = 41 [setxy p-41-x p-41-y] if item x string = 42 [setxy p-42-x p-42-y] if item x string = 43 [setxy p-43-x p-43-y] if item x string = 44 [setxy p-44-x p-44-y] if item x string = 45 [setxy p-45-x p-45-y] if item x string = 46 [setxy p-46-x p-46-y] if item x string = 47 [setxy p-47-x p-47-y] if item x string = 48 [setxy p-48-x p-48-y] if item x string = 49 [setxy p-49-x p-49-y] if item x string = 50 [setxy p-50-x p-50-y] set x x + 1 ] setxy p-0-x p-0-y pen-up ] end to setup-plot set-current-plot "Tour Length Plot (km)" end to update-plot set-current-plot "Tour Length Plot (km)" set-current-plot-pen "avg" plot average-distance set-current-plot-pen "max-distance" plot max-distance set-current-plot-pen "min-distance" plot min-distance end ; Copyright 2012 Baykasoglu, A.; Saltabas, A.; Tasan, A.S.; Subulan, K. (2012). ; See Info tab for full copyright and license. @#$#@#$#@ GRAPHICS-WINDOW 191 10 768 538 -1 -1 7.0 1 10 1 1 1 0 0 0 1 0 80 0 70 1 1 1 ticks SLIDER 10 111 182 144 initial-population-size initial-population-size 0 500 51 1 1 NIL HORIZONTAL BUTTON 8 374 71 407 NIL setup NIL 1 T OBSERVER NIL NIL NIL NIL SLIDER 9 156 181 189 number-of-generation number-of-generation 0 1000 993 1 1 NIL HORIZONTAL SLIDER 7 200 179 233 selection-size selection-size 0 300 51 1 1 NIL HORIZONTAL BUTTON 83 374 146 407 NIL go NIL 1 T OBSERVER NIL NIL NIL NIL SLIDER 7 240 179 273 clone-size clone-size 0 100 50 1 1 NIL HORIZONTAL MONITOR 30 469 113 514 NIL count turtles 17 1 11 MONITOR 16 418 118 463 NIL generation 17 1 11 PLOT 769 12 1322 348 Tour Length Plot (km) time distance 0.0 300.0 0.0 2200.0 true true PENS "avg" 1.0 0 -2674135 true "min-distance" 1.0 0 -14835848 true "max-distance" 1.0 0 -13345367 true SLIDER 6 280 185 313 replacement-frequency replacement-frequency 0 75 44 1 1 NIL HORIZONTAL SLIDER 4 323 176 356 replacement-rate replacement-rate 0 100 10 1 1 NIL HORIZONTAL MONITOR 167 539 931 584 Best path global-min-string 17 1 11 MONITOR 911 350 1021 395 path length (km) path-length 17 1 11 SLIDER 883 402 1055 435 number-of-city number-of-city 0 1000 51 1 1 NIL HORIZONTAL TEXTBOX 15 18 165 103 IMPROVED CLONAL SELECTION ALGORITHM FOR TRAVELING SALESMAN PROBLEM 14 62.0 0 TEXTBOX 168 615 927 660 Copyright: Baykasoglu, A.; Saltabas, A.; Tasan, A.S.; Subulan, K. (2012); Code: Saltabas A\n\n\"Realizing artificial immune system in a multi agent simulation environment and an application to travelling salesmen problem\" 10 7.0 1 @#$#@#$#@ WHAT IS IT? ----------- This model demonstrates the first application of an improved clonal selection algorithm to a traveling salesman problem (Eil51). Clonal selection algorithm is one of the most famous biologically-inspired artificial immune system algorithm. Traditional clonal selection algorithm works by generating a random antibody population of solutions for a problem, evaluating those solutions and then using cloning and hypermutation to create new solutions to the problem. But experiments showed that this traditional method has low performance to solve the traveling salesman problems. Thus, in the present model crossover mechanism [1] and receptor-editing process [2] are integrated into traditional clonal selection algorithm. In the present model "real valued vectors shape space" is used to represent solutions. "1 / travel tour distance" metric is used as the affinity measure. HOW IT WORKS ------------ The improved clonal selection algorithm is composed of the following steps. Step 1: Create an antibody population of random solutions (parameter: initial-population-size). Each antibody has a solution vector which is created randomly. Step 2: Calculate affinity for each antibody. Step 3: According the affinity, select n antibodies and sort in descending order. (A1, A2, ... , An) (parameter: selection-size) Step 4: Clone the selected antibodies. (parameter: clone-size) Step 5: Hypermutate and receptor-editing process. Update affinities. Step 6: Crossover process. Update affinities. Step 7: According the affinity of antibodies that are created in step 5 and step 6, re-select n antibodies (parameter: selection-size). Step 8: Update antibodies by comparing the affinity of antibodies that are selected in step 3 and step 7. Step 9: In each "replacement-frequency" generation, select k antibodies according to affinity (select antibodies that have worse affinity) and kill those antibodies. Then create k random antibodies and insert them in antibody population (parameter: replacement-frequency and replacement-rate). Step 10: If the iteration number reaches maximum generation number, stop. Else, go to step 3. (parameter: number-of-generation) HOW TO USE IT ------------- Press the SETUP button to create a random initial antibody population. Press the GO button to run improved clonal selection algorithm to solve the traveling salesman problem. "Eil51" problem from the literature is programmed as an example. For running the model number-of-city slider is adjusted correctly. This parameter is used as a variable in the procedure of the model. In each "replacement-frequency" generation the best solution tour can be seen in the VIEW. Parameters: Initial-population-size: This slider controls the initial population size. For example, if initial-population-size is 400, algorithm will create 400 random antibody at zeroth generation. Number-of-generation: This slider controls maximum number of generation that limits the running time of the algorithm. Selection-size: This slider controls selection size that is used in step 3 and step 5 of algorithm. Clone-size: This slider controls clone size that is used in step 4 of the algorithm. Clone size parameter is not enough to determine real clone size in the algorithm. Real clone size is determined by using a function that contains clone-size parameter. Through this function, antibody which has better affinity clones more and antibody which has worse affinity clones less. Replacement-frequency: This slider is used to determine replacement generation. For example, if replacement-frequency parameter is 20, algorithm will achieve replacement process in 20th, 40th, 60th, ... generation. Replacement-rate: This slider controls replacement size as percentage. This parameter is used in step 9 of the proposed algorithm. For example, if antibody population size is 100 and replacement-rate is 20(%), the algorithm will kill 20 antibody that have worst affinity and then insert 20 random antibody into the population. The "Tour Length Plot" is used to show the best, average, and worst tour length values of the solutions at each generation. THINGS TO TRY ------------- You can make many different experiments by changing the parameters. CREDITS AND REFERENCES ---------------------- [1] Dai, H.; Yang, Y.; Li, C., “Distance Maintaining Compact Quantum Crossover Based Clonal Selection Algorithm”, Journal of Convergence Information Technology, Volume 5, No 10, 2010. [2] Gao, S.; Dai, H.; Yang, G.; Tang, Z., “A Novel Clonal Selection Algorithm and Its Application to Traveling Salesman Problem”, IEICE Trans. Fundamentals, Volume E90–A, No 10, 2007. [3] De Castro, L.; Von Zuben, F., “Learning and Optimization Using The Clonal Selection Principle”, Evolutionary Computation , 239-251, 2002. [4] Dasgupta, D.; Nino, F., Immunological Computation: Theory and Applications, Auerbach Publications, 2008. [5] Dasgupta, D.; Yu, S.; Nino, F., “Recent Advances In Artificial Immune Systems: Models And Applications”, Applied Soft Computing , 1574-1587, 2011. [6] Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. HOW TO CITE ---------------------- If you mention this model in an academic publication, we ask that you include these citations: For the model itself: -1) Adil Baykasoglu, Alper Saltabas, A. Serdar Tasan, Kemal Subulan (2012). Realizing artificial immune system in a multi agent simulation environment and an application to travelling salesmen problem, Submitted to “Journal of The Faculty of Engineering and Architecture of Gazi University” (In Turkish). -2) Baykasoglu, A.; Saltabas, A.; Tasan, A.S.; Subulan, K. (2012). Improved Clonal Selection Algorithm for Travelling Salesmen Problem in NetLogo. Dokuz Eylul University, Faculty of Engineering, Department of Industrial Engineering, Tinaztepe Campus, 35160 Izmir, Turkey. For the NetLogo software: - Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. In other publications, please use: - Adil Baykasoglu, Alper Saltabas, A. Serdar Tasan, Kemal Subulan (2012). Realizing artificial immune system in a multi agent simulation environment and an application to travelling salesmen problem, Submitted to “Journal of The Faculty of Engineering and Architecture of Gazi University” (In Turkish). COPYRIGHT NOTICE ---------------------- Copyright: Baykasoglu, A.; Saltabas, A.; Tasan, A.S.; Subulan, K. (2012). All rights reserved. @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 airplane true 0 Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box false 0 Polygon -7500403 true true 150 285 285 225 285 75 150 135 Polygon -7500403 true true 150 135 15 75 150 15 285 75 Polygon -7500403 true true 15 75 15 225 150 285 150 135 Line -16777216 false 150 285 150 135 Line -16777216 false 150 135 15 75 Line -16777216 false 150 135 285 75 bug true 0 Circle -7500403 true true 96 182 108 Circle -7500403 true true 110 127 80 Circle -7500403 true true 110 75 80 Line -7500403 true 150 100 80 30 Line -7500403 true 150 100 220 30 butterfly true 0 Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 Circle -16777216 true false 135 90 30 Line -16777216 false 150 105 195 60 Line -16777216 false 150 105 105 60 car false 0 Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 Circle -16777216 true false 180 180 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 Circle -7500403 true true 47 195 58 Circle -7500403 true true 195 195 58 circle false 0 Circle -7500403 true true 0 0 300 circle 2 false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 cow false 0 Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 Polygon -7500403 true true 73 210 86 251 62 249 48 208 Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 cylinder false 0 Circle -7500403 true true 0 0 300 dot false 0 Circle -7500403 true true 90 90 120 face happy false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 face neutral false 0 Circle -7500403 true true 8 7 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Rectangle -16777216 true false 60 195 240 225 face sad false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 fish false 0 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 Circle -16777216 true false 215 106 30 flag false 0 Rectangle -7500403 true true 60 15 75 300 Polygon -7500403 true true 90 150 270 90 90 30 Line -7500403 true 75 135 90 135 Line -7500403 true 75 45 90 45 flower false 0 Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 Circle -7500403 true true 85 132 38 Circle -7500403 true true 130 147 38 Circle -7500403 true true 192 85 38 Circle -7500403 true true 85 40 38 Circle -7500403 true true 177 40 38 Circle -7500403 true true 177 132 38 Circle -7500403 true true 70 85 38 Circle -7500403 true true 130 25 38 Circle -7500403 true true 96 51 108 Circle -16777216 true false 113 68 74 Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 house false 0 Rectangle -7500403 true true 45 120 255 285 Rectangle -16777216 true false 120 210 180 285 Polygon -7500403 true true 15 120 150 15 285 120 Line -16777216 false 30 120 270 120 leaf false 0 Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 line true 0 Line -7500403 true 150 0 150 300 line half true 0 Line -7500403 true 150 0 150 150 pentagon false 0 Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 person false 0 Circle -7500403 true true 110 5 80 Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 Rectangle -7500403 true true 127 79 172 94 Polygon -7500403 true true 195 90 240 150 225 180 165 105 Polygon -7500403 true true 105 90 60 150 75 180 135 105 plant false 0 Rectangle -7500403 true true 135 90 165 300 Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 sheep false 0 Rectangle -7500403 true true 151 225 180 285 Rectangle -7500403 true true 47 225 75 285 Rectangle -7500403 true true 15 75 210 225 Circle -7500403 true true 135 75 150 Circle -16777216 true false 165 76 116 square false 0 Rectangle -7500403 true true 30 30 270 270 square 2 false 0 Rectangle -7500403 true true 30 30 270 270 Rectangle -16777216 true false 60 60 240 240 star false 0 Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 target false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 Circle -7500403 true true 60 60 180 Circle -16777216 true false 90 90 120 Circle -7500403 true true 120 120 60 tree false 0 Circle -7500403 true true 118 3 94 Rectangle -6459832 true false 120 195 180 300 Circle -7500403 true true 65 21 108 Circle -7500403 true true 116 41 127 Circle -7500403 true true 45 90 120 Circle -7500403 true true 104 74 152 triangle false 0 Polygon -7500403 true true 150 30 15 255 285 255 triangle 2 false 0 Polygon -7500403 true true 150 30 15 255 285 255 Polygon -16777216 true false 151 99 225 223 75 224 truck false 0 Rectangle -7500403 true true 4 45 195 187 Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 Rectangle -1 true false 195 60 195 105 Polygon -16777216 true false 238 112 252 141 219 141 218 112 Circle -16777216 true false 234 174 42 Rectangle -7500403 true true 181 185 214 194 Circle -16777216 true false 144 174 42 Circle -16777216 true false 24 174 42 Circle -7500403 false true 24 174 42 Circle -7500403 false true 144 174 42 Circle -7500403 false true 234 174 42 turtle true 0 Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 wheel false 0 Circle -7500403 true true 3 3 294 Circle -16777216 true false 30 30 240 Line -7500403 true 150 285 150 15 Line -7500403 true 15 150 285 150 Circle -7500403 true true 120 120 60 Line -7500403 true 216 40 79 269 Line -7500403 true 40 84 269 221 Line -7500403 true 40 216 269 79 Line -7500403 true 84 40 221 269 x false 0 Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ NetLogo 4.1.3 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 1.0 0.0 0.0 1 1.0 0.0 0.2 0 1.0 0.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@ 0 @#$#@#$#@