I defined a class, but when I want to use the function in the class, it gives me an error as follows. Can anybody help me? thank you so much.
points = 5
class State:
def __init__(self, a, b, E_min, E_max, P_s_a, P_s_b, points)):
self.state = state
self.isEnd = False
self.a = a
self.b = b
self.E_min = E_min
self.E_max = E_max
self.P_s_a = P_s_a
self.P_s_b = P_s_b
self.points = points
y_model = np.zeros(self.points)
def model(self):
for j in range(0, points):
y_model[j] = a * j + b
print(State.model(2,3))
AttributeError: class State has no attribute 'model'
model()definition is internal to__init__().