コード例 #1
0
        public static Output TextLoader(IHostEnvironment env, LoaderInput input)
        {
            Contracts.CheckValue(env, nameof(env));
            var host = env.Register("ImportTextData");

            env.CheckValue(input, nameof(input));
            EntryPointUtils.CheckInputArgs(host, input);
            var loader = host.CreateLoader(input.Arguments, new FileHandleSource(input.InputFile));

            return(new Output {
                Data = loader
            });
        }
コード例 #2
0
    public void StartSimulation()
    {
        LoaderInput.LoadArchive();

        totalRounds = 0;
        contTimeout = 0;

        for (int cont = 0; cont < propertiesArray.Length; cont++)
        {
            propertiesArray[cont] = new Propertie()
            {
                rentValue = LoaderInput.GetRentValue(cont),
                sellValue = LoaderInput.GetSellValue(cont)
            };
        }

        playerArray[0] = new PlayerCautious();
        playerArray[1] = new PlayerDemanding();
        playerArray[2] = new PlayerImpulsive();
        playerArray[3] = new PlayerRandom();

        for (int matchCont = 0; matchCont < 300; matchCont++)
        {
            ResetVariables();
            DefineStartOrder();
            RunSimulation();
        }

        for (int cont = 0; cont < playerArray.Length; cont++)
        {
            sliderList[cont].GetComponentInChildren <Slider>().value = playerArray[cont].GetWin();
            sliderList[cont].GetComponentInChildren <Text>().text    = playerArray[cont].GetType().ToString()
                                                                       + " win: " + playerArray[cont].GetWin()
                                                                       + " porcentagem %: " + (playerArray[cont].GetWin() * 100 / 300);
        }

        timeOutText.text     = "Timeout: " + contTimeout;
        mediaTurnosText.text = "Media de turnos: " + totalRounds / 300;
    }