Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- h(n) = x sin(x)/2 + 10 : 0 <= x <= 15
- Wolfram: plot x/2 sin(x) + 10, from x=0 to x=15
- n = 7 bees
- 1. Initialize n bees with any x coord for the function.
- 2. Evaluate population.
- 3. Repeat (just once, since we're doing 1st iteration):
- 1. Select m : m < n patches to search in their neighborhood.
- 2. Select e : e < m as the best e patches of those m.
- 3. Determine size of patches.
- 3. Recruit SOME bees for e and some others for m such that bees on e > bees on m.
- 4. Evaluate best bee on EACH patch.
- 5. Assign n-m bees to randomly search
- 6. Evaluate them.
- Starting positions for n=7 explorer bees (using random numbers from 0-150, and then divided by 10):
- Rn1 = 16, x = 1.6, h(n1) = 1.6/2 sin(1.6) + 10 = 10.79
- Rn2 = 90, x = 9, h(n2) = 11.85
- Rn3 = 118, x = 11.8, h(n3) = 5.9
- Rn4 = 112, x = 11.2, h(n4) = 4.51
- Rn5 = 58, x = 5.8, h(n5) = 8.65
- Rn6 = 126, x = 12.6, h(n6) = 10.21
- Rn7 = 142, x = 14.2, h(n7) = 17.08
- Parameters were defined as:
- m=4, e=2, m-e=2.
- e1 = n7 with h(n7) = 17.08
- e2 = n2 with h(n2) = 11.85
- p1 = n1 with h(n1) = 10.79
- p2 = n6 with h(n6) = 10.21
- Neighborhood is of size 1 (that means 10 in random numbers).
- n=2 for elite patches.
- n=1 for non-elite patches.
- Recruiting worker bees for elite patch (e1 = n7) (using random numbers from 132 to 152, i.e. from 14.2 x 10 - 10, to 14.2 x 10 + 10):
- Rn8 = 136, x = 13.6, h(ne1) = 15.84
- Rn9 = 147, x = 14.7, h(ne2) = 16.21
- Recruiting worker bees for elite patch (e2 = n2) (using random numbers from 80 to 100, i.e. from 9 x 10 - 10, to 9 x 10 + 10):
- Rn10 = 87, x = 8.7, h(ne3) = 12.88
- Rn11 = 99, x = 9.9, h(ne4) = 7.73
- Recruiting worker bees for non-elite patch (p1 = n1) (using random numbers from 6 to 26):
- Rn12 = 19, x = 1.9, h(np1) = 10.89
- Recruiting worker bees for non-elite patch (p2 = n6) (using random numbers from 116 to 136):
- Rn13 = 123, x = 12.3, h(np2) = 8.38
- The best bees so far are as follows:
- For patch e1, bee n7 with h(n7) = 17.08
- For patch e2, bee ne3 with h(ne3) = 12.88
- For patch p1, bee np1 with h(np1) = 10.89
- For patch p2, bee n6 with h(n6) = 10.21
- Recruiting now n-m=3 new explorer bees for random search:
- Rn14 = 105, x = 10.5, h(n8) = 5.38
- Rn15 = 112, x = 11.2, h(n9) = 4.51
- Rn16 = 61, x = 6.1, h(n10) = 9.44
- Best bee this iteration: n7 with x = 14.2 and h(n7) = 17.08.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement