Exemplo n.º 1
0
        public MainForm()
        {
            //Initializing of all variables needed
            InitializeComponent();
            environment = new Mommosoft.ExpertSystem.Environment();

            //Load the clips file
            environment.Load("mobilephone.clp");

            //Set initial stage
            UIState = 0;
            SetUIState(Defintions.PhaseStart);
            this.buttonRestart.Visible = false;

            //Initializing lists of information to be stored at each phase
            preferencesDetails      = new List<String>();
            preferencesPhoneList    = new List<MobilePhoneRecommendation>();
            phoneSpecsDetails       = new List<String>();
            phoneSpecsPhoneList     = new List<MobilePhoneRecommendation>();
            personalityDetails      = new List<String>();
            personalityPhoneList    = new List<MobilePhoneRecommendation>();

            results = new List<MobilePhoneRecommendation>();
            iResultIterate = 0;

            phase3Results = new BindingList<MobileResultDisplay>();

            /*
             * Watching of facts is done in output window. So make sure when build output window is shown
             * WactchItem is an enum.
             * @kwanghock
             */
              environment.Watch(WatchItem.All);
            environment.Reset();

            //assert test input to check everything ran correctly. @kwanghock
            //testInput();

            environment.Run();

            //Load the dropdown values for PhaseDetails
            LoadPhaseDetailsDropdown();

            //Load dropdown values for mobile plans
            LoadPhasePlanDropdown();

            //Test by getting all the facts see whether reflect correctly @kwanghock
            //test();
        }