/* ---------------------------------------------------------------------- RULES ---------------------------------------------------------------------- */ /* Small shop */ if floor_area_m2 be small_floor and activity_index be quiet_activity then waste_kg_day := waste_10. if floor_area_m2 be small_floor and activity_index be normal_activity then waste_kg_day := waste_14. if floor_area_m2 be small_floor and activity_index be busy_activity then waste_kg_day := waste_19. /* Medium shop */ if floor_area_m2 be medium_floor and activity_index be quiet_activity then waste_kg_day := waste_16. if floor_area_m2 be medium_floor and activity_index be normal_activity then waste_kg_day := waste_23. if floor_area_m2 be medium_floor and activity_index be busy_activity then waste_kg_day := waste_31. /* Large shop */ if floor_area_m2 be large_floor and activity_index be quiet_activity then waste_kg_day := waste_26. if floor_area_m2 be large_floor and activity_index be normal_activity then waste_kg_day := waste_38. if floor_area_m2 be large_floor and activity_index be busy_activity then waste_kg_day := waste_51. /* ---------------------------------------------------------------------- INPUT: floor area Anchor points: small = 350 m2, medium = 700 m2, large = 1050 m2. ---------------------------------------------------------------------- */ low( floor_area_m2, 0 ). high( floor_area_m2, 1400 ). scale( floor_area_m2, 'm2' ). fuzzy_set( floor_area_m2, small_floor, tri( 0, 350, 700 ) ). fuzzy_set( floor_area_m2, medium_floor, tri( 350, 700, 1050 ) ). fuzzy_set( floor_area_m2, large_floor, tri( 700, 1050, 1400 ) ). /* ---------------------------------------------------------------------- INPUT: activity index Anchor points: quiet = 0.5, normal = 1.0, busy = 1.5. ---------------------------------------------------------------------- */ low( activity_index, 0 ). high( activity_index, 2 ). scale( activity_index, 'relative activity index' ). fuzzy_set( activity_index, quiet_activity, tri( 0, 0.5, 1.0 ) ). fuzzy_set( activity_index, normal_activity, tri( 0.5, 1.0, 1.5 ) ). fuzzy_set( activity_index, busy_activity, tri( 1.0, 1.5, 2.0 ) ). /* ---------------------------------------------------------------------- OUTPUT: total daily waste Each symmetric triangle is centred on one Week-3 surface anchor. At the exact input anchors, the corresponding rule therefore defuzzifies to that anchor value (subject only to the engine's numerical sampling). ---------------------------------------------------------------------- */ low( waste_kg_day, 0 ). high( waste_kg_day, 60 ). scale( waste_kg_day, 'kg/day' ). fuzzy_set( waste_kg_day, waste_10, tri( 6, 10, 14 ) ). fuzzy_set( waste_kg_day, waste_14, tri( 10, 14, 18 ) ). /* Variant-A recalibrated medium-shop consequents. */ fuzzy_set( waste_kg_day, waste_16, tri( 12, 16, 20 ) ). fuzzy_set( waste_kg_day, waste_23, tri( 19, 23, 27 ) ). fuzzy_set( waste_kg_day, waste_31, tri( 27, 31, 35 ) ). fuzzy_set( waste_kg_day, waste_18, tri( 14, 18, 22 ) ). fuzzy_set( waste_kg_day, waste_19, tri( 15, 19, 23 ) ). fuzzy_set( waste_kg_day, waste_26, tri( 22, 26, 30 ) ). fuzzy_set( waste_kg_day, waste_26_2, tri( 22.2, 26.2, 30.2 ) ). fuzzy_set( waste_kg_day, waste_35, tri( 31, 35, 39 ) ). fuzzy_set( waste_kg_day, waste_38, tri( 34, 38, 42 ) ). fuzzy_set( waste_kg_day, waste_51, tri( 47, 51, 55 ) ).