REM REM MODIFIED BY JOHN ROCHE FOR FUZZY LOGIC REM ============================================== REM Authors: Sana Hosseini - shosse20@scu.edu.au REM Tristan Smith - tsmith15@scu.edu.au REM File: SportsSelect.kb REM Descript:SportsSelect is and expert system REM to recommend sports based on REM preferences and characteristics. REM This being a prototype is limited REM in inputs and results. REM Date: 17th May 2005 REM ============================================== REM -----------------RULES------------------------ REM ============================================== REM Preferences REM ============================================== RULE [1.1] If [InOutPreferences] = "Indoor" Then [Sports] = "Squash" @45 and [Sports] = "Soccer Indoor" @45 and [Sports] = "Basketball" @45 and [Sports] = "Soccer Outdoor" @-10 and [Sports] = "Archery" @-10 and [Sports] = "Tennis" @-10 RULE [1.2] If [InOutPreferences] = "Outdoor" Then [Sports] = "Soccer Outdoor" @45 and [Sports] = "Archery" @45 and [Sports] = "Tennis" @45 and [Sports] = "Squash" @-10 and [Sports] = "Soccer Indoor" @-10 and [Sports] = "Basketball" @-10 RULE [1.2.1] If [InOutPreferences] = "Both" Then [Sports] = "Soccer Outdoor" @45 and [Sports] = "Archery" @45 and [Sports] = "Tennis" @45 and [Sports] = "Squash" @45 and [Sports] = "Soccer Indoor" @45 and [Sports] = "Basketball" @45 RULE [1.3] If [TeamPreferences] = "Team" Then [Sports] = "Soccer Indoor" @45 and [Sports] = "Soccer Outdoor" @45 and [Sports] = "Basketball" @45 and [Sports] = "Squash" @-10 and [Sports] = "Archery" @-10 and [Sports] = "Tennis" @-10 RULE [1.4] If [TeamPreferences] = "Solo" Then [Sports] = "Squash" @45 and [Sports] = "Archery" @45 and [Sports] = "Tennis" @45 and [Sports] = "Soccer Indoor" @-10 and [Sports] = "Soccer Outdoor" @-10 and [Sports] = "Basketball" @-10 RULE [1.5] If [TeamPreferences] = "Both" Then [Sports] = "Squash" @45 and [Sports] = "Archery" @45 and [Sports] = "Tennis" @45 and [Sports] = "Soccer Indoor" @45 and [Sports] = "Soccer Outdoor" @45 and [Sports] = "Basketball" @45 REM Characteristics REM =============================================== RULE [2.1] If [BodyType] : "Medium" and [MuscleType] : "Fast" Then [Sports] = "Squash" @50 and [Sports] = "Tennis" @50 RULE [2.11] If [BodyType] : "Tall" and [MuscleType] : "Fast" Then [Sports] = "Squash" @50 and [Sports] = "Tennis" @50 RULE [2.2] If [BodyType] : "Small" and [MuscleType] : "Fast" Then [Sports] = "Soccer Indoor" @50 RULE [2.21] If [BodyType] : "Medium" and [MuscleType] : "Fast" Then [Sports] = "Soccer Indoor" @50 RULE [2.3] If [BodyType] : "Small" "Medium" and [MuscleType] : "Slow" Then [CSports] = "Soccer Outdoor" @50 RULE [2.4] If [BodyType] : "Medium" and [MuscleType] : "Slow" Then [Sports] = "Achery" @50 RULE [2.5] If [BodyType] : "Medium" "Tall" and [MuscleType] : "Fast" "Slow" Then [Sports] = "BasketBall" @50 REM Body Type REM =============================================== RULE [3.1] If [Age] = "12-14" and [Height] = "Small" Then [BodyType] = "Small" @75 and [BodyType] = "Medium" @50 and [BodyType] = "Tall" @25 RULE [3.2] If [Age] = "12-14" and [Height] = "Medium" Then [BodyType] = "Small" @50 and [BodyType] = "Medium" @75 and [BodyType] = "Tall" @50 RULE [3.3] If [Age] = "12-14" and [Height] = "Tall" Then [BodyType] = "Small" @25 and [BodyType] = "Medium" @50 and [BodyType] = "Tall" @75 RULE [3.4] If [Age] = "15-17" and [Height] = "Small" Then [BodyType] = "Small" @80 and [BodyType] = "Medium" @50 and [BodyType] = "Tall" @20 RULE [3.5] If [Age] = "15-17" and [Height] = "Medium" Then [BodyType] = "Small" @40 and [BodyType] = "Medium" @80 and [BodyType] = "Tall" @40 RULE [3.6] If [Age] = "15-17" and [Height] = "Tall" Then [BodyType] = "Small" @20 and [BodyType] = "Medium" @50 and [BodyType] = "Tall" @80 RULE [3.7] If [Age] = "18+" and [Height] = "Small" Then [BodyType] = "Small" @80 and [BodyType] = "Medium" @30 and [BodyType] = "Tall" @-50 RULE [3.8] If [Age] = "18+" and [Height] = "Medium" Then [BodyType] = "Small" @-10 and [BodyType] = "Medium" @80 and [BodyType] = "Tall" @10 RULE [3.9] If [Age] = "18+" and [Height] = "Tall" Then [BodyType] = "Small" @-50 and [BodyType] = "Medium" @30 and [BodyType] = "Tall" @85 REM Muscle Type REM =============================================== RULE [4.1] If [EnduranceRun] = "19+" and [Sprint] = "0-6" Then [MuscleType] = "Slow" @60 and [MuscleType] = "Fast" @60 RULE [4.2] If [EnduranceRun] = "19+" and [Sprint] = "6-10" Then [MuscleType] = "Slow" and [MuscleType] = "Fast" @30 RULE [4.3] If [EnduranceRun] = "19+" and [Sprint] = "10+" Then [MuscleType] = "Slow" @60 RULE [4.4] If [EnduranceRun] = "13-18" and [Sprint] = "0-6" Then [MuscleType] = "Slow" @30 and [MuscleType] = "Fast" @60 RULE [4.5] If [EnduranceRun] = "13-18" and [Sprint] = "6-10" Then [MuscleType] = "Slow" @30 and [MuscleType] = "Fast" @30 RULE [4.6] If [EnduranceRun] = "13-18" and [Sprint] = "10+" Then [MuscleType] = "Slow" @30 RULE [4.7] If [EnduranceRun] = "0-12" and [Sprint] = "0-6" Then [MuscleType] = "Fast" @60 RULE [4.8] If [EnduranceRun] = "0-12" and [Sprint] = "6-10" Then [MuscleType] = "Fast" @30 and [MuscleType] = "Slow" @30 REM ---------------GOALS+MINCF + maxvals---------- REM =============================================== GOAL [Sports] DEFAULT [Sports] = "Sorry a sport cannot be recommended at this stage" MINCF 30 MAXVALS [MuscleType]3 MAXVALS [BodyType] 4 MAXVALS [Sports] 7 REM ----------------PROMPTS------------------------ REM =============================================== PROMPT [InOutPreferences] MultChoice "Choose your preferences" "Indoor" "Outdoor" "Both" DEFAULT [InOutPreferences] = "Both" PROMPT [TeamPreferences] MultChoice "Choose your preferences" "Team" "Solo" "Both" DEFAULT [TeamPreferences] = "Both" PROMPT [Age] MultChoice "Select Your Age" "12-14" "15-17" "18+" DEFAULT [Age] = "18+" PROMPT [Height] MultChoice "Are you..." "Small" "Medium" "Tall" DEFAULT [Height] = "Tall" PROMPT [EnduranceRun] MultChoice "How many laps running can you do in 6mins (100m Laps)?" "0-12" "13-18" "19+" DEFAULT [EnduranceRun] = "0-12" PROMPT [Sprint] MultChoice "How fast can you run 40m (Seconds)?" "10+" "6-10" "0-6" DEFAULT [Sprint] = "10+" REM -----------------TRANSLATES-------------------- REM =============================================== TRANSLATE B_SUBMIT = "Enter Response" TRANSLATE TR_NORESP = "Unkown" TRANSLATE TR_RESULTS = "Sports you should try are..." TRANSLATE TR_VALUE = "" TRANSLATE TR_OF = ". " TRANSLATE TR_ISRESULT = ":"