-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain_gi.py~
64 lines (48 loc) · 1.49 KB
/
main_gi.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# -*- coding: utf-8 -*-
import argparse
from leitorXML import *
from instGen import *
parser = argparse.ArgumentParser(description='OPMS_instGen')
parser.add_argument('InstArq', help='Arquivo com os parâmetros da instância')
args = parser.parse_args()
Configuracao = LerXMLGen(args.InstArq)
nomeArqBloco = "{}.bloc".format(Configuracao["ArqName"].encode('utf-8'))
nomeArqPrec = "{}.prec".format(Configuracao["ArqName"].encode('utf-8'))
figName = "{}.prec".format(Configuracao["ArqName"].encode('utf-8'))
Mina = Configuracao["Mina"]
Valor = Configuracao["Valor"]
tx = Mina["Tx"]
ty = Mina["Ty"]
tz = Mina["Tz"]
sigmin = Mina["SigmaMin"]
sigmax = Mina["SigmaMax"]
numero_de_clusters = Mina["NumeroClusters"]
print "\n"
print args.InstArq
print Configuracao["ArqName"].encode('utf-8')
print nomeArqBloco
print nomeArqPrec
print numero_de_clusters
[B,dens] = CriaMina(tx,ty,tz,sigmin,sigmax,numero_de_clusters)
mxb = Valor["BeneficioMax"]
mnb = Valor["BeneficioMin"]
mxc = Valor["CustoMax"]
print "\n"
print mxb
print mnb
print mxc
approc = criaAPP(B,dens,mxb,mnb,mxc)
criaArqBloco(nomeArqBloco,B,approc)
pList = criaPrecList(B,tx,ty,tz)
criaArqPrec(nomeArqPrec,B,pList)
upitList,precValue = UPIT(B,approc,pList)
pList2 = criaPrecList(upitList,tx,ty,tz)
b1x = [b[0] for b in B]
b1y = [b[1] for b in B]
b1z = [b[2] for b in B]
mina = [b1x,b1y,b1z]
b2x = [b[0] for b in upitList]
b2y = [b[1] for b in upitList]
b2z = [b[2] for b in upitList]
upit = [b2x,b2y,b2z]
scatter3d(figName,mina,upit,approc,precValue)