本文整理汇总了Python中simulator.Simulator.get_manager方法的典型用法代码示例。如果您正苦于以下问题:Python Simulator.get_manager方法的具体用法?Python Simulator.get_manager怎么用?Python Simulator.get_manager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simulator.Simulator
的用法示例。
在下文中一共展示了Simulator.get_manager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import get_manager [as 别名]
def main():
""" Example: UnitXObjectの変数を保存し,取り出し,確認する.
"""
from simulator import Simulator
s = Simulator()
UnitXObject.manager = s.get_manager()
UnitXObject.scopes = s.get_scopes()
# Regist part
crr_scope = s.get_scopes().peek()
crr_scope['x'] = UnitXObject(value=1.5, varname='x', is_none=False, unit=Unit(ex_numer=u'm', numer=u'cm', ex_denom=None, denom=None))
crr_scope['y'] = UnitXObject(value=1500, varname='y', is_none=False, unit=Unit(ex_numer=u'm', numer=u'km', ex_denom=u'時', denom=u'分'))
s.get_scopes().new_scope()
# Find & Show part
found_scope = s.get_scopes().peek().find_scope_of('x')
Util.dump(s.get_scopes())
# Checking equals()
tmp_obj = UnitXObject(value=1.5, varname='x', is_none=False, unit=Unit(ex_numer=None, numer=u'cm', ex_denom=None, denom=None))
print tmp_obj
print crr_scope['x'] == tmp_obj
# Clear part
s.get_scopes().del_scope()
s.get_scopes().del_scope()
return Constants.EXIT_SUCCESS
示例2: main
# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import get_manager [as 别名]
def main():
"""Run an example for a Stdlib class."""
from unitx_object import UnitXObject
from unit import Unit
from simulator import Simulator
s = Simulator()
UnitXObject.manager = s.get_manager()
UnitXObject.scopes = s.get_scopes()
l = UnitXObject(value=1.5, varname='x', is_none=False, unit=Unit(numer=u'cm'))
r = UnitXObject(value=1.5, varname='y', is_none=False, unit=Unit(numer=u'cm'))
func_obj = None
stdlib = Stdlib()
stdlib.expect([l,r], func_obj)
return Constants.EXIT_SUCCESS
示例3: main
# 需要导入模块: from simulator import Simulator [as 别名]
# 或者: from simulator.Simulator import get_manager [as 别名]
def main():
"""Run an example for a Unit class."""
from simulator import Simulator
s = Simulator()
manager = s.get_manager()
minute = manager.get_criterion(u'分')
hour = manager.get_criterion(u'時')
value = 120 * (hour / minute)
Util.dump(manager.unit_dict)
print u'kind of unit:', manager.get_unit_id(u'分')
print '%s分' % value
print '-' * 10
from unit import Unit
print manager._trans_original_value(u"10:00 - 17:00", Unit(u'US_Eastern', u'Asia_Tokyo'))
return Constants.EXIT_SUCCESS