Esempio n. 1
0
 void Start()
 {
     health = GetComponent <Health> ();
     fov    = GetComponent <FieldOfView> ();
     grudge = GetComponent <GrudgeList> ();
     sample = new RandomSample(hands != null ? hands.Length : 0, true);
 }
Esempio n. 2
0
    public static Tuple <Chrom, Chrom> Select(Chrom[] population)
    {
        int count = population.Length;

        int[] competitors_1 = RandomSample.Sample(Var.tour, 0, count);
        int[] competitors_2 = RandomSample.Sample(Var.tour, 0, count);

        Chrom father = Max(competitors_1, population);
        Chrom mother = Max(competitors_2, population);

        return(new Tuple <Chrom, Chrom>(father, mother));
    }
Esempio n. 3
0
    public void GenerateSectorsContent(List <SectorInfo> sectors, TerrainVerticesDatabase vertDatabase)
    {
        RandomSample rndSample = new RandomSample(sectors.Count);

        foreach (SectorArrangement sectorType in sectorTypes)
        {
            int        rndIndex   = rndSample.Next();
            SectorInfo sectorInfo = sectors[rndIndex];

            sectorType.Setup(sectorInfo, vertDatabase, sectorInfo.gameObject.transform);
        }
    }
Esempio n. 4
0
    public void Start()
    {
        randomSample = randomSample.GetComponent <RandomSample>();
        db           = GameObject.Find("DataBase").GetComponent <DataBase>();

        nextTru = false;

        countryID = Random.Range(0, db.items.Count);
        Swipetext.GetComponent <Text>().color = new Color(0, 0, 0, 0);

        CreateStatsPerson(countryID);

        swichBag.sizeBag = Random.Range(0, 2);
    }
Esempio n. 5
0
    public static int Main()
    {
        RandomSample test = new RandomSample();

        TestLibrary.TestFramework.BeginTestCase("RandomSample");

        if (test.RunTests())
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("PASS");
            return 100;
        }
        else
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("FAIL");
            return 0;
        }
    }
Esempio n. 6
0
    public static int Main()
    {
        RandomSample test = new RandomSample();

        TestLibrary.TestFramework.BeginTestCase("RandomSample");

        if (test.RunTests())
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("PASS");
            return(100);
        }
        else
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("FAIL");
            return(0);
        }
    }
 void Start()
 {
     sample    = new RandomSample(spawnPoints.Length);
     currLvl   = 1;
     currTrial = 0;
 }