namelist, gender, age
This commit is contained in:
@@ -1,11 +1,20 @@
|
|||||||
import java.lang.Double;
|
import java.lang.Double;
|
||||||
Citizen[] citizen = new Citizen[1];
|
int i_citizenAmount = 1500;
|
||||||
|
int i_femaleCount;
|
||||||
|
Citizen[] citizen = new Citizen[i_citizenAmount];
|
||||||
|
|
||||||
void initCitizen() {
|
void initCitizen() {
|
||||||
//namen: ethuriel, nathaniel, loriel, samuel, aluriel, aleriel, thaliel, suriel, kaliel,
|
//namen: ethuriel, nathaniel, loriel, samuel, aluriel, aleriel, thaliel, suriel, kaliel,
|
||||||
int[][] claireArray = { { 00, 2 }, { 1, 3} };
|
int[][] claireArray = { { 00, 2 }, { 1, 3} };
|
||||||
|
|
||||||
citizen[0] = new Citizen(59, "Claire", claireArray);
|
for (int i = 0; i < i_citizenAmount; i++){
|
||||||
|
int gender = int(random(0,2));
|
||||||
|
if(gender == 0) i_femaleCount++;
|
||||||
|
int age = int(random(0,100));
|
||||||
|
citizen[i] = new Citizen(int(random(0,houses.size())), S_citizenNames[gender][int(random(0,S_citizenNames[gender].length))], gender, age);
|
||||||
|
|
||||||
|
}
|
||||||
|
//citizen[0] = new Citizen(59, "Test", claireArray);
|
||||||
//citizen[1] = new Citizen(121, "Matze");
|
//citizen[1] = new Citizen(121, "Matze");
|
||||||
//citizen[2] = new Citizen(18, "Freddy");
|
//citizen[2] = new Citizen(18, "Freddy");
|
||||||
//citizen[3] = new Citizen(59, "Korbi");
|
//citizen[3] = new Citizen(59, "Korbi");
|
||||||
@@ -17,11 +26,10 @@ void initCitizen() {
|
|||||||
//citizen[9] = new Citizen(59, "Paul");
|
//citizen[9] = new Citizen(59, "Paul");
|
||||||
|
|
||||||
for (int i = 0; i < citizen.length; i++) {
|
for (int i = 0; i < citizen.length; i++) {
|
||||||
citizen[i].spawn(int(random(0, houses.size())));
|
citizen[i].spawn(citizen[i].i_home);
|
||||||
}
|
}
|
||||||
|
|
||||||
selectCitizen(0);
|
selectCitizen(0);
|
||||||
//citizen[2].spawn(59);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int i_selectedCitizen;
|
int i_selectedCitizen;
|
||||||
@@ -40,6 +48,9 @@ class Citizen {
|
|||||||
float f_xPos, f_yPos;
|
float f_xPos, f_yPos;
|
||||||
float f_movementSpeed = 10;
|
float f_movementSpeed = 10;
|
||||||
boolean b_selected;
|
boolean b_selected;
|
||||||
|
int i_gender;
|
||||||
|
String S_gender;
|
||||||
|
int i_age;
|
||||||
|
|
||||||
//0-100:
|
//0-100:
|
||||||
//motivation (bei arbeiter montag ~40, freitag ~80 - 100)
|
//motivation (bei arbeiter montag ~40, freitag ~80 - 100)
|
||||||
@@ -50,14 +61,12 @@ class Citizen {
|
|||||||
|
|
||||||
// identität: gelbhemd, lokal, regional, national, international, fremd,
|
// identität: gelbhemd, lokal, regional, national, international, fremd,
|
||||||
|
|
||||||
|
Citizen(int home, String name, int gender, int age) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Citizen(int home, String name, int[][] schedule) {
|
|
||||||
i_home = home;
|
i_home = home;
|
||||||
S_name = name;
|
S_name = name;
|
||||||
|
i_gender = gender;
|
||||||
|
S_gender = i_gender == 0 ? "Female" : "Male";
|
||||||
|
i_age = age;
|
||||||
i_diameter = 15;
|
i_diameter = 15;
|
||||||
pathFinder = makePathFinder(gs, pathAlgorithm);
|
pathFinder = makePathFinder(gs, pathAlgorithm);
|
||||||
}
|
}
|
||||||
@@ -188,3 +197,12 @@ class Citizen {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String[][] S_citizenNames = { { "Marie", "Mari", "Sophie", "Maria", "Sophia", "Sofia", "Emilia", "Emma", "Hannah", "Hanna", "Anna", "Luisa", "Louisa", "Mia", "Emma", "Sophia", "Sofia", "Hanna", "Hannah", "Emilia",
|
||||||
|
"Mia", "Anna", "Lina", "Mila", "Klara", "Clara", "Marie", "Lea", "Leah", "Lena", "Henri", "Luisa", "Ella", "Leni", "Sophie", "Sofie", "Marie", "Maria", "Luise", "Louise", "Sophia", "Sofia",
|
||||||
|
"Elisabeth", "Katharina", "Catharina", "Charlotte", "Johanna", "Emilia", "Anna", "Luisa", "Louisa", "Victoria", "Viktoria", "Josefine", "Josephine", "Mathilda", "Matilda", "Layla", "Leyla", "Elif", "Nur", "Amira", "Aliyah", "Amina" },
|
||||||
|
{ "Maximilian", "Alexander", "Paul", "Elias", "Ben", "Noah", "Noa", "Leon", "Léon", "Louis", "Luis", "Jonas", "Felix", "Ben", "Paul", "Noah", "Noa", "Leon", "Léon", "Jonas", "Felix",
|
||||||
|
"Elias", "Louis", "Luis", "Lukas", "Lucas", "Maximilian", "Finn", "Henry", "Emil", "Luca", "Luka", "Jakob", "Jacob", "Alexander", "Maximilian", "Elias", "Paul", "Michael", "Karl", "Carl",
|
||||||
|
"Johannes", "Nico", "Luka", "Johann", "Stefan", "Louis", "Luis", "Christian", "Kristian", "Anton", "Andreas", "David", "Mohammed", "Ali", "Malik", "Emir", "Yusuf", "Ilyas" } };
|
||||||
|
|
||||||
|
|||||||
4
UI.pde
4
UI.pde
@@ -24,9 +24,13 @@ void drawUI() {
|
|||||||
|
|
||||||
String[] debug = {
|
String[] debug = {
|
||||||
"FPS: " + int(frameRate),
|
"FPS: " + int(frameRate),
|
||||||
|
"Amount citizen: " + i_citizenAmount,
|
||||||
|
"Females: " + i_femaleCount + " Males: " + str(i_citizenAmount-i_femaleCount),
|
||||||
" ",
|
" ",
|
||||||
"Selected Citizen ID: " + i_selectedCitizen,
|
"Selected Citizen ID: " + i_selectedCitizen,
|
||||||
"Name: " + citizen[i_selectedCitizen].S_name,
|
"Name: " + citizen[i_selectedCitizen].S_name,
|
||||||
|
"Gender: " + citizen[i_selectedCitizen].S_gender,
|
||||||
|
"Age: " + citizen[i_selectedCitizen].i_age,
|
||||||
"x: " + citizen[i_selectedCitizen].f_xPos + " y: " + citizen[i_selectedCitizen].f_yPos,
|
"x: " + citizen[i_selectedCitizen].f_xPos + " y: " + citizen[i_selectedCitizen].f_yPos,
|
||||||
"Movement speed: " + citizen[i_selectedCitizen].f_movementSpeed,
|
"Movement speed: " + citizen[i_selectedCitizen].f_movementSpeed,
|
||||||
"Velocity: ",
|
"Velocity: ",
|
||||||
|
|||||||
Reference in New Issue
Block a user