Compiling and Using the C++ Fuzzy Modelling Code in The Fuzzy Systems Handbook The C++ code included with The Fuzzy Systems Handbook comprises a complete low-level fuzzy modeling environment. The functions are designed for inclusion in a larger application framework and, by them- selves, do not constitute an operational system. Examining the demon- stration pricing model and inventory control demonstration programs, included with the book, will show how this is done. Please review the “READ.ME” file prior to using the software. It provides important information, updates, and details regarding various compilers. If you discover problems in the actual operation of the code, please con- tact me. My fax number is (914) 238-0837. My e-mail number is [email protected]. Earl Cox CEO The Metus Systems Group Icons and Topic Symbols Throughout the handbook you will encounter a series of “sidebars” covering a wide variety of special topics. Each topic is set off from the main text and is introduced by a specific icon. Code Discussion and Cross-reference. The diskette icon indicates that this section deals with code models, programs, and software in general. This icon usually means that a concept discussion is being tied back to the actual supporting code in one or more of the libraries. System Internals. The plumbing icon indicates that this section discusses system internals. System interals refer to the data structures, control blocks, interprogram linkages, process flow, and other details associated with the way fuzzy modeling systems work. Key Topics. A key icon indicates a detailed discussion on some important aspect of the system. The nature of key topics covers a broad spectrum: from hints and techniques that may not be obvious to detailed and off-line explorations of concepts and philosophies. System Construction. The hammer icon represents discussions centered around the construction of models, applications, and high-level software systems. This topic is not specifically concerned with function code or data structures. Practical Hints and Techiques. The wingnut (“nuts and bolts”) icon indicates a discussion about the practical considerations of the current topic. This includes programming techniques, system design consider- ations, methodology approaches, etc. Mathematical Topics. The ruler icon indicates a discussion of mathemati- cal, logical, or algorithmic topics. This includes the underlying mathemat- ics of fuzzy set theory, technical computer algorithms, topics in stability and verification, as well as discussions of performance metrics. The icon is only used for detailed discussed outside the main manual text. Danger! Warning! The lightning bolt icon indicates a topic that could by potentially dangerous to model intergrity, validation, or data. The danger icon is also used to highlght harmful side effects that are not obvious. You should read every danger topic carefully. Reminders and Warnings. The reminder icon indicates a discussion of important, but generally not obvious, points that the user must consider when exploiting some portion of the fuzzy modeling technology. The Fuzzy Systems Handbook by Earl Cox Icons and Topic Symbols Symbol Use ~ set NOT (also complement or inversion) (cid:62) set AND (also intersection operator) (cid:60) set OR (also union operator) (cid:58) higher dimensional fuzzy space [x,x,x] indicates a fuzzy membership value (cid:101) member of a set (general membership) poss(x) the possibility of event x prob(x) the probability of event x {x} crisp or Boolean membership function • dyadic operator (cid:106)(x) The expected value of a fuzzy region (cid:109) fuzzy membership function (cid:126) proportionality (cid:109)[x] membership or truth function in fuzzy set ´ element from domain of fuzzy set (cid:94) Cartesian product or space ˘ empty or null set (cid:46) implication (cid:96) logical AND (cid:126) logical OR (cid:111) summation The Fuzzy Systems Handbook by Earl Cox . The Fuzzy Systems H a n d b o o k LIMITED WARRENTY AND DISCLAIMER OF LIABILTIY ACADEMIC PRESS, INC. (“AP”) AND ANYONE ELSE WHO HAS BEEN INVOLVED IN THE CREATION OR PRODUCTION OF THE ACCOMPANYING CODE (“THE PRODUCT”) CANNOT AND DO NOT WARRANT THE PERFORMANCE OR RESULTS THAT MAY BE OBTAINED BY USING THE PRODUCT. THE PRODUCT IS SOLD “AS IS” WITHOUT WARRANTY OF ANY KIND (EXCEPT AS HEREAFTER DESCRIBED), EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY OF PERFORMANCE OR ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. AP WARRANTS ONLY THAT THE MAGNETIC DISKETTE(S) ON WHICH THE CODE IS RECORDED IS FREE FROM DEFECTS IN MATERIAL AND FAULTY WORKMANSHIP UNDER THE NORMAL USE AND SERVICE FOR A PERIOD OF NINETY (90) DAYS FROM THE DATE THE PRODUCT IS DELIVERED. THE PURCHASER’S SOLE AND EXCLUSIVE REMEDY IN THE EVENT OF A DEFECT IS EXPRESSLY LIMITED TO EITHER REPLACEMENT OF THE DISKETTE(S) OR REFUND OF THE PURCHASE PRICE, AT AP’S SOLE DISCRETION. IN NO EVENT, WHETHER AS A RESULT OF BREACH OF CONTRACT, WARRANTY OR TORT (INCLUDING NEGLIGENCE), WILL AP OR ANYONE WHO HAS BEEN INVOLVED IN THE CREATION OR PRODUCTION OF THE PRODUCT BE LIABLE TO PURCHASER FOR ANY DAMAGES, INCLUDING ANY LOST PROFITS, LOST SAVINGS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PRODUCT OR ANY MODIFICATIONS THEREOF, OR DUE TO THE CONTENTS OF THE CODE, EVEN IF AP HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. Any request for replacement of a defective diskette must be postage prepaid and must be accompanied by the original defective diskette, your mailing address and telephone number, and proof of date of purchase and purchase price. Send such requests, stating the nature of the problem, to Academic Press Customer Service, 6277 Sea Harbor Drive, Orlano, FL 32887, 1-800-321-5068. APP shall have no obligation to refund the purchase price or to replace a diskette based on claims of defects in the nature or operation of the Product. Some states do not allow limitation on how long an implied warranty lasts, nor exclusions or limitations of incidental or consequential damage, so the above limitations and exclusions may not apply to you. This Warranty gives you specific legal rights, and you may also have other rights which vary from jurisdiction to jurisdiction. THE RE-EXPORT OF UNITED STATES ORIGIN SOFTWARE IS SUBJECT TO THE UNITED STATES LAWS UNDER THE EXPORT ADMINISTRATION ACT OF 1969 AS AMENDED. ANY FURTHER SALE OF THE PROD- UCT SHALL BE IN COMPLIANCE WITH THE UNITED STATES DEPARTMENT OF COMMERCE ADMINIS- TRATION REGULATIONS. COMPLIANCE WITH SUCH REGULATIONS IS YOUR RESPONSIBILITY AND NOT THE RESPONSIBLITY OF AP. The Fuzzy Systems H a n d b o o k A P r a c t i t i o n e r ’ s G u i d e t o B u i l d i n g , U s i n g , a n d M a i n t a i n i n g F u z z y S y s t e m s E A R L C O X Chappaqua, New York AP PROFESSIONAL BOSTON SAN DIEGO NEW YORK LONDON SYDNEY TOKYO TORONTO Contents iv This book is printed on acid-free paper. ¥ Copyright ” 1994 by Academic Press, Inc. All rights reserved. No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopy, recording, or any information storage and retrieval system, without permission in writing from the publisher. All brand names and product names mentioned in this book are trademarks or registered trademarks of their respective companies. BYTE Magazine quote on back cover taken from “Put Fuzzy Logic to Work,” lon Udell, BYTE Magazine, July 1994. (cid:211) McGraw-Hill, Inc. AP PROFESSIONAL 1300 Boylston Street, Chestnut Hill, MA 02167 An Imprint of ACADEMIC PRESS, INC. A Division of HARCOURT BRACE & COMPANY United Kingdom Edition published by ACADEMIC PRESS LIMITED 24-28 Oval Road, London NWI 7DX Library of Congress Cataloging-in-Publication Data Cox, Earl. The fuzzy systems handbook: a practitioner’s guide to building, using, and maintaining fuzzy systems / Earl Cox. p. cm. Includes bibliographical references and index. ISBN 0-12-194270-8 1. System design. 2. Adaptive control systems. 3. Fuzzy systems. I. Title. QA76.9.S88C72 1994 003'7--dc20 93-42608 CIP Printed in the United States of America 94 65 96 97 IP 9 8 7 6 5 4 3 2 The Fuzzy Systems Handbook by Earl Cox