EarthWeb   
HomeAccount InfoLoginSearchMy ITKnowledgeFAQSitemapContact Us
     

   
  All ITKnowledge
  Source Code

  Search Tips
  Advanced Search
   
  

  

[an error occurred while processing this directive]
Previous Table of Contents Next


7.2 Rule Selection in Less Time

The cart-pole problem of Chapter 3 is a challenging control problem and a benchmark for testing process control strategies. Since a near-optimum fuzzy controller has been developed for the cart-pole system, this problem provides an effective test-bed for investigating the ability of a GA to re-discover the appropriate action to be associated with each rule. Fuzzy membership functions have already been defined for the condition and action variables and these membership functions are used here. Since the condition variables and the associated fuzzy membership functions are defined, and since the approach we have adopted is to write a rule for every possible combination of condition variables, the number of rules is determined. In this case, there are 108 rules to be written because x is described using four linguistic terms, is described using three linguistic terms, θ is described using three linguistic terms, and is described using three linguistic terms; (4)(3)(3)(3)=108. There still remains the task of selecting the appropriate action to be associated with each of the 108 rules.

All of the rules in the cart-pole system are not readily apparent. For example, consider the situation for which the following conditions exist: (1) x is POSITIVE SMALL (just to the right of center), (2) is NEAR ZERO (the cart velocity is small), (3) θ is POSITIVE (the pole is to the right of vertical), and (4) is NEAR ZERO (the angular velocity of the pole is small). This situation is depicted in Figure 7.1. Even though the membership functions for the seven potential actions are defined (as shown in Figure 7.2), the appropriate action is not readily apparent. The conditions on the cart (x and ) seem to suggest a force of NEGATIVE SMALL, while the conditions on the pole (θ and ) seem to suggest a force of POSITIVE SMALL. Naturally, the developer can attempt to resolve the conflict by reasoning about the system (in this case, balancing the pole is a priority so a POSITIVE FORCE is applied). Such reasoning often fails. In our experience, the decision almost always becomes a trial-and-error process. Moreover, we have worked with systems that we did not understand as well as we do the cart-pole system (the helicopter system presented in Chapter 18 is an example). In these systems, the necessary analysis is not feasible. Thus, the determination of effective actions for each of the rules is fertile ground for applying a GA.

When using GAs for rule selection, there are still the two issues of coding and fitness function determination that must be addressed. Fortunately, the techniques presented in Chapters 5 and 6 are again applicable. The details of their implementation follow.


Figure 7.2  The membership functions for F set forth in Chapter 3 are used here. These membership functions provide the developer with seven linguistic terms from which to choose an appropriate action.

7.2.1 Coding

When no rules are pre-selected because they are obvious, there are 108 conditions for which one of seven linguistic terms is to be selected. Thus, there exist 1087 = 1.713*1014 possibilities for the rule set. The problem of coding involves developing a mechanism in which an entire rule set can be encoded as a string of characters. In this case, the characters will be bits.

We will employ a form of the concatenated, mapped, unsigned binary coding described in previous chapters. In this coding, substrings represent individual parameters (in this case individual rule actions), which are linearly mapped, and concatenated to form strings that represent complete solutions (entire rule sets). One of seven terms is to be selected for each of 108 conditions. Thus, each substring must represent one of the seven possible action values. The following encoding is used:

string interpretation
000 NEGATIVE BIG
001 NEGATIVE MEDIUM
010 NEGATIVE SMALL
011 NEAR ZERO
100 NEAR ZERO
101 POSITIVE SMALL
110 POSITIVE MEDIUM
111 POSITIVE BIG

Note that in this encoding, there are two strings representing NEAR ZERO. This is because the seven choices for force require at least three binary digits (two binary digits allow for the representation of only four choices). In general, this duplication is not desirable because the rule values are biased to NEAR ZERO. However, in this instance, the bias of the solutions associated with the duplication is outweighed by the sheer simplicity of the coding representation. In Chapter 9 we will demonstrate an alternative solution in a more difficult instance of the cart-pole system.

Given the above representation of the individual rule actions, a complete rule string is easily represented using a bit-string composed of 108 individual three-bit substrings. Thus, the bit-strings used in this coding are of length 108*3 = 324. As a point of interest, this is a rather long bit string representing 2108 = 3.24*1032 possible solutions. This calculation reveals another problem associated with the duplication in the coding scheme. The GA must search a space with more points than is actually required in the problem, 3.24*1032 versus the 1087 = 1.713*1014 distinct possibilities.


Previous Table of Contents Next

Copyright © CRC Press LLC

HomeAccount InfoSubscribeLoginSearchMy ITKnowledgeFAQSitemapContact Us
Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.