Ejemplo n.º 1
0
        public void changeMode(AiMode nmode, bool silent = false)
        {
            if (!silent)
            {
                cwrite("Changing AI mode from " + modeCurrent.ToString() + " to: " + nmode.ToString());
            }
            modeCurrent = nmode;
            switch (modeCurrent)
            {
            case AiMode.ANALYTIC:
            {
                mainModule = analyticModule;
                break;
            }

            case AiMode.RANDOM:
            {
                mainModule = randomModule;
                break;
            }

            case AiMode.BIAS:
            {
                mainModule = biasedModule;
                break;
            }
            }
        }
Ejemplo n.º 2
0
 private void Update()
 {
     mainModule = randomModule;
     cwrite("Ready.");
     while (isRunning)
     {
         mainModule.Update();
     }
     cwrite("Done performing tasks.", COLOR_OK);
 }
Ejemplo n.º 3
0
        public void initialise(bool browser = true)
        {
            if (browser)
            {
                ChromeOptions       options = new ChromeOptions();
                ChromeDriverService svc     = ChromeDriverService.CreateDefaultService(@"./cd/");
                svc.SuppressInitialDiagnosticInformation = true;

                options.AddArgument(CD_ARGS);
                options.AddArgument("user-data-dir=" + USERDATA_PATH);
                options.AddArgument("--profile-directory=" + PROFILE_NAME);
                mainBrowser = new ChromeDriver(svc, options);
                //This started giving me errors, maximizing is now handled through the argfile.
                // mainBrowser.Manage().Window.Maximize(); //prevent unintenttionally hiding elements in some versions of FF

                gBrowserInstance = mainBrowser;
                DesiredCapabilities d = new DesiredCapabilities();
            }

            analyticModule = new AnalyticModule(this, mainBrowser);
            randomModule   = new RandomModule(this, mainBrowser);
            biasedModule   = new BiasedModule(this, mainBrowser);
            compareModule  = new ComparativeModule(this, mainBrowser);
        }
Ejemplo n.º 4
0
 private void Update()
 {
     
     mainModule = randomModule;
     cwrite("Ready.");
     while (isRunning)
     {
         mainModule.Update();
     }
     cwrite("Done performing tasks.", COLOR_OK);
 }
Ejemplo n.º 5
0
 public void changeMode(AiMode nmode)
 {
     cwrite("Changing AI mode from " + modeCurrent.ToString() + " to: " + nmode.ToString());
     modeCurrent = nmode;
     switch (modeCurrent)
     {
         case AiMode.ANALYTIC:
             {
                 mainModule = analyticModule;
                 break;
             }
         case AiMode.RANDOM:
             {
                 mainModule = randomModule;
                 break;
             }
         case AiMode.BIAS:
             {
                 mainModule = biasedModule;
                 break;
             }
     }
 }
Ejemplo n.º 6
0
        public void initialise(bool browser=true)
        {
            if (browser)
            {
                FirefoxProfileManager pm = new FirefoxProfileManager();
                FirefoxProfile ffp = pm.GetProfile(Global.FF_PROFILE);
                FirefoxOptions fo = new FirefoxOptions();
                fo.SetLoggingPreference(LogType.Driver, LogLevel.Off); //todo allow toggling this
                fo.SetLoggingPreference(LogType.Client, LogLevel.Off);
                
                mainBrowser = new FirefoxDriver(ffp);
            
                mainBrowser.Manage().Window.Maximize(); //prevent unintenttionally hiding elements in some versions of FF
                
                gBrowserInstance = mainBrowser;
                DesiredCapabilities d = new DesiredCapabilities();
            }

            analyticModule = new AnalyticModule(this, mainBrowser);
            randomModule = new RandomModule(this, mainBrowser);
            biasedModule = new BiasedModule(this, mainBrowser);
            compareModule = new ComparativeModule(this, mainBrowser);

        }