Esempio n. 1
0
    /// -----------------------------------------------------------------------------------------------------------------------------///
    /// -----------------------------------------------------------------------------------------------------------------------------///
    /// <summary>
    /// Interface function to generate a person with randomly properties
    /// </summary>
    public static Person generateRandomPerson()
    {
        Person p = new Person("", null, new Person[2]);

        p.biologicalSex = (Random.Integer(0, 2) == 1);
        p.setSexuality(p.biologicalSex, Random.Float(0, 1));
        p.age                = Random.Integer(0, 70);
        p.DateOfBirth        = Simulator.CurrentTime.AddYears(-p.age);
        p.firstName          = NameManager.getFirstname(p.biologicalSex ? NameManager.sex.male : NameManager.sex.female);
        p.lastName           = NameManager.getSurname(null);
        p.currentInstitution = InstitutionManager.RandomInstitutionIfAny();
        return(p);
    }
Esempio n. 2
0
    public string GenerateRandomLastName()
    {
        List <string> parentNames = new List <string>();

        if (parents != null)
        {
            for (int i = 0; i < parents.Length; i++)
            {
                if (parents[i] != null)
                {
                    parentNames.Add(parents[i].lastName);
                }
            }
        }
        return(NameManager.getSurname(parentNames));
    }