feat: New way to generata data using good shape names. Also less datas than before, with less pieces.

This commit is contained in:
damien DELPY 2024-12-03 23:15:18 +01:00
parent 19047a4635
commit fbd812336d
No known key found for this signature in database
3 changed files with 58 additions and 11 deletions

View File

@ -0,0 +1,20 @@
Bloc-Pyramide
Cube-Mini
Triangulaire Plat
Hexabloc
Tête-Connecteur
Barrette Système
Puce Tactile
Dent de Fixation
Carreau Pivot
TetraBloc
Connecteur Enclencheur
Grille Magique
Base Origami
Pont Arc
Cube-capsule
Cône Inversé
Plaque Ancrée
Croix Clé
Fragment Combiné
Poutre Courbée
1 Bloc-Pyramide
2 Cube-Mini
3 Triangulaire Plat
4 Hexabloc
5 Tête-Connecteur
6 Barrette Système
7 Puce Tactile
8 Dent de Fixation
9 Carreau Pivot
10 TetraBloc
11 Connecteur Enclencheur
12 Grille Magique
13 Base Origami
14 Pont Arc
15 Cube-capsule
16 Cône Inversé
17 Plaque Ancrée
18 Croix Clé
19 Fragment Combiné
20 Poutre Courbée

View File

@ -0,0 +1,20 @@
Bloc Cube
Plaque Rectangle
Triangle Équilatéral
Cylindre Plein
Sphère Creuse
Disque Plat
Hexagone Régulier
Pyramide Carrée
Prisme Rectangulaire
Tore Rond
Prisme Triangulaire
Parallélépipède Incliné
Octogone
Trapèze Isocèle
Ellipsoïde
Dôme Hémisphérique
Tétraèdre
Cône Tronqué
Pentagone Creux
Étoile Symétrique
1 Bloc Cube
2 Plaque Rectangle
3 Triangle Équilatéral
4 Cylindre Plein
5 Sphère Creuse
6 Disque Plat
7 Hexagone Régulier
8 Pyramide Carrée
9 Prisme Rectangulaire
10 Tore Rond
11 Prisme Triangulaire
12 Parallélépipède Incliné
13 Octogone
14 Trapèze Isocèle
15 Ellipsoïde
16 Dôme Hémisphérique
17 Tétraèdre
18 Cône Tronqué
19 Pentagone Creux
20 Étoile Symétrique

View File

@ -31,6 +31,8 @@ pathNameBoxes : str = ".csv/name_boxes.csv"
pathDates : str = ".csv/dates.csv"
pathColors : str = ".csv/colors.csv"
pathBrands : str = ".csv/brands.csv"
pathShapes : str = ".csv/shapes.csv"
pathMotifs : str = ".csv/motifs.csv"
###############################################################################
#
@ -257,13 +259,13 @@ def generate_line_varier(idModele_1 : str, idModele_et : str) -> str:
def generate_line_formes() -> str:
idForme : str = give_not_used_key(idFormeDict)
nomForme : str = "\'" + random_element(pathWords) + "\'"
nomForme : str = "\'" + random_element(pathShapes) + "\'"
return construct_line(idForme, nomForme)
def generate_line_motifs() -> str:
idMotif : str = give_not_used_key(idMotifDict)
nomMotif : str = "\'" + random_element(pathWords) + "\'"
nomMotif : str = "\'" + random_element(pathMotifs) + "\'"
return construct_line(idMotif, nomMotif)
@ -348,6 +350,10 @@ def generate_table_using_quantite_v2(idDict : dict, nameTable : str,
for i in keysUsed:
quantite : int = random.randint(10, 100)
# To generate a few needed pieces.
if (idDict == idModeleDict):
quantite = random.randint(10, 50)
funcGen_i = lambda x: funcGen( str(i), x )
funcGen_2 = lambda : funcGen_i( str(quantite) )
store_table(1, nameTable, funcGen_2)
@ -455,7 +461,7 @@ if __name__ == '__main__':
#
###########################################################################
nbMembres : int = 40
nbMembres : int = 30
store_table(nbMembres, "membres", tablesDict["membres"])
nbCouleurs : int = 21
@ -464,7 +470,7 @@ if __name__ == '__main__':
nbMarques : int = 10
store_table(nbMarques, "marques", tablesDict["marques"])
nbTags : int = 30
nbTags : int = 10
store_table(nbTags, "tags", tablesDict["tags"])
nbFormes : int = 10
@ -473,10 +479,10 @@ if __name__ == '__main__':
nbMotifs : int = 10
store_table(nbMotifs, "motifs", tablesDict["motifs"])
nbPieces : int = 300
nbPieces : int = 100
store_table(nbPieces, "pieces", tablesDict["pieces"])
nbPiecesComp : int = 50
nbPiecesComp : int = 10
store_table(nbPiecesComp, "pieces_complexes",
tablesDict["pieces_complexes"])
@ -486,7 +492,7 @@ if __name__ == '__main__':
#
###########################################################################
nbModeles : int = 10
nbModeles : int = 5
funcGen = lambda : tablesDict["modeles"](
give_used_key(idMembreDict),
give_used_key(idModeleDict)
@ -562,7 +568,7 @@ if __name__ == '__main__':
generate_table_v2(idBoiteDict, "construire", funcGen)
nbContenir : int = nbBoites
for toto in range(30):
for toto in range(20):
funcGen = lambda i, x: tablesDict["contenir"](
i,
give_used_key(idPieceDict),
@ -600,7 +606,7 @@ if __name__ == '__main__':
generate_table_v2(idPieceDict, "etre_forme", funcGen)
nbNecessiter : int = nbModeles
for toto in range(30):
for toto in range(8):
funcGen = lambda i, x: tablesDict["necessiter"](
i,
give_used_key(idPieceDict),
@ -608,12 +614,13 @@ if __name__ == '__main__':
)
generate_table_using_quantite_v2(idModeleDict, "necessiter", funcGen)
nbNoter : int = nbMembres - random.randint(0, nbMembres)
nbNoter : int = nbMembres
funcGen = lambda : tablesDict["noter"](
give_used_key(idModeleDict),
give_used_key(idMembreDict)
)
generate_table(nbNoter, "noter", funcGen)
for toto in range(5):
generate_table(nbNoter, "noter", funcGen)
nbPerdre : int = random.randint(0, 20)
funcGen = lambda x: tablesDict["perdre"](