feat: New way to generata data using good shape names. Also less datas than before, with less pieces.
This commit is contained in:
parent
19047a4635
commit
fbd812336d
20
PostgreSQL/.csv/motifs.csv
Normal file
20
PostgreSQL/.csv/motifs.csv
Normal 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
|
|
20
PostgreSQL/.csv/shapes.csv
Normal file
20
PostgreSQL/.csv/shapes.csv
Normal 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
|
|
@ -31,6 +31,8 @@ pathNameBoxes : str = ".csv/name_boxes.csv"
|
|||||||
pathDates : str = ".csv/dates.csv"
|
pathDates : str = ".csv/dates.csv"
|
||||||
pathColors : str = ".csv/colors.csv"
|
pathColors : str = ".csv/colors.csv"
|
||||||
pathBrands : str = ".csv/brands.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:
|
def generate_line_formes() -> str:
|
||||||
idForme : str = give_not_used_key(idFormeDict)
|
idForme : str = give_not_used_key(idFormeDict)
|
||||||
nomForme : str = "\'" + random_element(pathWords) + "\'"
|
nomForme : str = "\'" + random_element(pathShapes) + "\'"
|
||||||
|
|
||||||
return construct_line(idForme, nomForme)
|
return construct_line(idForme, nomForme)
|
||||||
|
|
||||||
def generate_line_motifs() -> str:
|
def generate_line_motifs() -> str:
|
||||||
idMotif : str = give_not_used_key(idMotifDict)
|
idMotif : str = give_not_used_key(idMotifDict)
|
||||||
nomMotif : str = "\'" + random_element(pathWords) + "\'"
|
nomMotif : str = "\'" + random_element(pathMotifs) + "\'"
|
||||||
|
|
||||||
return construct_line(idMotif, nomMotif)
|
return construct_line(idMotif, nomMotif)
|
||||||
|
|
||||||
@ -348,6 +350,10 @@ def generate_table_using_quantite_v2(idDict : dict, nameTable : str,
|
|||||||
for i in keysUsed:
|
for i in keysUsed:
|
||||||
quantite : int = random.randint(10, 100)
|
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_i = lambda x: funcGen( str(i), x )
|
||||||
funcGen_2 = lambda : funcGen_i( str(quantite) )
|
funcGen_2 = lambda : funcGen_i( str(quantite) )
|
||||||
store_table(1, nameTable, funcGen_2)
|
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"])
|
store_table(nbMembres, "membres", tablesDict["membres"])
|
||||||
|
|
||||||
nbCouleurs : int = 21
|
nbCouleurs : int = 21
|
||||||
@ -464,7 +470,7 @@ if __name__ == '__main__':
|
|||||||
nbMarques : int = 10
|
nbMarques : int = 10
|
||||||
store_table(nbMarques, "marques", tablesDict["marques"])
|
store_table(nbMarques, "marques", tablesDict["marques"])
|
||||||
|
|
||||||
nbTags : int = 30
|
nbTags : int = 10
|
||||||
store_table(nbTags, "tags", tablesDict["tags"])
|
store_table(nbTags, "tags", tablesDict["tags"])
|
||||||
|
|
||||||
nbFormes : int = 10
|
nbFormes : int = 10
|
||||||
@ -473,10 +479,10 @@ if __name__ == '__main__':
|
|||||||
nbMotifs : int = 10
|
nbMotifs : int = 10
|
||||||
store_table(nbMotifs, "motifs", tablesDict["motifs"])
|
store_table(nbMotifs, "motifs", tablesDict["motifs"])
|
||||||
|
|
||||||
nbPieces : int = 300
|
nbPieces : int = 100
|
||||||
store_table(nbPieces, "pieces", tablesDict["pieces"])
|
store_table(nbPieces, "pieces", tablesDict["pieces"])
|
||||||
|
|
||||||
nbPiecesComp : int = 50
|
nbPiecesComp : int = 10
|
||||||
store_table(nbPiecesComp, "pieces_complexes",
|
store_table(nbPiecesComp, "pieces_complexes",
|
||||||
tablesDict["pieces_complexes"])
|
tablesDict["pieces_complexes"])
|
||||||
|
|
||||||
@ -486,7 +492,7 @@ if __name__ == '__main__':
|
|||||||
#
|
#
|
||||||
###########################################################################
|
###########################################################################
|
||||||
|
|
||||||
nbModeles : int = 10
|
nbModeles : int = 5
|
||||||
funcGen = lambda : tablesDict["modeles"](
|
funcGen = lambda : tablesDict["modeles"](
|
||||||
give_used_key(idMembreDict),
|
give_used_key(idMembreDict),
|
||||||
give_used_key(idModeleDict)
|
give_used_key(idModeleDict)
|
||||||
@ -562,7 +568,7 @@ if __name__ == '__main__':
|
|||||||
generate_table_v2(idBoiteDict, "construire", funcGen)
|
generate_table_v2(idBoiteDict, "construire", funcGen)
|
||||||
|
|
||||||
nbContenir : int = nbBoites
|
nbContenir : int = nbBoites
|
||||||
for toto in range(30):
|
for toto in range(20):
|
||||||
funcGen = lambda i, x: tablesDict["contenir"](
|
funcGen = lambda i, x: tablesDict["contenir"](
|
||||||
i,
|
i,
|
||||||
give_used_key(idPieceDict),
|
give_used_key(idPieceDict),
|
||||||
@ -600,7 +606,7 @@ if __name__ == '__main__':
|
|||||||
generate_table_v2(idPieceDict, "etre_forme", funcGen)
|
generate_table_v2(idPieceDict, "etre_forme", funcGen)
|
||||||
|
|
||||||
nbNecessiter : int = nbModeles
|
nbNecessiter : int = nbModeles
|
||||||
for toto in range(30):
|
for toto in range(8):
|
||||||
funcGen = lambda i, x: tablesDict["necessiter"](
|
funcGen = lambda i, x: tablesDict["necessiter"](
|
||||||
i,
|
i,
|
||||||
give_used_key(idPieceDict),
|
give_used_key(idPieceDict),
|
||||||
@ -608,12 +614,13 @@ if __name__ == '__main__':
|
|||||||
)
|
)
|
||||||
generate_table_using_quantite_v2(idModeleDict, "necessiter", funcGen)
|
generate_table_using_quantite_v2(idModeleDict, "necessiter", funcGen)
|
||||||
|
|
||||||
nbNoter : int = nbMembres - random.randint(0, nbMembres)
|
nbNoter : int = nbMembres
|
||||||
funcGen = lambda : tablesDict["noter"](
|
funcGen = lambda : tablesDict["noter"](
|
||||||
give_used_key(idModeleDict),
|
give_used_key(idModeleDict),
|
||||||
give_used_key(idMembreDict)
|
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)
|
nbPerdre : int = random.randint(0, 20)
|
||||||
funcGen = lambda x: tablesDict["perdre"](
|
funcGen = lambda x: tablesDict["perdre"](
|
||||||
|
Loading…
x
Reference in New Issue
Block a user