-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathE2.py
31 lines (24 loc) · 1.01 KB
/
E2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from LinealEquationAG.SQAG import Equation
PRECISION_ = 4
# Define base parameters
generation_number = 2000
point_precision_stop = 0.01
# Elitism number : This allow to select N amount of chromosomes from generation to pass the next
elitism_number = 20
crossover_percentage = 0.9
mutation_percentage = 0.3
limits_by_incognitos = {'A': [4980, 5000],
'P': [2990, 3020],
'V': [3000, 3020]}
equation = [{'A': 16.98, 'P': 9, 'V': 9, 'ind_term': 138900},
{'A': 15.9, 'P': 8.72, 'V': 8.52, 'ind_term': 131220},
{'A': 14.08, 'P': 8.2, 'V': 8.76, 'ind_term': 121280}]
equation_problem = Equation(limits_by_incognitos,
equation,
generation_number,
crossover_percentage,
mutation_percentage,
elitism_number,
point_precision_stop,
PRECISION_)
equation_problem.solve()