这是我目前的代码:
def uniform_distribution(users,radius):
user_coordinates_distance=[]
user_coordinates=[]
finding_shadowing=[]
r=radius*np.sqrt(np.random.uniform(0,1,users))
angle=2*np.pi*np.random.uniform(0,1,users)
x = r*np.cos(angle)
y = r*np.sin(angle)
user_distance = np.sqrt(x*x+y*y)
x_shadowing=1000*x
y_shadowing=1000*y
x_shadowing=(x_shadowing-x_shadowing%10)/10
y_shadowing=(y_shadowing-y_shadowing%10)/10
finding_shadowing=shadowing(x_shadowing,y_shadowing,shadowing_matrix)
print(finding_shadowing)
for i in range (0,users):
user_coordinates=[x[i],y[i],user_distance[i],finding_shadowing[i]]
user_coordinates_distance.append(user_coordinates)
return (user_coordinates_distance)
这是我运行时遇到的错误:
Traceback (most recent call last):
File "C:\Users\Ajit\Desktop\maryland\Sem 2\ENTS 656\project656\main program and functions\main_1.py", line 136, in <module>
user_coordinates=uniform_distribution(attempts,cell_radius)#list [x,y,distance,shadowing]
File "C:\Users\Ajit\Desktop\maryland\Sem 2\ENTS 656\project656\main program and functions\main_1.py", line 81, in uniform_distribution
finding_shadowing=shadowing(x_shadowing,y_shadowing,shadowing_matrix)
TypeError: 'float' object is not callable
这个错误究竟是什么意思?