CAPÍTULO II MARCO TEÓRICO
RESULTADOS Y DISCUSIÓN 4.1 REGIÓN DE PUNO.
4 En la actividad minera existen dos formas convencionales en las que realizan los trabajos para la extracción del mineral, el del tajo abierto y socavón (Basadre, 197).
4.4 ANALIZANDO LAS PERCEPCIONES DE LOS ACTORES
4.4.1 Causas de los conflictos socio-ambientales generados en el proyecto BCMC-PSA.
After the \caterpillar" runs described above, a number of changes were made with a view to discouraging caterpillar like programs and encouraging circular queue implementations (see also Table 4.5):
The number of tests run was doubled from 160 to 320 by adding a 5th test sequence
of 160 tests. This prevents caterpillar like solutions by adding sucient enqueue operations to ensure a caterpillar will run into the end of the indexed memory.
However after the addition of the 5th test sequence, it was noted that in some cases
the population still converged to caterpillar like partial solutions. Until they ran out of memory these were tter than the rest of the population and so dominated it but the 5th test sequence prevents them from passing all the tests.
To discourage memory hungry partial solutions early in the population's evolution, a memory penalty was introduced. This reduced an individual's tness by 2.0 per word of indexed memory used, above 15 words. 15 was chosen to allow for a circular queue implementation (10) and to allow the two pointers to be stored in indexed memory (2) plus a few spare.
The penalty is calculated from the maximum memory used across the ve test se- quences. Memory usage need not be symmetric but it is assumed to be contiguous, i.e. the penalty is based upon the index number of the highest memory cell used minus that of the lowest cell used plus 1.
Whilst penalising caterpillar like solutions it may also have penalised memory in- tensive solutions such as linked lists but (as the next section will show) it does not prevent other implementations such as packed arrays which make ecient use of memory.
It was noted that various partial solutions exploited holes in the test sequences, such
as the lack of small values (particularly zero) in the queue. Therefore the distribution of values in the queue was changed from uniform to a \tangent" distribution. A tangent distribution is produced by generating random numbers uniformly between 0 and
and taking their tangent. The answer is multiplied by a scaling factor,F
. 50% of the numbers generated are expected to be in the range ;F
+F
Table 4.5: Tableau for Evolving a Queue: Shuer solution found Objective To evolve a rst-in rst-out queue
Architecture Five separate trees, plus single ADF
Primitives +, ;, 0, 1, max, mod, arg1, aux1, Inc Aux1, Dec Aux1, aux2,
Inc Aux2, Dec Aux2, read, write, Set Aux1, Set Aux2, Adf1
Fitness Case 4 test sequences like those for the stack (see Tables 3.3 and 3.4) plus 5th test sequence of 160 tests, use of tan argument distribution (F = 31.4)
Memory errors or recursive adf1 calls abort program
Fitness Scaling 1.0 for each front, dequeue and empty test passed, plus 0.05 for each makenull and enqueue test passed, less 2.0 for each word of indexed memory used above 15.
Selection Scalar tournament of 4
Hits n/a
Wrapper makenull result ignored
front no wrapper
dequeue no wrapper enqueue result ignored
empty result = 0) TRUE, otherwise FALSE
adf1 n/a
Parameters Population = 10,000, G=50, program size 250
Success Predicate tness 187, i.e. all 320 tests passed
see Figure 4.4. In this section
F
was set to 31.4, so approximately half the values enqueued correspond to legal memory indices.In a group of 379 runs, one run found a solution which passes all 320 tests (see Figures 4.5 and 4.6. Many partial solutions (i.e. which passed many of the tests) of this type were also found and a few solutions which pass the whole test case were found by runs with slightly dierent parameters or primitives).
As Figure 4.5 shows, this solution correctly implements a rst in rst out queue of up to nine items. Unexpectedly it does this by physically moving the contents of the memory cells. I.e. as each item is removed from the queue, all the remaining items are moved (or shued) one place down. Thus the front of the queue is always stored in a particular location. One of the auxiliary variables is used to denote the newest item in the queue. This is also the number of items in the queue and so can be used directly by empty to decide if the queue is empty or not. The other variable is used by dequeue as scratch storage. It is always zero when not being used by dequeue. adf1 has the \trivial" use of
-100 -50 0 50 100 0 0.25 0.5 0.75 1
Enqueued random numbers
Uniform random number F -F 31.4 * tan (x*pi) 31.4 -31.4 0
Figure 4.4: Tangent function used to generate distribution of test data values from
F
tan(x
). Wherex
is a uniform random number andF
is a scaling coecient. clearing the second auxiliary variable when called by makenull.Figure 4.6 gives the clear impression of being built up in stages. As each stage is added to dequeue it can process longer queues and so pass more tests, i.e. it has a higher tness.
0 1 2 3 4 5 6 7 8 9 10 11 12 13
front dequeue
aux1
0 queue queue queue queue queue queue queue queue queue9 0 0 0 0
enqueue
Figure 4.5: Execution of \Shuer" program. Note data are always dequeued from cell 1 but may be enqueued into any cell 1
:::
9.Inc_Aux2 write write Inc_Aux2 write Inc_Aux2 write Inc_Aux2 write Inc_Aux2 mod Inc_Aux2 write Inc_Aux2 write Inc_Aux2 write Inc_Aux2 Inc_Aux2 mod Inc_Aux2 write Set_Aux2 arg1 Set_Aux1 Dec_Aux1 makenull Adf1 Set_Aux1 Adf1 Set_Aux1 arg1 front mod mod read 1 aux2 0 empty read aux1 Set_Aux2 Set_Aux2 arg1 adf1 write Inc_Aux1 arg1 enqueue write Inc_Aux2 write Inc_Aux2 write Inc_Aux2 write Adf1 mod aux2 write max arg1 mod dequeue
Figure 4.6: \Shuer" Program
empty read aux1 read 1 write Inc_Aux1 arg1 enqueue write Inc_Aux2 write Inc_Aux2 write Inc_Aux2 write Inc_Aux2 write Inc_Aux2 write Inc_Aux2 write Inc_Aux2 write Inc_Aux2 Set_Aux2 Dec_Aux1 Prog2 0 read Inc_Aux2 Qrog2 dequeue makenull front Prog2 Set_Aux1 Set_Aux2 0 0