import Color from "./Color"; import Person from "./Person"; import PersonNetwork from "./PersonsNetwork"; import Sport from "./Sport"; class NetworkGenerator{ static GenerateNetwork(nbPerson: number): PersonNetwork{ let json = require("../res/names.json") const tabSports: Sport[] = [0, 1, 2, 3, 4, 5, 5, 5, 5] const tabColor: Color[] = [0, 1, 2, 3, 4] const tabJeune: number[] = [] const tabAdo: number[] = [] const tabAdulte: number[] = [] const tabVieux: number[] = [] const tabPerson: Person[] = [] const tabNames = json.names let id = 0 for(let i = 0; i < nbPerson/4; i++){ const nombreAleatoire = Math.floor(Math.random() * 14) + 1; tabJeune.push(nombreAleatoire) } for(let i = 0; i < nbPerson/4; i++){ const nombreAleatoire = Math.floor(Math.random() * 5) + 15; tabAdo.push(nombreAleatoire) } for(let i = 0; i < nbPerson/4; i++){ const nombreAleatoire = Math.floor(Math.random() * 10) + 20; tabAdulte.push(nombreAleatoire) } for(let i = 0; i < nbPerson/4; i++){ const nombreAleatoire = Math.floor(Math.random() * 31) + 30; tabVieux.push(nombreAleatoire) } const tabAge: number[][] = [tabJeune, tabAdo, tabAdulte, tabVieux] let tmpTabSport=[...tabSports] let tmpTabColor = [...tabColor] for (let i = 0; i