Skip to content

Commit

Permalink
added typ property to State
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisTimperley committed Sep 24, 2018
1 parent d6559a4 commit 5f135cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion houston/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
class Variable(object):
def __init__(self,
name: str,
typ: Type,
getter, # FIXME add annotation
noise: Optional[Union[int, float]] = None
) -> None:
Expand All @@ -27,16 +28,21 @@ def __init__(self,
Parameters:
name: the name of this variable.
type: the type of this variable.
typ: the type of this variable.
getter: a lambda function, used to obtain the value of this
variable.
noise: the inherent level of noise when measuring this variable.
"""
assert noise is None or noise >= 0
self.__name = name
self.__typ = typ
self.__getter = getter
self.__noise = noise

@property
def typ(self) -> Type:
return self.__typ

@property
def is_noisy(self) -> bool:
return self.__noise is not None
Expand Down

0 comments on commit 5f135cb

Please sign in to comment.