2012-08-08 2 views
3

다음 스크립트의 내용이 잘못되었습니다 http://rise4fun.com/Z3Py/Cbl? 마지막 두 줄을 추가하는 것은 나에게 다음과 같은 오류 'instancemethod' object is not #subscriptableZ3Py 코드의 오류

x,t,t1,t2,x_next=Reals ('x t t1 t2 x_next') 
location,location_next=Bools('location location_next') 
x=0 
location=BoolVal(False) 
k=20 
for i in range(k): 
s=Solver() 
s.add(Or(And(x_next-x>=2*t,x_next-x<=3*t,x_next<=12,t>0,Not(location)), 
     And(x_next-x>=-2*t,x_next-x<=-t,x_next>=0,t>0,location)),location_next==If(And(Not(location),x_next>=12),True,If(And(location,x_next<=0),False,location))) 

print s.check() 
print s.model() 
m=s.model 
#x=m[x_next] 
#location=m[location_next] 

답변

5

m=s.model을 제공 m에 함수를 지정합니다.

m=s.model() 
+0

@Leonardo 드 모 우라 : 오타 수정 주셔서 감사합니다 난 당신이 전화를 걸 s.model를 호출 한 결과를 할당, 그래서 괄호를 포함하는 의미 생각합니다. –

+0

@Hafiz ul Asad thanx –