-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaxPL.py
More file actions
55 lines (38 loc) · 1.39 KB
/
maxPL.py
File metadata and controls
55 lines (38 loc) · 1.39 KB
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
import numpy as np
class PL():
def __init__(self,c,b,restricoes):
self.__c = c
self.__b = b
self.__restricoes = restricoes
def copia(self):
return PL(self.getC(), self.getB(), self.getRestricoes())
def numRestricoes(self):
return self.__restricoes.shape[0]
def numVariaveisRestricoes(self):
return self.__restricoes.shape[1]
def numVariaveisC(self):
return self.__c.shape[0]
def getDiferencaNumVariaveisCERestricoes(self):
return self.__c.shape[0] - self.__restricoes.shape[1]
def print(self):
print("C: {}".format(self.__c))
print("B: {}".format(self.__b))
print("Restrições:\n {}".format(self.__restricoes))
def getRestricoes(self):
return self.__restricoes.copy()
def setRestricoes(self,novasRestricoes):
self.__restricoes = novasRestricoes
def getC(self):
return self.__c.copy()
def setC(self, novoC):
self.__c = novoC
def getB(self):
return self.__b.copy()
def setB(self, novoB):
self.__b = novoB
def attValorB(self, numLinha, valor):
self.__b[numLinha] = valor
def attLinhaRestricoes(self, numLinha, novaLinha):
self.__restricoes[numLinha] = novaLinha
def addEmC(self, vetor):
self.__c = np.concatenate((self.__c,vetor), axis=None)