add hardware ranges
This commit is contained in:
23
qspace.py
23
qspace.py
@ -87,6 +87,29 @@ class QSpace3D(Device):
|
|||||||
for name, value in kwargs.items():
|
for name, value in kwargs.items():
|
||||||
setattr(self.dc.cons, name, value)
|
setattr(self.dc.cons, name, value)
|
||||||
|
|
||||||
|
def hard_constraints(x):
|
||||||
|
if x["betain"]<0:
|
||||||
|
return False
|
||||||
|
if x["betaout"]<0:
|
||||||
|
return False
|
||||||
|
if x["nu"]<0:
|
||||||
|
return False
|
||||||
|
if x["nu"]>180:
|
||||||
|
return False
|
||||||
|
if x["mu"]<0:
|
||||||
|
return False
|
||||||
|
if x["mu"]>90:
|
||||||
|
return False
|
||||||
|
if x["chi"]<-30:
|
||||||
|
return False
|
||||||
|
if x["chi"]>30:
|
||||||
|
return False
|
||||||
|
if x["phi"]<-60:
|
||||||
|
return False
|
||||||
|
if x["phi"]>60:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
# if I understand the examples/code correctly, then some more method calls are mandatory?
|
# if I understand the examples/code correctly, then some more method calls are mandatory?
|
||||||
# those should probably all get shortcuts...
|
# those should probably all get shortcuts...
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user