LINGUISTIC Shelf_time TYPE int MIN 0 MAX 1500 { MEMBER long { 60, 100, 1500, 1500 } MEMBER short { 0, 0, 40, 60 } } LINGUISTIC Shelf_life TYPE int MIN 0 MAX 1500 { MEMBER Short { 0, 0, 30, 60 } MEMBER Long { 30,60, 300, 360 } MEMBER Forever { 0, 0,1500,1500 } } LINGUISTIC Payment TYPE int MIN 0 MAX 300 { MEMBER Prompt { 0, 0, 30, 45 } MEMBER Normal { 30, 45, 60, 75 } MEMBER Eventually { 60, 80, 180, 300 } MEMBER Nagging { 75, 120, 300, 300 } } LINGUISTIC Quantity TYPE int MIN 0 MAX 500 { MEMBER Small { 1, 3, 3, 5 } MEMBER Normal { 2, 5, 7, 10 } MEMBER Large { 7,10, 25, 30 } MEMBER huge { 25,50,500,500 } } LINGUISTIC Customer TYPE int MIN 0 MAX 150 { MEMBER New { 1, 1, 2, 2 } MEMBER Recent { 2, 5, 10, 20 } MEMBER LongTerm { 5,10,150,150 } } CONSEQUENCE discount TYPE float DEFUZZ cg { MEMBER deep { 120 } MEMBER large { 65 } MEMBER high { 50 } MEMBER special { 35 } MEMBER normal { 20 } MEMBER low { 5 } MEMBER none { 0 } } FUZZY CalculateDiscount { IF shelf_time IS long THEN discount IS large IF shelf_time IS short THEN discount IS low IF shelf_life IS short THEN discount IS high IF shelf_life IS Long THEN discount IS normal IF quantity IS small THEN discount IS none IF quantity IS large THEN discount IS large IF quantity IS huge THEN discount IS high IF Customer IS new THEN discount IS special IF customer IS recent THEN discount IS normal IF customer IS longterm THEN discount IS large IF shelf_life IS short AND shelf_time IS long THEN discount IS deep } void main (void) { // . . . Application code to get crisp numbers for // Cost Markup Shelf_time Shelf_life Payment Quantity Customer CalculateDiscount (); Quote = (cost + (cost * markup)) * ( 1.0 - (discount / 100.0)); }