A genetic algorithm was constructed in postfix notation (Table 3
) and written in Fortran (Microsoft; Redmond, WA). The genetic algorithm consisted of 1,000 chromosomes, with each chromosome containing data (the operand) and unitary and binary operators. Unitary operators (sine, cosine, logarithm, exponent [ex], and square root) perform an operation on only one data point. Binary operators (addition, subtraction, multiplication, and division) perform an operation on two data points. The data points consisted of the 11 types of data collected for each breath (phase II [PII] slope, the slope of the rapid rise portion of the capnogram; phase III [PIII] slope, the slope of the plateau portion of the capnogram; Ti; expiratory time [Te]; mean expired CO2; Petco2 − Pco2 at end-expiration, volume of exhaled CO2, inspiratory tidal volume [Vi], expiratory tidal volume [Ve], the Pco2 concentration at the intercept of the PII slope and the PIII slope (Pintco2), and the time from start of exhalation to the intercept of PII slope and PIII slope [int time]) (Fig 1
), along with the numbers 1, 2, 5, and 10. While numbers can be generated from the other data genes (eg, 2 = [PII slope + PII slope]/PII slope), evolution may be accelerated by seeding with numbers. Each chromosome was randomly seeded with the three types of genes with certain restrictions set by the requirements of postfix notation: the first gene must be an operand, the second gene must be an operand or unitary operator, and the last gene must be an unitary or a binary operator. While there may be an arbitrary number of unitary operators, mathematics requires that there must be one more operand than binary operator. Operators were protected to prevent mathematically illegal operations, eg, division by zero and square root of negative numbers, or computer overflow and loss of precision errors. Chromosomes that contained a protected operator were assigned a very poor fitness score to ensure their failure to propagate to the next generation.