|
@@ -294,10 +294,10 @@ class Model(object):
|
294
|
294
|
'nclass': 5, #max number of classes per classtype
|
295
|
295
|
'nofg': 10, #no fieldgroup in a class
|
296
|
296
|
'nfg': 5, #max number of fieldgroups per classes
|
297
|
|
- 'notype': 5, # no types in a class
|
298
|
|
- 'ntype': 3, # max number of types in a class
|
|
297
|
+ 'notype': 10, # no types in a class
|
|
298
|
+ 'ntype': 8, # max number of types in a class
|
299
|
299
|
'seltype': 2, #chances to select an optional field
|
300
|
|
- 'ntypesuperiors': 3, #chances to link with a superior
|
|
300
|
+ 'ntypesuperiors': 2, #chances to link with a superior
|
301
|
301
|
'nofields': 10, # no fields in a fieldgroup
|
302
|
302
|
'nfields' : 8, #max number of fields per fieldgroups
|
303
|
303
|
'rfields': 5,#max number of attributes relation fields
|
|
@@ -338,9 +338,10 @@ class Model(object):
|
338
|
338
|
for emtype in em.components(EmType):
|
339
|
339
|
possible = emtype.possible_superiors()
|
340
|
340
|
for nat in possible:
|
341
|
|
- while random.randint(0, chances['ntypesuperiors']) == 0 and len(possible[nat]) > 0:
|
342
|
|
- i = random.randint(0,len(possible[nat])-1)
|
343
|
|
- emtype.add_superior(possible[nat][i], nat)
|
|
341
|
+ if len(possible[nat]) > 0 and random.randint(0, chances['ntypesuperiors']) == 0:
|
|
342
|
+ random.shuffle(possible[nat])
|
|
343
|
+ for i in range(random.randint(1, len(possible[nat]))):
|
|
344
|
+ emtype.add_superior(possible[nat][i], nat)
|
344
|
345
|
|
345
|
346
|
|
346
|
347
|
#fields creation
|
|
@@ -392,7 +393,7 @@ class Model(object):
|
392
|
393
|
if '_words' not in globals() or globals()['_words_fname'] != words_src:
|
393
|
394
|
globals()['_words_fname'] = words_src
|
394
|
395
|
with open(words_src, 'r') as fpw:
|
395
|
|
- globals()['_words'] = [ l for l in fpw ]
|
|
396
|
+ globals()['_words'] = [ l.strip() for l in fpw ]
|
396
|
397
|
words = globals()['_words']
|
397
|
398
|
return words[random.randint(0,len(words)-1)]
|
398
|
399
|
|